Fixing assorted compile errors and help lint warnings

db4
Slava Pestov 2008-12-16 01:12:36 -06:00
parent 034022ec7f
commit 63fda570bf
47 changed files with 835 additions and 833 deletions

View File

@ -6,6 +6,7 @@ IN: channels.remote
HELP: <remote-channel> HELP: <remote-channel>
{ $values { "node" "a node object" } { $values { "node" "a node object" }
{ "id" "the id of the published channel on the node" } { "id" "the id of the published channel on the node" }
{ "remote-channel" remote-channel }
} }
{ $description "Create a remote channel that acts as a proxy for a " { $description "Create a remote channel that acts as a proxy for a "
"channel on another node. The remote node's channel must have been " "channel on another node. The remote node's channel must have been "

View File

@ -5,7 +5,7 @@ HELP: openssl-checksum
{ $class-description "The class of checksum algorithms implemented by OpenSSL. The exact set of algorithms supported depends on how the OpenSSL library was compiled; " { $snippet "md5" } " and " { $snippet "sha1" } " should be universally available." } ; { $class-description "The class of checksum algorithms implemented by OpenSSL. The exact set of algorithms supported depends on how the OpenSSL library was compiled; " { $snippet "md5" } " and " { $snippet "sha1" } " should be universally available." } ;
HELP: <openssl-checksum> HELP: <openssl-checksum>
{ $values { "name" "an EVP message digest name" } { "checksum" openssl-checksum } } { $values { "name" "an EVP message digest name" } { "openssl-checksum" openssl-checksum } }
{ $description "Creates a new OpenSSL checksum object." } ; { $description "Creates a new OpenSSL checksum object." } ;
HELP: openssl-md5 HELP: openssl-md5

View File

@ -5,7 +5,7 @@ HELP: trivial-responder
{ $description "The class of trivial responders, which output the same response for every request. New instances are created by calling " { $link <trivial-responder> } "." } ; { $description "The class of trivial responders, which output the same response for every request. New instances are created by calling " { $link <trivial-responder> } "." } ;
HELP: <trivial-responder> HELP: <trivial-responder>
{ $values { "response" response } { "responder" trivial-responder } } { $values { "response" response } { "trivial-responder" trivial-responder } }
{ $description "Creates a new trivial responder which outputs the same response for every request." } ; { $description "Creates a new trivial responder which outputs the same response for every request." } ;
HELP: benchmark? HELP: benchmark?

View File

@ -1,4 +1,4 @@
USING: io.files kernel tools.test io.backend USING: io.files io.pathnames kernel tools.test io.backend
io.files.windows.nt splitting sequences ; io.files.windows.nt splitting sequences ;
IN: io.files.windows.nt.tests IN: io.files.windows.nt.tests

View File

@ -1,6 +1,7 @@
USING: io.launcher tools.test calendar accessors environment USING: io.launcher tools.test calendar accessors environment
namespaces kernel system arrays io io.files io.encodings.ascii namespaces kernel system arrays io io.files io.encodings.ascii
sequences parser assocs hashtables math continuations eval ; sequences parser assocs hashtables math continuations eval
io.files.temp io.directories io.pathnames ;
IN: io.launcher.windows.nt.tests IN: io.launcher.windows.nt.tests
[ ] [ [ ] [

View File

@ -15,7 +15,7 @@ HELP: duplex-stream
{ $class-description "A bidirectional stream wrapping an input and output stream." } ; { $class-description "A bidirectional stream wrapping an input and output stream." } ;
HELP: <duplex-stream> HELP: <duplex-stream>
{ $values { "in" "an input stream" } { "out" "an output stream" } { "stream" " a duplex stream" } } { $values { "in" "an input stream" } { "out" "an output stream" } { "duplex-stream" duplex-stream } }
{ $description "Creates a duplex stream. Writing to a duplex stream will write to " { $snippet "out" } ", and reading from a duplex stream will read from " { $snippet "in" } ". Closing a duplex stream closes both the input and output streams." } ; { $description "Creates a duplex stream. Writing to a duplex stream will write to " { $snippet "out" } ", and reading from a duplex stream will read from " { $snippet "in" } ". Closing a duplex stream closes both the input and output streams." } ;
HELP: with-stream HELP: with-stream

View File

@ -11,7 +11,7 @@ SYMBOL: full-interval
TUPLE: interval { from read-only } { to read-only } ; TUPLE: interval { from read-only } { to read-only } ;
: <interval> ( from to -- int ) : <interval> ( from to -- interval )
2dup [ first ] bi@ { 2dup [ first ] bi@ {
{ [ 2dup > ] [ 2drop 2drop empty-interval ] } { [ 2dup > ] [ 2drop 2drop empty-interval ] }
{ [ 2dup = ] [ { [ 2dup = ] [

View File

@ -50,7 +50,7 @@ HELP: pane-stream
{ $class-description "Pane streams implement the portion of the " { $link "stream-protocol" } " responsible for output of text, including full support for " { $link "styles" } ". Pane streams also support direct output of gadgets via " { $link write-gadget } " and " { $link print-gadget } ". Pane streams are created by calling " { $link <pane-stream> } "." } ; { $class-description "Pane streams implement the portion of the " { $link "stream-protocol" } " responsible for output of text, including full support for " { $link "styles" } ". Pane streams also support direct output of gadgets via " { $link write-gadget } " and " { $link print-gadget } ". Pane streams are created by calling " { $link <pane-stream> } "." } ;
HELP: <pane-stream> HELP: <pane-stream>
{ $values { "pane" pane } { "stream" "a new " { $link pane-stream } } } { $values { "pane" pane } { "pane-stream" "a new " { $link pane-stream } } }
{ $description "Creates a new " { $link pane-stream } " for writing to " { $snippet "pane" } "." } ; { $description "Creates a new " { $link pane-stream } " for writing to " { $snippet "pane" } "." } ;
{ with-pane make-pane } related-words { with-pane make-pane } related-words

View File

@ -1,30 +1,31 @@
! Copyright (C) 2005, 2006 Slava Pestov. ! Copyright (C) 2005, 2006 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: alien.syntax combinators system vocabs.loader alias ; USING: alien.syntax combinators system vocabs.loader alias
constants ;
IN: unix IN: unix
: MAXPATHLEN 1024 ; inline CONSTANT: MAXPATHLEN 1024
: O_RDONLY HEX: 0000 ; inline CONSTANT: O_RDONLY HEX: 0000
: O_WRONLY HEX: 0001 ; inline CONSTANT: O_WRONLY HEX: 0001
: O_RDWR HEX: 0002 ; inline CONSTANT: O_RDWR HEX: 0002
: O_NONBLOCK HEX: 0004 ; inline CONSTANT: O_NONBLOCK HEX: 0004
: O_APPEND HEX: 0008 ; inline CONSTANT: O_APPEND HEX: 0008
: O_CREAT HEX: 0200 ; inline CONSTANT: O_CREAT HEX: 0200
: O_TRUNC HEX: 0400 ; inline CONSTANT: O_TRUNC HEX: 0400
: O_EXCL HEX: 0800 ; inline CONSTANT: O_EXCL HEX: 0800
: O_NOCTTY HEX: 20000 ; inline CONSTANT: O_NOCTTY HEX: 20000
ALIAS: O_NDELAY O_NONBLOCK ALIAS: O_NDELAY O_NONBLOCK
: SOL_SOCKET HEX: ffff ; inline CONSTANT: SOL_SOCKET HEX: ffff
: SO_REUSEADDR HEX: 4 ; inline CONSTANT: SO_REUSEADDR HEX: 4
: SO_OOBINLINE HEX: 100 ; inline CONSTANT: SO_OOBINLINE HEX: 100
: SO_SNDTIMEO HEX: 1005 ; inline CONSTANT: SO_SNDTIMEO HEX: 1005
: SO_RCVTIMEO HEX: 1006 ; inline CONSTANT: SO_RCVTIMEO HEX: 1006
: F_SETFD 2 ; inline CONSTANT: F_SETFD 2
: F_SETFL 4 ; inline CONSTANT: F_SETFL 4
: FD_CLOEXEC 1 ; inline CONSTANT: FD_CLOEXEC 1
C-STRUCT: sockaddr-in C-STRUCT: sockaddr-in
{ "uchar" "len" } { "uchar" "len" }
@ -59,29 +60,29 @@ C-STRUCT: passwd
{ "time_t" "pw_expire" } { "time_t" "pw_expire" }
{ "int" "pw_fields" } ; { "int" "pw_fields" } ;
: max-un-path 104 ; inline CONSTANT: max-un-path 104
: SOCK_STREAM 1 ; inline CONSTANT: SOCK_STREAM 1
: SOCK_DGRAM 2 ; inline CONSTANT: SOCK_DGRAM 2
: AF_UNSPEC 0 ; inline CONSTANT: AF_UNSPEC 0
: AF_UNIX 1 ; inline CONSTANT: AF_UNIX 1
: AF_INET 2 ; inline CONSTANT: AF_INET 2
: AF_INET6 30 ; inline CONSTANT: AF_INET6 30
ALIAS: PF_UNSPEC AF_UNSPEC ALIAS: PF_UNSPEC AF_UNSPEC
ALIAS: PF_UNIX AF_UNIX ALIAS: PF_UNIX AF_UNIX
ALIAS: PF_INET AF_INET ALIAS: PF_INET AF_INET
ALIAS: PF_INET6 AF_INET6 ALIAS: PF_INET6 AF_INET6
: IPPROTO_TCP 6 ; inline CONSTANT: IPPROTO_TCP 6
: IPPROTO_UDP 17 ; inline CONSTANT: IPPROTO_UDP 17
: AI_PASSIVE 1 ; inline CONSTANT: AI_PASSIVE 1
: SEEK_SET 0 ; inline CONSTANT: SEEK_SET 0
: SEEK_CUR 1 ; inline CONSTANT: SEEK_CUR 1
: SEEK_END 2 ; inline CONSTANT: SEEK_END 2
os { os {
{ macosx [ "unix.bsd.macosx" require ] } { macosx [ "unix.bsd.macosx" require ] }

View File

@ -1,4 +1,4 @@
USING: alien.syntax ; USING: alien.syntax alias constants ;
IN: unix IN: unix
: FD_SETSIZE 1024 ; : FD_SETSIZE 1024 ;
@ -20,97 +20,97 @@ C-STRUCT: dirent
{ "u_int8_t" "d_namlen" } { "u_int8_t" "d_namlen" }
{ { "char" 256 } "d_name" } ; { { "char" 256 } "d_name" } ;
: EPERM 1 ; inline CONSTANT: EPERM 1
: ENOENT 2 ; inline CONSTANT: ENOENT 2
: ESRCH 3 ; inline CONSTANT: ESRCH 3
: EINTR 4 ; inline CONSTANT: EINTR 4
: EIO 5 ; inline CONSTANT: EIO 5
: ENXIO 6 ; inline CONSTANT: ENXIO 6
: E2BIG 7 ; inline CONSTANT: E2BIG 7
: ENOEXEC 8 ; inline CONSTANT: ENOEXEC 8
: EBADF 9 ; inline CONSTANT: EBADF 9
: ECHILD 10 ; inline CONSTANT: ECHILD 10
: EDEADLK 11 ; inline CONSTANT: EDEADLK 11
: ENOMEM 12 ; inline CONSTANT: ENOMEM 12
: EACCES 13 ; inline CONSTANT: EACCES 13
: EFAULT 14 ; inline CONSTANT: EFAULT 14
: ENOTBLK 15 ; inline CONSTANT: ENOTBLK 15
: EBUSY 16 ; inline CONSTANT: EBUSY 16
: EEXIST 17 ; inline CONSTANT: EEXIST 17
: EXDEV 18 ; inline CONSTANT: EXDEV 18
: ENODEV 19 ; inline CONSTANT: ENODEV 19
: ENOTDIR 20 ; inline CONSTANT: ENOTDIR 20
: EISDIR 21 ; inline CONSTANT: EISDIR 21
: EINVAL 22 ; inline CONSTANT: EINVAL 22
: ENFILE 23 ; inline CONSTANT: ENFILE 23
: EMFILE 24 ; inline CONSTANT: EMFILE 24
: ENOTTY 25 ; inline CONSTANT: ENOTTY 25
: ETXTBSY 26 ; inline CONSTANT: ETXTBSY 26
: EFBIG 27 ; inline CONSTANT: EFBIG 27
: ENOSPC 28 ; inline CONSTANT: ENOSPC 28
: ESPIPE 29 ; inline CONSTANT: ESPIPE 29
: EROFS 30 ; inline CONSTANT: EROFS 30
: EMLINK 31 ; inline CONSTANT: EMLINK 31
: EPIPE 32 ; inline CONSTANT: EPIPE 32
: EDOM 33 ; inline CONSTANT: EDOM 33
: ERANGE 34 ; inline CONSTANT: ERANGE 34
: EAGAIN 35 ; inline CONSTANT: EAGAIN 35
: EWOULDBLOCK EAGAIN ; inline ALIAS: EWOULDBLOCK EAGAIN
: EINPROGRESS 36 ; inline CONSTANT: EINPROGRESS 36
: EALREADY 37 ; inline CONSTANT: EALREADY 37
: ENOTSOCK 38 ; inline CONSTANT: ENOTSOCK 38
: EDESTADDRREQ 39 ; inline CONSTANT: EDESTADDRREQ 39
: EMSGSIZE 40 ; inline CONSTANT: EMSGSIZE 40
: EPROTOTYPE 41 ; inline CONSTANT: EPROTOTYPE 41
: ENOPROTOOPT 42 ; inline CONSTANT: ENOPROTOOPT 42
: EPROTONOSUPPORT 43 ; inline CONSTANT: EPROTONOSUPPORT 43
: ESOCKTNOSUPPORT 44 ; inline CONSTANT: ESOCKTNOSUPPORT 44
: EOPNOTSUPP 45 ; inline CONSTANT: EOPNOTSUPP 45
: ENOTSUP EOPNOTSUPP ; inline ALIAS: ENOTSUP EOPNOTSUPP
: EPFNOSUPPORT 46 ; inline CONSTANT: EPFNOSUPPORT 46
: EAFNOSUPPORT 47 ; inline CONSTANT: EAFNOSUPPORT 47
: EADDRINUSE 48 ; inline CONSTANT: EADDRINUSE 48
: EADDRNOTAVAIL 49 ; inline CONSTANT: EADDRNOTAVAIL 49
: ENETDOWN 50 ; inline CONSTANT: ENETDOWN 50
: ENETUNREACH 51 ; inline CONSTANT: ENETUNREACH 51
: ENETRESET 52 ; inline CONSTANT: ENETRESET 52
: ECONNABORTED 53 ; inline CONSTANT: ECONNABORTED 53
: ECONNRESET 54 ; inline CONSTANT: ECONNRESET 54
: ENOBUFS 55 ; inline CONSTANT: ENOBUFS 55
: EISCONN 56 ; inline CONSTANT: EISCONN 56
: ENOTCONN 57 ; inline CONSTANT: ENOTCONN 57
: ESHUTDOWN 58 ; inline CONSTANT: ESHUTDOWN 58
: ETOOMANYREFS 59 ; inline CONSTANT: ETOOMANYREFS 59
: ETIMEDOUT 60 ; inline CONSTANT: ETIMEDOUT 60
: ECONNREFUSED 61 ; inline CONSTANT: ECONNREFUSED 61
: ELOOP 62 ; inline CONSTANT: ELOOP 62
: ENAMETOOLONG 63 ; inline CONSTANT: ENAMETOOLONG 63
: EHOSTDOWN 64 ; inline CONSTANT: EHOSTDOWN 64
: EHOSTUNREACH 65 ; inline CONSTANT: EHOSTUNREACH 65
: ENOTEMPTY 66 ; inline CONSTANT: ENOTEMPTY 66
: EPROCLIM 67 ; inline CONSTANT: EPROCLIM 67
: EUSERS 68 ; inline CONSTANT: EUSERS 68
: EDQUOT 69 ; inline CONSTANT: EDQUOT 69
: ESTALE 70 ; inline CONSTANT: ESTALE 70
: EREMOTE 71 ; inline CONSTANT: EREMOTE 71
: EBADRPC 72 ; inline CONSTANT: EBADRPC 72
: ERPCMISMATCH 73 ; inline CONSTANT: ERPCMISMATCH 73
: EPROGUNAVAIL 74 ; inline CONSTANT: EPROGUNAVAIL 74
: EPROGMISMATCH 75 ; inline CONSTANT: EPROGMISMATCH 75
: EPROCUNAVAIL 76 ; inline CONSTANT: EPROCUNAVAIL 76
: ENOLCK 77 ; inline CONSTANT: ENOLCK 77
: ENOSYS 78 ; inline CONSTANT: ENOSYS 78
: EFTYPE 79 ; inline CONSTANT: EFTYPE 79
: EAUTH 80 ; inline CONSTANT: EAUTH 80
: ENEEDAUTH 81 ; inline CONSTANT: ENEEDAUTH 81
: EIDRM 82 ; inline CONSTANT: EIDRM 82
: ENOMSG 83 ; inline CONSTANT: ENOMSG 83
: EOVERFLOW 84 ; inline CONSTANT: EOVERFLOW 84
: ECANCELED 85 ; inline CONSTANT: ECANCELED 85
: EILSEQ 86 ; inline CONSTANT: EILSEQ 86
: ENOATTR 87 ; inline CONSTANT: ENOATTR 87
: EDOOFUS 88 ; inline CONSTANT: EDOOFUS 88
: EBADMSG 89 ; inline CONSTANT: EBADMSG 89
: EMULTIHOP 90 ; inline CONSTANT: EMULTIHOP 90
: ENOLINK 91 ; inline CONSTANT: ENOLINK 91
: EPROTO 92 ; inline CONSTANT: EPROTO 92

View File

@ -1,7 +1,7 @@
USING: alien.syntax unix.time alias ; USING: alien.syntax unix.time alias constants ;
IN: unix IN: unix
: FD_SETSIZE 1024 ; inline CONSTANT: FD_SETSIZE 1024
C-STRUCT: addrinfo C-STRUCT: addrinfo
{ "int" "flags" } { "int" "flags" }
@ -13,10 +13,10 @@ C-STRUCT: addrinfo
{ "void*" "addr" } { "void*" "addr" }
{ "addrinfo*" "next" } ; { "addrinfo*" "next" } ;
: _UTX_USERSIZE 256 ; inline CONSTANT: _UTX_USERSIZE 256
: _UTX_LINESIZE 32 ; inline CONSTANT: _UTX_LINESIZE 32
: _UTX_IDSIZE 4 ; inline CONSTANT: _UTX_IDSIZE 4
: _UTX_HOSTSIZE 256 ; inline CONSTANT: _UTX_HOSTSIZE 256
C-STRUCT: utmpx C-STRUCT: utmpx
{ { "char" _UTX_USERSIZE } "ut_user" } { { "char" _UTX_USERSIZE } "ut_user" }
@ -28,9 +28,9 @@ C-STRUCT: utmpx
{ { "char" _UTX_HOSTSIZE } "ut_host" } { { "char" _UTX_HOSTSIZE } "ut_host" }
{ { "uint" 16 } "ut_pad" } ; { { "uint" 16 } "ut_pad" } ;
: __DARWIN_MAXPATHLEN 1024 ; inline CONSTANT: __DARWIN_MAXPATHLEN 1024
: __DARWIN_MAXNAMELEN 255 ; inline CONSTANT: __DARWIN_MAXNAMELEN 255
: __DARWIN_MAXNAMELEN+1 255 ; inline CONSTANT: __DARWIN_MAXNAMELEN+1 255
C-STRUCT: dirent C-STRUCT: dirent
{ "ino_t" "d_ino" } { "ino_t" "d_ino" }
@ -39,107 +39,107 @@ C-STRUCT: dirent
{ "__uint8_t" "d_namlen" } { "__uint8_t" "d_namlen" }
{ { "char" __DARWIN_MAXNAMELEN+1 } "d_name" } ; { { "char" __DARWIN_MAXNAMELEN+1 } "d_name" } ;
: EPERM 1 ; inline CONSTANT: EPERM 1
: ENOENT 2 ; inline CONSTANT: ENOENT 2
: ESRCH 3 ; inline CONSTANT: ESRCH 3
: EINTR 4 ; inline CONSTANT: EINTR 4
: EIO 5 ; inline CONSTANT: EIO 5
: ENXIO 6 ; inline CONSTANT: ENXIO 6
: E2BIG 7 ; inline CONSTANT: E2BIG 7
: ENOEXEC 8 ; inline CONSTANT: ENOEXEC 8
: EBADF 9 ; inline CONSTANT: EBADF 9
: ECHILD 10 ; inline CONSTANT: ECHILD 10
: EDEADLK 11 ; inline CONSTANT: EDEADLK 11
: ENOMEM 12 ; inline CONSTANT: ENOMEM 12
: EACCES 13 ; inline CONSTANT: EACCES 13
: EFAULT 14 ; inline CONSTANT: EFAULT 14
: ENOTBLK 15 ; inline CONSTANT: ENOTBLK 15
: EBUSY 16 ; inline CONSTANT: EBUSY 16
: EEXIST 17 ; inline CONSTANT: EEXIST 17
: EXDEV 18 ; inline CONSTANT: EXDEV 18
: ENODEV 19 ; inline CONSTANT: ENODEV 19
: ENOTDIR 20 ; inline CONSTANT: ENOTDIR 20
: EISDIR 21 ; inline CONSTANT: EISDIR 21
: EINVAL 22 ; inline CONSTANT: EINVAL 22
: ENFILE 23 ; inline CONSTANT: ENFILE 23
: EMFILE 24 ; inline CONSTANT: EMFILE 24
: ENOTTY 25 ; inline CONSTANT: ENOTTY 25
: ETXTBSY 26 ; inline CONSTANT: ETXTBSY 26
: EFBIG 27 ; inline CONSTANT: EFBIG 27
: ENOSPC 28 ; inline CONSTANT: ENOSPC 28
: ESPIPE 29 ; inline CONSTANT: ESPIPE 29
: EROFS 30 ; inline CONSTANT: EROFS 30
: EMLINK 31 ; inline CONSTANT: EMLINK 31
: EPIPE 32 ; inline CONSTANT: EPIPE 32
: EDOM 33 ; inline CONSTANT: EDOM 33
: ERANGE 34 ; inline CONSTANT: ERANGE 34
: EAGAIN 35 ; inline CONSTANT: EAGAIN 35
ALIAS: EWOULDBLOCK EAGAIN ALIAS: EWOULDBLOCK EAGAIN
: EINPROGRESS 36 ; inline CONSTANT: EINPROGRESS 36
: EALREADY 37 ; inline CONSTANT: EALREADY 37
: ENOTSOCK 38 ; inline CONSTANT: ENOTSOCK 38
: EDESTADDRREQ 39 ; inline CONSTANT: EDESTADDRREQ 39
: EMSGSIZE 40 ; inline CONSTANT: EMSGSIZE 40
: EPROTOTYPE 41 ; inline CONSTANT: EPROTOTYPE 41
: ENOPROTOOPT 42 ; inline CONSTANT: ENOPROTOOPT 42
: EPROTONOSUPPORT 43 ; inline CONSTANT: EPROTONOSUPPORT 43
: ESOCKTNOSUPPORT 44 ; inline CONSTANT: ESOCKTNOSUPPORT 44
: ENOTSUP 45 ; inline CONSTANT: ENOTSUP 45
: EPFNOSUPPORT 46 ; inline CONSTANT: EPFNOSUPPORT 46
: EAFNOSUPPORT 47 ; inline CONSTANT: EAFNOSUPPORT 47
: EADDRINUSE 48 ; inline CONSTANT: EADDRINUSE 48
: EADDRNOTAVAIL 49 ; inline CONSTANT: EADDRNOTAVAIL 49
: ENETDOWN 50 ; inline CONSTANT: ENETDOWN 50
: ENETUNREACH 51 ; inline CONSTANT: ENETUNREACH 51
: ENETRESET 52 ; inline CONSTANT: ENETRESET 52
: ECONNABORTED 53 ; inline CONSTANT: ECONNABORTED 53
: ECONNRESET 54 ; inline CONSTANT: ECONNRESET 54
: ENOBUFS 55 ; inline CONSTANT: ENOBUFS 55
: EISCONN 56 ; inline CONSTANT: EISCONN 56
: ENOTCONN 57 ; inline CONSTANT: ENOTCONN 57
: ESHUTDOWN 58 ; inline CONSTANT: ESHUTDOWN 58
: ETOOMANYREFS 59 ; inline CONSTANT: ETOOMANYREFS 59
: ETIMEDOUT 60 ; inline CONSTANT: ETIMEDOUT 60
: ECONNREFUSED 61 ; inline CONSTANT: ECONNREFUSED 61
: ELOOP 62 ; inline CONSTANT: ELOOP 62
: ENAMETOOLONG 63 ; inline CONSTANT: ENAMETOOLONG 63
: EHOSTDOWN 64 ; inline CONSTANT: EHOSTDOWN 64
: EHOSTUNREACH 65 ; inline CONSTANT: EHOSTUNREACH 65
: ENOTEMPTY 66 ; inline CONSTANT: ENOTEMPTY 66
: EPROCLIM 67 ; inline CONSTANT: EPROCLIM 67
: EUSERS 68 ; inline CONSTANT: EUSERS 68
: EDQUOT 69 ; inline CONSTANT: EDQUOT 69
: ESTALE 70 ; inline CONSTANT: ESTALE 70
: EREMOTE 71 ; inline CONSTANT: EREMOTE 71
: EBADRPC 72 ; inline CONSTANT: EBADRPC 72
: ERPCMISMATCH 73 ; inline CONSTANT: ERPCMISMATCH 73
: EPROGUNAVAIL 74 ; inline CONSTANT: EPROGUNAVAIL 74
: EPROGMISMATCH 75 ; inline CONSTANT: EPROGMISMATCH 75
: EPROCUNAVAIL 76 ; inline CONSTANT: EPROCUNAVAIL 76
: ENOLCK 77 ; inline CONSTANT: ENOLCK 77
: ENOSYS 78 ; inline CONSTANT: ENOSYS 78
: EFTYPE 79 ; inline CONSTANT: EFTYPE 79
: EAUTH 80 ; inline CONSTANT: EAUTH 80
: ENEEDAUTH 81 ; inline CONSTANT: ENEEDAUTH 81
: EPWROFF 82 ; inline CONSTANT: EPWROFF 82
: EDEVERR 83 ; inline CONSTANT: EDEVERR 83
: EOVERFLOW 84 ; inline CONSTANT: EOVERFLOW 84
: EBADEXEC 85 ; inline CONSTANT: EBADEXEC 85
: EBADARCH 86 ; inline CONSTANT: EBADARCH 86
: ESHLIBVERS 87 ; inline CONSTANT: ESHLIBVERS 87
: EBADMACHO 88 ; inline CONSTANT: EBADMACHO 88
: ECANCELED 89 ; inline CONSTANT: ECANCELED 89
: EIDRM 90 ; inline CONSTANT: EIDRM 90
: ENOMSG 91 ; inline CONSTANT: ENOMSG 91
: EILSEQ 92 ; inline CONSTANT: EILSEQ 92
: ENOATTR 93 ; inline CONSTANT: ENOATTR 93
: EBADMSG 94 ; inline CONSTANT: EBADMSG 94
: EMULTIHOP 95 ; inline CONSTANT: EMULTIHOP 95
: ENODATA 96 ; inline CONSTANT: ENODATA 96
: ENOLINK 97 ; inline CONSTANT: ENOLINK 97
: ENOSR 98 ; inline CONSTANT: ENOSR 98
: ENOSTR 99 ; inline CONSTANT: ENOSTR 99
: EPROTO 100 ; inline CONSTANT: EPROTO 100
: ETIME 101 ; inline CONSTANT: ETIME 101
: EOPNOTSUPP 102 ; inline CONSTANT: EOPNOTSUPP 102
: ENOPOLICY 103 ; inline CONSTANT: ENOPOLICY 103

View File

@ -1,7 +1,7 @@
USING: alien.syntax alien.c-types math vocabs.loader ; USING: alien.syntax alien.c-types math vocabs.loader constants ;
IN: unix IN: unix
: FD_SETSIZE 256 ; inline CONSTANT: FD_SETSIZE 256
C-STRUCT: addrinfo C-STRUCT: addrinfo
{ "int" "flags" } { "int" "flags" }
@ -20,111 +20,111 @@ C-STRUCT: dirent
{ "__uint8_t" "d_namlen" } { "__uint8_t" "d_namlen" }
{ { "char" 256 } "d_name" } ; { { "char" 256 } "d_name" } ;
: EPERM 1 ; inline CONSTANT: EPERM 1
: ENOENT 2 ; inline CONSTANT: ENOENT 2
: ESRCH 3 ; inline CONSTANT: ESRCH 3
: EINTR 4 ; inline CONSTANT: EINTR 4
: EIO 5 ; inline CONSTANT: EIO 5
: ENXIO 6 ; inline CONSTANT: ENXIO 6
: E2BIG 7 ; inline CONSTANT: E2BIG 7
: ENOEXEC 8 ; inline CONSTANT: ENOEXEC 8
: EBADF 9 ; inline CONSTANT: EBADF 9
: ECHILD 10 ; inline CONSTANT: ECHILD 10
: EDEADLK 11 ; inline CONSTANT: EDEADLK 11
: ENOMEM 12 ; inline CONSTANT: ENOMEM 12
: EACCES 13 ; inline CONSTANT: EACCES 13
: EFAULT 14 ; inline CONSTANT: EFAULT 14
: ENOTBLK 15 ; inline CONSTANT: ENOTBLK 15
: EBUSY 16 ; inline CONSTANT: EBUSY 16
: EEXIST 17 ; inline CONSTANT: EEXIST 17
: EXDEV 18 ; inline CONSTANT: EXDEV 18
: ENODEV 19 ; inline CONSTANT: ENODEV 19
: ENOTDIR 20 ; inline CONSTANT: ENOTDIR 20
: EISDIR 21 ; inline CONSTANT: EISDIR 21
: EINVAL 22 ; inline CONSTANT: EINVAL 22
: ENFILE 23 ; inline CONSTANT: ENFILE 23
: EMFILE 24 ; inline CONSTANT: EMFILE 24
: ENOTTY 25 ; inline CONSTANT: ENOTTY 25
: ETXTBSY 26 ; inline CONSTANT: ETXTBSY 26
: EFBIG 27 ; inline CONSTANT: EFBIG 27
: ENOSPC 28 ; inline CONSTANT: ENOSPC 28
: ESPIPE 29 ; inline CONSTANT: ESPIPE 29
: EROFS 30 ; inline CONSTANT: EROFS 30
: EMLINK 31 ; inline CONSTANT: EMLINK 31
: EPIPE 32 ; inline CONSTANT: EPIPE 32
: EDOM 33 ; inline CONSTANT: EDOM 33
: ERANGE 34 ; inline CONSTANT: ERANGE 34
: EAGAIN 35 ; inline CONSTANT: EAGAIN 35
: EWOULDBLOCK EAGAIN ; inline ALIAS: EWOULDBLOCK EAGAIN
: EINPROGRESS 36 ; inline CONSTANT: EINPROGRESS 36
: EALREADY 37 ; inline CONSTANT: EALREADY 37
: ENOTSOCK 38 ; inline CONSTANT: ENOTSOCK 38
: EDESTADDRREQ 39 ; inline CONSTANT: EDESTADDRREQ 39
: EMSGSIZE 40 ; inline CONSTANT: EMSGSIZE 40
: EPROTOTYPE 41 ; inline CONSTANT: EPROTOTYPE 41
: ENOPROTOOPT 42 ; inline CONSTANT: ENOPROTOOPT 42
: EPROTONOSUPPORT 43 ; inline CONSTANT: EPROTONOSUPPORT 43
: ESOCKTNOSUPPORT 44 ; inline CONSTANT: ESOCKTNOSUPPORT 44
: EOPNOTSUPP 45 ; inline CONSTANT: EOPNOTSUPP 45
: EPFNOSUPPORT 46 ; inline CONSTANT: EPFNOSUPPORT 46
: EAFNOSUPPORT 47 ; inline CONSTANT: EAFNOSUPPORT 47
: EADDRINUSE 48 ; inline CONSTANT: EADDRINUSE 48
: EADDRNOTAVAIL 49 ; inline CONSTANT: EADDRNOTAVAIL 49
: ENETDOWN 50 ; inline CONSTANT: ENETDOWN 50
: ENETUNREACH 51 ; inline CONSTANT: ENETUNREACH 51
: ENETRESET 52 ; inline CONSTANT: ENETRESET 52
: ECONNABORTED 53 ; inline CONSTANT: ECONNABORTED 53
: ECONNRESET 54 ; inline CONSTANT: ECONNRESET 54
: ENOBUFS 55 ; inline CONSTANT: ENOBUFS 55
: EISCONN 56 ; inline CONSTANT: EISCONN 56
: ENOTCONN 57 ; inline CONSTANT: ENOTCONN 57
: ESHUTDOWN 58 ; inline CONSTANT: ESHUTDOWN 58
: ETOOMANYREFS 59 ; inline CONSTANT: ETOOMANYREFS 59
: ETIMEDOUT 60 ; inline CONSTANT: ETIMEDOUT 60
: ECONNREFUSED 61 ; inline CONSTANT: ECONNREFUSED 61
: ELOOP 62 ; inline CONSTANT: ELOOP 62
: ENAMETOOLONG 63 ; inline CONSTANT: ENAMETOOLONG 63
: EHOSTDOWN 64 ; inline CONSTANT: EHOSTDOWN 64
: EHOSTUNREACH 65 ; inline CONSTANT: EHOSTUNREACH 65
: ENOTEMPTY 66 ; inline CONSTANT: ENOTEMPTY 66
: EPROCLIM 67 ; inline CONSTANT: EPROCLIM 67
: EUSERS 68 ; inline CONSTANT: EUSERS 68
: EDQUOT 69 ; inline CONSTANT: EDQUOT 69
: ESTALE 70 ; inline CONSTANT: ESTALE 70
: EREMOTE 71 ; inline CONSTANT: EREMOTE 71
: EBADRPC 72 ; inline CONSTANT: EBADRPC 72
: ERPCMISMATCH 73 ; inline CONSTANT: ERPCMISMATCH 73
: EPROGUNAVAIL 74 ; inline CONSTANT: EPROGUNAVAIL 74
: EPROGMISMATCH 75 ; inline CONSTANT: EPROGMISMATCH 75
: EPROCUNAVAIL 76 ; inline CONSTANT: EPROCUNAVAIL 76
: ENOLCK 77 ; inline CONSTANT: ENOLCK 77
: ENOSYS 78 ; inline CONSTANT: ENOSYS 78
: EFTYPE 79 ; inline CONSTANT: EFTYPE 79
: EAUTH 80 ; inline CONSTANT: EAUTH 80
: ENEEDAUTH 81 ; inline CONSTANT: ENEEDAUTH 81
: EIDRM 82 ; inline CONSTANT: EIDRM 82
: ENOMSG 83 ; inline CONSTANT: ENOMSG 83
: EOVERFLOW 84 ; inline CONSTANT: EOVERFLOW 84
: EILSEQ 85 ; inline CONSTANT: EILSEQ 85
: ENOTSUP 86 ; inline CONSTANT: ENOTSUP 86
: ECANCELED 87 ; inline CONSTANT: ECANCELED 87
: EBADMSG 88 ; inline CONSTANT: EBADMSG 88
: ENODATA 89 ; inline CONSTANT: ENODATA 89
: ENOSR 90 ; inline CONSTANT: ENOSR 90
: ENOSTR 91 ; inline CONSTANT: ENOSTR 91
: ETIME 92 ; inline CONSTANT: ETIME 92
: ENOATTR 93 ; inline CONSTANT: ENOATTR 93
: EMULTIHOP 94 ; inline CONSTANT: EMULTIHOP 94
: ENOLINK 95 ; inline CONSTANT: ENOLINK 95
: EPROTO 96 ; inline CONSTANT: EPROTO 96
: ELAST 96 ; inline CONSTANT: ELAST 96
TYPEDEF: __uint8_t sa_family_t TYPEDEF: __uint8_t sa_family_t
: _UTX_USERSIZE 32 ; inline CONSTANT: _UTX_USERSIZE 32
: _UTX_LINESIZE 32 ; inline CONSTANT: _UTX_LINESIZE 32
: _UTX_IDSIZE 4 ; inline CONSTANT: _UTX_IDSIZE 4
: _UTX_HOSTSIZE 256 ; inline CONSTANT: _UTX_HOSTSIZE 256
: _SS_MAXSIZE ( -- n ) : _SS_MAXSIZE ( -- n )
128 ; inline 128 ; inline

View File

@ -1,7 +1,7 @@
USING: alien.syntax ; USING: alien.syntax constants ;
IN: unix IN: unix
: FD_SETSIZE 1024 ; inline CONSTANT: FD_SETSIZE 1024
C-STRUCT: addrinfo C-STRUCT: addrinfo
{ "int" "flags" } { "int" "flags" }
@ -20,92 +20,92 @@ C-STRUCT: dirent
{ "__uint8_t" "d_namlen" } { "__uint8_t" "d_namlen" }
{ { "char" 256 } "d_name" } ; { { "char" 256 } "d_name" } ;
: EPERM 1 ; inline CONSTANT: EPERM 1
: ENOENT 2 ; inline CONSTANT: ENOENT 2
: ESRCH 3 ; inline CONSTANT: ESRCH 3
: EINTR 4 ; inline CONSTANT: EINTR 4
: EIO 5 ; inline CONSTANT: EIO 5
: ENXIO 6 ; inline CONSTANT: ENXIO 6
: E2BIG 7 ; inline CONSTANT: E2BIG 7
: ENOEXEC 8 ; inline CONSTANT: ENOEXEC 8
: EBADF 9 ; inline CONSTANT: EBADF 9
: ECHILD 10 ; inline CONSTANT: ECHILD 10
: EDEADLK 11 ; inline CONSTANT: EDEADLK 11
: ENOMEM 12 ; inline CONSTANT: ENOMEM 12
: EACCES 13 ; inline CONSTANT: EACCES 13
: EFAULT 14 ; inline CONSTANT: EFAULT 14
: ENOTBLK 15 ; inline CONSTANT: ENOTBLK 15
: EBUSY 16 ; inline CONSTANT: EBUSY 16
: EEXIST 17 ; inline CONSTANT: EEXIST 17
: EXDEV 18 ; inline CONSTANT: EXDEV 18
: ENODEV 19 ; inline CONSTANT: ENODEV 19
: ENOTDIR 20 ; inline CONSTANT: ENOTDIR 20
: EISDIR 21 ; inline CONSTANT: EISDIR 21
: EINVAL 22 ; inline CONSTANT: EINVAL 22
: ENFILE 23 ; inline CONSTANT: ENFILE 23
: EMFILE 24 ; inline CONSTANT: EMFILE 24
: ENOTTY 25 ; inline CONSTANT: ENOTTY 25
: ETXTBSY 26 ; inline CONSTANT: ETXTBSY 26
: EFBIG 27 ; inline CONSTANT: EFBIG 27
: ENOSPC 28 ; inline CONSTANT: ENOSPC 28
: ESPIPE 29 ; inline CONSTANT: ESPIPE 29
: EROFS 30 ; inline CONSTANT: EROFS 30
: EMLINK 31 ; inline CONSTANT: EMLINK 31
: EPIPE 32 ; inline CONSTANT: EPIPE 32
: EDOM 33 ; inline CONSTANT: EDOM 33
: ERANGE 34 ; inline CONSTANT: ERANGE 34
: EAGAIN 35 ; inline CONSTANT: EAGAIN 35
: EWOULDBLOCK EAGAIN ; inline ALIAS: EWOULDBLOCK EAGAIN
: EINPROGRESS 36 ; inline CONSTANT: EINPROGRESS 36
: EALREADY 37 ; inline CONSTANT: EALREADY 37
: ENOTSOCK 38 ; inline CONSTANT: ENOTSOCK 38
: EDESTADDRREQ 39 ; inline CONSTANT: EDESTADDRREQ 39
: EMSGSIZE 40 ; inline CONSTANT: EMSGSIZE 40
: EPROTOTYPE 41 ; inline CONSTANT: EPROTOTYPE 41
: ENOPROTOOPT 42 ; inline CONSTANT: ENOPROTOOPT 42
: EPROTONOSUPPORT 43 ; inline CONSTANT: EPROTONOSUPPORT 43
: ESOCKTNOSUPPORT 44 ; inline CONSTANT: ESOCKTNOSUPPORT 44
: EOPNOTSUPP 45 ; inline CONSTANT: EOPNOTSUPP 45
: EPFNOSUPPORT 46 ; inline CONSTANT: EPFNOSUPPORT 46
: EAFNOSUPPORT 47 ; inline CONSTANT: EAFNOSUPPORT 47
: EADDRINUSE 48 ; inline CONSTANT: EADDRINUSE 48
: EADDRNOTAVAIL 49 ; inline CONSTANT: EADDRNOTAVAIL 49
: ENETDOWN 50 ; inline CONSTANT: ENETDOWN 50
: ENETUNREACH 51 ; inline CONSTANT: ENETUNREACH 51
: ENETRESET 52 ; inline CONSTANT: ENETRESET 52
: ECONNABORTED 53 ; inline CONSTANT: ECONNABORTED 53
: ECONNRESET 54 ; inline CONSTANT: ECONNRESET 54
: ENOBUFS 55 ; inline CONSTANT: ENOBUFS 55
: EISCONN 56 ; inline CONSTANT: EISCONN 56
: ENOTCONN 57 ; inline CONSTANT: ENOTCONN 57
: ESHUTDOWN 58 ; inline CONSTANT: ESHUTDOWN 58
: ETOOMANYREFS 59 ; inline CONSTANT: ETOOMANYREFS 59
: ETIMEDOUT 60 ; inline CONSTANT: ETIMEDOUT 60
: ECONNREFUSED 61 ; inline CONSTANT: ECONNREFUSED 61
: ELOOP 62 ; inline CONSTANT: ELOOP 62
: ENAMETOOLONG 63 ; inline CONSTANT: ENAMETOOLONG 63
: EHOSTDOWN 64 ; inline CONSTANT: EHOSTDOWN 64
: EHOSTUNREACH 65 ; inline CONSTANT: EHOSTUNREACH 65
: ENOTEMPTY 66 ; inline CONSTANT: ENOTEMPTY 66
: EPROCLIM 67 ; inline CONSTANT: EPROCLIM 67
: EUSERS 68 ; inline CONSTANT: EUSERS 68
: EDQUOT 69 ; inline CONSTANT: EDQUOT 69
: ESTALE 70 ; inline CONSTANT: ESTALE 70
: EREMOTE 71 ; inline CONSTANT: EREMOTE 71
: EBADRPC 72 ; inline CONSTANT: EBADRPC 72
: ERPCMISMATCH 73 ; inline CONSTANT: ERPCMISMATCH 73
: EPROGUNAVAIL 74 ; inline CONSTANT: EPROGUNAVAIL 74
: EPROGMISMATCH 75 ; inline CONSTANT: EPROGMISMATCH 75
: EPROCUNAVAIL 76 ; inline CONSTANT: EPROCUNAVAIL 76
: ENOLCK 77 ; inline CONSTANT: ENOLCK 77
: ENOSYS 78 ; inline CONSTANT: ENOSYS 78
: EFTYPE 79 ; inline CONSTANT: EFTYPE 79
: EAUTH 80 ; inline CONSTANT: EAUTH 80
: ENEEDAUTH 81 ; inline CONSTANT: ENEEDAUTH 81
: EIPSEC 82 ; inline CONSTANT: EIPSEC 82
: ENOATTR 83 ; inline CONSTANT: ENOATTR 83
: EILSEQ 84 ; inline CONSTANT: EILSEQ 84
: ENOMEDIUM 85 ; inline CONSTANT: ENOMEDIUM 85
: EMEDIUMTYPE 86 ; inline CONSTANT: EMEDIUMTYPE 86
: EOVERFLOW 87 ; inline CONSTANT: EOVERFLOW 87
: ECANCELED 88 ; inline CONSTANT: ECANCELED 88

View File

@ -1,11 +1,11 @@
! Copyright (C) 2008 Doug Coleman. ! Copyright (C) 2008 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: alien.syntax ; USING: alien.syntax constants ;
IN: unix.getfsstat.freebsd IN: unix.getfsstat.freebsd
: MNT_WAIT 1 ; inline ! synchronously wait for I/O to complete CONSTANT: MNT_WAIT 1 ! synchronously wait for I/O to complete
: MNT_NOWAIT 2 ; inline ! start all I/O, but do not wait for it CONSTANT: MNT_NOWAIT 2 ! start all I/O, but do not wait for it
: MNT_LAZY 3 ; inline ! push data not written by filesystem syncer CONSTANT: MNT_LAZY 3 ! push data not written by filesystem syncer
: MNT_SUSPEND 4 ; inline ! Suspend file system after sync CONSTANT: MNT_SUSPEND 4 ! Suspend file system after sync
FUNCTION: int getfsstat ( statfs* buf, int bufsize, int flags ) ; FUNCTION: int getfsstat ( statfs* buf, int bufsize, int flags ) ;

View File

@ -1,9 +1,9 @@
! Copyright (C) 2008 Doug Coleman. ! Copyright (C) 2008 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: alien.syntax ; USING: alien.syntax constants ;
IN: unix.getfsstat.macosx IN: unix.getfsstat.macosx
: MNT_WAIT 1 ; inline ! synchronously wait for I/O to complete CONSTANT: MNT_WAIT 1 ! synchronously wait for I/O to complete
: MNT_NOWAIT 2 ; inline ! start all I/O, but do not wait for it 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 ( statfs* buf, int bufsize, int flags ) ;

View File

@ -1,10 +1,10 @@
! Copyright (C) 2008 Doug Coleman. ! Copyright (C) 2008 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: alien.syntax ; USING: alien.syntax constants ;
IN: unix.getfsstat.netbsd IN: unix.getfsstat.netbsd
: MNT_WAIT 1 ; inline ! synchronously wait for I/O to complete CONSTANT: MNT_WAIT 1 ! synchronously wait for I/O to complete
: MNT_NOWAIT 2 ; inline ! start all I/O, but do not wait for it CONSTANT: MNT_NOWAIT 2 ! start all I/O, but do not wait for it
: MNT_LAZY 3 ; inline ! push data not written by filesystem syncer CONSTANT: MNT_LAZY 3 ! push data not written by filesystem syncer
FUNCTION: int getvfsstat ( statfs* buf, int bufsize, int flags ) ; FUNCTION: int getvfsstat ( statfs* buf, int bufsize, int flags ) ;

View File

@ -1,10 +1,10 @@
! Copyright (C) 2008 Doug Coleman. ! Copyright (C) 2008 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: alien.syntax ; USING: alien.syntax constants ;
IN: unix.getfsstat.openbsd IN: unix.getfsstat.openbsd
: MNT_WAIT 1 ; ! synchronously wait for I/O to complete CONSTANT: MNT_WAIT 1 ! synchronously wait for I/O to complete
: MNT_NOWAIT 2 ; ! start all I/O, but do not wait for it CONSTANT: MNT_NOWAIT 2 ! start all I/O, but do not wait for it
: MNT_LAZY 3 ; ! push data not written by filesystem syncer CONSTANT: MNT_LAZY 3 ! push data not written by filesystem syncer
FUNCTION: int getfsstat ( statfs* buf, int bufsize, int flags ) ; FUNCTION: int getfsstat ( statfs* buf, int bufsize, int flags ) ;

View File

@ -1,4 +1,4 @@
USE: alien.syntax USING: alien.syntax constants ;
IN: unix.kqueue IN: unix.kqueue
C-STRUCT: kevent C-STRUCT: kevent
@ -12,12 +12,12 @@ C-STRUCT: kevent
FUNCTION: int kevent ( int kq, kevent* changelist, int nchanges, kevent* eventlist, int nevents, timespec* timeout ) ; FUNCTION: int kevent ( int kq, kevent* changelist, int nchanges, kevent* eventlist, int nevents, timespec* timeout ) ;
: EVFILT_READ -1 ; inline CONSTANT: EVFILT_READ -1
: EVFILT_WRITE -2 ; inline CONSTANT: EVFILT_WRITE -2
: EVFILT_AIO -3 ; inline ! attached to aio requests CONSTANT: EVFILT_AIO -3 ! attached to aio requests
: EVFILT_VNODE -4 ; inline ! attached to vnodes CONSTANT: EVFILT_VNODE -4 ! attached to vnodes
: EVFILT_PROC -5 ; inline ! attached to struct proc CONSTANT: EVFILT_PROC -5 ! attached to struct proc
: EVFILT_SIGNAL -6 ; inline ! attached to struct proc CONSTANT: EVFILT_SIGNAL -6 ! attached to struct proc
: EVFILT_TIMER -7 ; inline ! timers CONSTANT: EVFILT_TIMER -7 ! timers
: EVFILT_NETDEV -8 ; inline ! Mach ports CONSTANT: EVFILT_NETDEV -8 ! Mach ports
: EVFILT_FS -9 ; inline ! Filesystem events CONSTANT: EVFILT_FS -9 ! Filesystem events

View File

@ -1,4 +1,4 @@
USE: alien.syntax USING: alien.syntax constants ;
IN: unix.kqueue IN: unix.kqueue
C-STRUCT: kevent C-STRUCT: kevent
@ -12,12 +12,12 @@ C-STRUCT: kevent
FUNCTION: int kevent ( int kq, kevent* changelist, int nchanges, kevent* eventlist, int nevents, timespec* timeout ) ; FUNCTION: int kevent ( int kq, kevent* changelist, int nchanges, kevent* eventlist, int nevents, timespec* timeout ) ;
: EVFILT_READ -1 ; inline CONSTANT: EVFILT_READ -1
: EVFILT_WRITE -2 ; inline CONSTANT: EVFILT_WRITE -2
: EVFILT_AIO -3 ; inline ! attached to aio requests CONSTANT: EVFILT_AIO -3 ! attached to aio requests
: EVFILT_VNODE -4 ; inline ! attached to vnodes CONSTANT: EVFILT_VNODE -4 ! attached to vnodes
: EVFILT_PROC -5 ; inline ! attached to struct proc CONSTANT: EVFILT_PROC -5 ! attached to struct proc
: EVFILT_SIGNAL -6 ; inline ! attached to struct proc CONSTANT: EVFILT_SIGNAL -6 ! attached to struct proc
: EVFILT_TIMER -7 ; inline ! timers CONSTANT: EVFILT_TIMER -7 ! timers
: EVFILT_MACHPORT -8 ; inline ! Mach ports CONSTANT: EVFILT_MACHPORT -8 ! Mach ports
: EVFILT_FS -9 ; inline ! Filesystem events CONSTANT: EVFILT_FS -9 ! Filesystem events

View File

@ -1,4 +1,4 @@
USE: alien.syntax USING: alien.syntax constants ;
IN: unix.kqueue IN: unix.kqueue
C-STRUCT: kevent C-STRUCT: kevent
@ -12,11 +12,11 @@ C-STRUCT: kevent
FUNCTION: int kevent ( int kq, kevent* changelist, size_t nchanges, kevent* eventlist, size_t nevents, timespec* timeout ) ; FUNCTION: int kevent ( int kq, kevent* changelist, size_t nchanges, kevent* eventlist, size_t nevents, timespec* timeout ) ;
: EVFILT_READ 0 ; inline CONSTANT: EVFILT_READ 0
: EVFILT_WRITE 1 ; inline CONSTANT: EVFILT_WRITE 1
: EVFILT_AIO 2 ; inline ! attached to aio requests CONSTANT: EVFILT_AIO 2 ! attached to aio requests
: EVFILT_VNODE 3 ; inline ! attached to vnodes CONSTANT: EVFILT_VNODE 3 ! attached to vnodes
: EVFILT_PROC 4 ; inline ! attached to struct proc CONSTANT: EVFILT_PROC 4 ! attached to struct proc
: EVFILT_SIGNAL 5 ; inline ! attached to struct proc CONSTANT: EVFILT_SIGNAL 5 ! attached to struct proc
: EVFILT_TIMER 6 ; inline ! timers CONSTANT: EVFILT_TIMER 6 ! timers
: EVFILT_SYSCOUNT 7 ; inline ! Filesystem events CONSTANT: EVFILT_SYSCOUNT 7 ! Filesystem events

View File

@ -1,4 +1,4 @@
USE: alien.syntax USING: alien.syntax constants ;
IN: unix.kqueue IN: unix.kqueue
C-STRUCT: kevent C-STRUCT: kevent
@ -12,10 +12,10 @@ C-STRUCT: kevent
FUNCTION: int kevent ( int kq, kevent* changelist, int nchanges, kevent* eventlist, int nevents, timespec* timeout ) ; FUNCTION: int kevent ( int kq, kevent* changelist, int nchanges, kevent* eventlist, int nevents, timespec* timeout ) ;
: EVFILT_READ -1 ; inline CONSTANT: EVFILT_READ -1
: EVFILT_WRITE -2 ; inline CONSTANT: EVFILT_WRITE -2
: EVFILT_AIO -3 ; inline ! attached to aio requests CONSTANT: EVFILT_AIO -3 ! attached to aio requests
: EVFILT_VNODE -4 ; inline ! attached to vnodes CONSTANT: EVFILT_VNODE -4 ! attached to vnodes
: EVFILT_PROC -5 ; inline ! attached to struct proc CONSTANT: EVFILT_PROC -5 ! attached to struct proc
: EVFILT_SIGNAL -6 ; inline ! attached to struct proc CONSTANT: EVFILT_SIGNAL -6 ! attached to struct proc
: EVFILT_TIMER -7 ; inline ! timers CONSTANT: EVFILT_TIMER -7 ! timers

View File

@ -14,19 +14,19 @@ C-STRUCT: epoll-event
FUNCTION: int epoll_wait ( int epfd, epoll_event* events, int maxevents, int timeout ) ; FUNCTION: int epoll_wait ( int epfd, epoll_event* events, int maxevents, int timeout ) ;
: EPOLL_CTL_ADD 1 ; inline ! Add a file decriptor to the interface. CONSTANT: EPOLL_CTL_ADD 1 ! Add a file decriptor to the interface.
: EPOLL_CTL_DEL 2 ; inline ! Remove a file decriptor from the interface. CONSTANT: EPOLL_CTL_DEL 2 ! Remove a file decriptor from the interface.
: EPOLL_CTL_MOD 3 ; inline ! Change file decriptor epoll_event structure. CONSTANT: EPOLL_CTL_MOD 3 ! Change file decriptor epoll_event structure.
: EPOLLIN HEX: 001 ; inline CONSTANT: EPOLLIN HEX: 001
: EPOLLPRI HEX: 002 ; inline CONSTANT: EPOLLPRI HEX: 002
: EPOLLOUT HEX: 004 ; inline CONSTANT: EPOLLOUT HEX: 004
: EPOLLRDNORM HEX: 040 ; inline CONSTANT: EPOLLRDNORM HEX: 040
: EPOLLRDBAND HEX: 080 ; inline CONSTANT: EPOLLRDBAND HEX: 080
: EPOLLWRNORM HEX: 100 ; inline CONSTANT: EPOLLWRNORM HEX: 100
: EPOLLWRBAND HEX: 200 ; inline CONSTANT: EPOLLWRBAND HEX: 200
: EPOLLMSG HEX: 400 ; inline CONSTANT: EPOLLMSG HEX: 400
: EPOLLERR HEX: 008 ; inline CONSTANT: EPOLLERR HEX: 008
: EPOLLHUP HEX: 010 ; inline CONSTANT: EPOLLHUP HEX: 010
: EPOLLONESHOT 30 2^ ; inline CONSTANT: EPOLLONESHOT 30 2^
: EPOLLET 31 2^ ; inline CONSTANT: EPOLLET 31 2^

View File

@ -11,31 +11,31 @@ C-STRUCT: inotify-event
{ "char[0]" "name" } ! stub for possible name { "char[0]" "name" } ! stub for possible name
; ;
: IN_ACCESS HEX: 1 ; inline ! File was accessed CONSTANT: IN_ACCESS HEX: 1 ! File was accessed
: IN_MODIFY HEX: 2 ; inline ! File was modified CONSTANT: IN_MODIFY HEX: 2 ! File was modified
: IN_ATTRIB HEX: 4 ; inline ! Metadata changed CONSTANT: IN_ATTRIB HEX: 4 ! Metadata changed
: IN_CLOSE_WRITE HEX: 8 ; inline ! Writtable file was closed CONSTANT: IN_CLOSE_WRITE HEX: 8 ! Writtable file was closed
: IN_CLOSE_NOWRITE HEX: 10 ; inline ! Unwrittable file closed CONSTANT: IN_CLOSE_NOWRITE HEX: 10 ! Unwrittable file closed
: IN_OPEN HEX: 20 ; inline ! File was opened CONSTANT: IN_OPEN HEX: 20 ! File was opened
: IN_MOVED_FROM HEX: 40 ; inline ! File was moved from X CONSTANT: IN_MOVED_FROM HEX: 40 ! File was moved from X
: IN_MOVED_TO HEX: 80 ; inline ! File was moved to Y CONSTANT: IN_MOVED_TO HEX: 80 ! File was moved to Y
: IN_CREATE HEX: 100 ; inline ! Subfile was created CONSTANT: IN_CREATE HEX: 100 ! Subfile was created
: IN_DELETE HEX: 200 ; inline ! Subfile was deleted CONSTANT: IN_DELETE HEX: 200 ! Subfile was deleted
: IN_DELETE_SELF HEX: 400 ; inline ! Self was deleted CONSTANT: IN_DELETE_SELF HEX: 400 ! Self was deleted
: IN_MOVE_SELF HEX: 800 ; inline ! Self was moved CONSTANT: IN_MOVE_SELF HEX: 800 ! Self was moved
: IN_UNMOUNT HEX: 2000 ; inline ! Backing fs was unmounted CONSTANT: IN_UNMOUNT HEX: 2000 ! Backing fs was unmounted
: IN_Q_OVERFLOW HEX: 4000 ; inline ! Event queued overflowed CONSTANT: IN_Q_OVERFLOW HEX: 4000 ! Event queued overflowed
: IN_IGNORED HEX: 8000 ; inline ! File was ignored CONSTANT: IN_IGNORED HEX: 8000 ! File was ignored
: IN_CLOSE ( -- n ) IN_CLOSE_WRITE IN_CLOSE_NOWRITE bitor ; inline ! close : IN_CLOSE ( -- n ) IN_CLOSE_WRITE IN_CLOSE_NOWRITE bitor ; inline ! close
: IN_MOVE ( -- n ) IN_MOVED_FROM IN_MOVED_TO bitor ; inline ! moves : IN_MOVE ( -- n ) IN_MOVED_FROM IN_MOVED_TO bitor ; inline ! moves
: IN_ONLYDIR HEX: 1000000 ; inline ! only watch the path if it is a directory CONSTANT: IN_ONLYDIR HEX: 1000000 ! only watch the path if it is a directory
: IN_DONT_FOLLOW HEX: 2000000 ; inline ! don't follow a sym link CONSTANT: IN_DONT_FOLLOW HEX: 2000000 ! don't follow a sym link
: IN_MASK_ADD HEX: 20000000 ; inline ! add to the mask of an already existing watch CONSTANT: IN_MASK_ADD HEX: 20000000 ! add to the mask of an already existing watch
: IN_ISDIR HEX: 40000000 ; inline ! event occurred against dir CONSTANT: IN_ISDIR HEX: 40000000 ! event occurred against dir
: IN_ONESHOT HEX: 80000000 ; inline ! only send event once CONSTANT: IN_ONESHOT HEX: 80000000 ! only send event once
: IN_CHANGE_EVENTS ( -- n ) : IN_CHANGE_EVENTS ( -- n )
{ {

View File

@ -1,36 +1,37 @@
! Copyright (C) 2005, 2008 Slava Pestov. ! Copyright (C) 2005, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: alien.syntax ; USING: alien.syntax alias constants ;
IN: unix IN: unix
! Linux. ! Linux.
: MAXPATHLEN 1024 ; inline CONSTANT: MAXPATHLEN 1024
: O_RDONLY HEX: 0000 ; inline CONSTANT: O_RDONLY HEX: 0000
: O_WRONLY HEX: 0001 ; inline CONSTANT: O_WRONLY HEX: 0001
: O_RDWR HEX: 0002 ; inline CONSTANT: O_RDWR HEX: 0002
: O_CREAT HEX: 0040 ; inline CONSTANT: O_CREAT HEX: 0040
: O_EXCL HEX: 0080 ; inline CONSTANT: O_EXCL HEX: 0080
: O_NOCTTY HEX: 0100 ; inline CONSTANT: O_NOCTTY HEX: 0100
: O_TRUNC HEX: 0200 ; inline CONSTANT: O_TRUNC HEX: 0200
: O_APPEND HEX: 0400 ; inline CONSTANT: O_APPEND HEX: 0400
: O_NONBLOCK HEX: 0800 ; inline CONSTANT: O_NONBLOCK HEX: 0800
: O_NDELAY O_NONBLOCK ; inline
: SOL_SOCKET 1 ; inline ALIAS: O_NDELAY O_NONBLOCK
: FD_SETSIZE 1024 ; inline CONSTANT: SOL_SOCKET 1
: SO_REUSEADDR 2 ; inline CONSTANT: FD_SETSIZE 1024
: SO_OOBINLINE 10 ; inline
: SO_SNDTIMEO HEX: 15 ; inline
: SO_RCVTIMEO HEX: 14 ; inline
: F_SETFD 2 ; inline CONSTANT: SO_REUSEADDR 2
: FD_CLOEXEC 1 ; inline CONSTANT: SO_OOBINLINE 10
CONSTANT: SO_SNDTIMEO HEX: 15
CONSTANT: SO_RCVTIMEO HEX: 14
: F_SETFL 4 ; inline CONSTANT: F_SETFD 2
CONSTANT: FD_CLOEXEC 1
CONSTANT: F_SETFL 4
C-STRUCT: addrinfo C-STRUCT: addrinfo
{ "int" "flags" } { "int" "flags" }
@ -55,33 +56,33 @@ C-STRUCT: sockaddr-in6
{ { "uchar" 16 } "addr" } { { "uchar" 16 } "addr" }
{ "uint" "scopeid" } ; { "uint" "scopeid" } ;
: max-un-path 108 ; inline CONSTANT: max-un-path 108
C-STRUCT: sockaddr-un C-STRUCT: sockaddr-un
{ "ushort" "family" } { "ushort" "family" }
{ { "char" max-un-path } "path" } ; { { "char" max-un-path } "path" } ;
: SOCK_STREAM 1 ; inline CONSTANT: SOCK_STREAM 1
: SOCK_DGRAM 2 ; inline CONSTANT: SOCK_DGRAM 2
: AF_UNSPEC 0 ; inline CONSTANT: AF_UNSPEC 0
: AF_UNIX 1 ; inline CONSTANT: AF_UNIX 1
: AF_INET 2 ; inline CONSTANT: AF_INET 2
: AF_INET6 10 ; inline CONSTANT: AF_INET6 10
: PF_UNSPEC AF_UNSPEC ; inline ALIAS: PF_UNSPEC AF_UNSPEC
: PF_UNIX AF_UNIX ; inline ALIAS: PF_UNIX AF_UNIX
: PF_INET AF_INET ; inline ALIAS: PF_INET AF_INET
: PF_INET6 AF_INET6 ; inline ALIAS: PF_INET6 AF_INET6
: IPPROTO_TCP 6 ; inline CONSTANT: IPPROTO_TCP 6
: IPPROTO_UDP 17 ; inline CONSTANT: IPPROTO_UDP 17
: AI_PASSIVE 1 ; inline CONSTANT: AI_PASSIVE 1
: SEEK_SET 0 ; inline CONSTANT: SEEK_SET 0
: SEEK_CUR 1 ; inline CONSTANT: SEEK_CUR 1
: SEEK_END 2 ; inline CONSTANT: SEEK_END 2
C-STRUCT: passwd C-STRUCT: passwd
{ "char*" "pw_name" } { "char*" "pw_name" }
@ -99,134 +100,134 @@ C-STRUCT: dirent
{ "uchar" "d_type" } { "uchar" "d_type" }
{ { "char" 256 } "d_name" } ; { { "char" 256 } "d_name" } ;
: EPERM 1 ; inline CONSTANT: EPERM 1
: ENOENT 2 ; inline CONSTANT: ENOENT 2
: ESRCH 3 ; inline CONSTANT: ESRCH 3
: EINTR 4 ; inline CONSTANT: EINTR 4
: EIO 5 ; inline CONSTANT: EIO 5
: ENXIO 6 ; inline CONSTANT: ENXIO 6
: E2BIG 7 ; inline CONSTANT: E2BIG 7
: ENOEXEC 8 ; inline CONSTANT: ENOEXEC 8
: EBADF 9 ; inline CONSTANT: EBADF 9
: ECHILD 10 ; inline CONSTANT: ECHILD 10
: EAGAIN 11 ; inline CONSTANT: EAGAIN 11
: ENOMEM 12 ; inline CONSTANT: ENOMEM 12
: EACCES 13 ; inline CONSTANT: EACCES 13
: EFAULT 14 ; inline CONSTANT: EFAULT 14
: ENOTBLK 15 ; inline CONSTANT: ENOTBLK 15
: EBUSY 16 ; inline CONSTANT: EBUSY 16
: EEXIST 17 ; inline CONSTANT: EEXIST 17
: EXDEV 18 ; inline CONSTANT: EXDEV 18
: ENODEV 19 ; inline CONSTANT: ENODEV 19
: ENOTDIR 20 ; inline CONSTANT: ENOTDIR 20
: EISDIR 21 ; inline CONSTANT: EISDIR 21
: EINVAL 22 ; inline CONSTANT: EINVAL 22
: ENFILE 23 ; inline CONSTANT: ENFILE 23
: EMFILE 24 ; inline CONSTANT: EMFILE 24
: ENOTTY 25 ; inline CONSTANT: ENOTTY 25
: ETXTBSY 26 ; inline CONSTANT: ETXTBSY 26
: EFBIG 27 ; inline CONSTANT: EFBIG 27
: ENOSPC 28 ; inline CONSTANT: ENOSPC 28
: ESPIPE 29 ; inline CONSTANT: ESPIPE 29
: EROFS 30 ; inline CONSTANT: EROFS 30
: EMLINK 31 ; inline CONSTANT: EMLINK 31
: EPIPE 32 ; inline CONSTANT: EPIPE 32
: EDOM 33 ; inline CONSTANT: EDOM 33
: ERANGE 34 ; inline CONSTANT: ERANGE 34
: EDEADLK 35 ; inline CONSTANT: EDEADLK 35
: ENAMETOOLONG 36 ; inline CONSTANT: ENAMETOOLONG 36
: ENOLCK 37 ; inline CONSTANT: ENOLCK 37
: ENOSYS 38 ; inline CONSTANT: ENOSYS 38
: ENOTEMPTY 39 ; inline CONSTANT: ENOTEMPTY 39
: ELOOP 40 ; inline CONSTANT: ELOOP 40
: EWOULDBLOCK EAGAIN ; inline ALIAS: EWOULDBLOCK EAGAIN
: ENOMSG 42 ; inline CONSTANT: ENOMSG 42
: EIDRM 43 ; inline CONSTANT: EIDRM 43
: ECHRNG 44 ; inline CONSTANT: ECHRNG 44
: EL2NSYNC 45 ; inline CONSTANT: EL2NSYNC 45
: EL3HLT 46 ; inline CONSTANT: EL3HLT 46
: EL3RST 47 ; inline CONSTANT: EL3RST 47
: ELNRNG 48 ; inline CONSTANT: ELNRNG 48
: EUNATCH 49 ; inline CONSTANT: EUNATCH 49
: ENOCSI 50 ; inline CONSTANT: ENOCSI 50
: EL2HLT 51 ; inline CONSTANT: EL2HLT 51
: EBADE 52 ; inline CONSTANT: EBADE 52
: EBADR 53 ; inline CONSTANT: EBADR 53
: EXFULL 54 ; inline CONSTANT: EXFULL 54
: ENOANO 55 ; inline CONSTANT: ENOANO 55
: EBADRQC 56 ; inline CONSTANT: EBADRQC 56
: EBADSLT 57 ; inline CONSTANT: EBADSLT 57
: EDEADLOCK EDEADLK ; inline ALIAS: EDEADLOCK EDEADLK
: EBFONT 59 ; inline CONSTANT: EBFONT 59
: ENOSTR 60 ; inline CONSTANT: ENOSTR 60
: ENODATA 61 ; inline CONSTANT: ENODATA 61
: ETIME 62 ; inline CONSTANT: ETIME 62
: ENOSR 63 ; inline CONSTANT: ENOSR 63
: ENONET 64 ; inline CONSTANT: ENONET 64
: ENOPKG 65 ; inline CONSTANT: ENOPKG 65
: EREMOTE 66 ; inline CONSTANT: EREMOTE 66
: ENOLINK 67 ; inline CONSTANT: ENOLINK 67
: EADV 68 ; inline CONSTANT: EADV 68
: ESRMNT 69 ; inline CONSTANT: ESRMNT 69
: ECOMM 70 ; inline CONSTANT: ECOMM 70
: EPROTO 71 ; inline CONSTANT: EPROTO 71
: EMULTIHOP 72 ; inline CONSTANT: EMULTIHOP 72
: EDOTDOT 73 ; inline CONSTANT: EDOTDOT 73
: EBADMSG 74 ; inline CONSTANT: EBADMSG 74
: EOVERFLOW 75 ; inline CONSTANT: EOVERFLOW 75
: ENOTUNIQ 76 ; inline CONSTANT: ENOTUNIQ 76
: EBADFD 77 ; inline CONSTANT: EBADFD 77
: EREMCHG 78 ; inline CONSTANT: EREMCHG 78
: ELIBACC 79 ; inline CONSTANT: ELIBACC 79
: ELIBBAD 80 ; inline CONSTANT: ELIBBAD 80
: ELIBSCN 81 ; inline CONSTANT: ELIBSCN 81
: ELIBMAX 82 ; inline CONSTANT: ELIBMAX 82
: ELIBEXEC 83 ; inline CONSTANT: ELIBEXEC 83
: EILSEQ 84 ; inline CONSTANT: EILSEQ 84
: ERESTART 85 ; inline CONSTANT: ERESTART 85
: ESTRPIPE 86 ; inline CONSTANT: ESTRPIPE 86
: EUSERS 87 ; inline CONSTANT: EUSERS 87
: ENOTSOCK 88 ; inline CONSTANT: ENOTSOCK 88
: EDESTADDRREQ 89 ; inline CONSTANT: EDESTADDRREQ 89
: EMSGSIZE 90 ; inline CONSTANT: EMSGSIZE 90
: EPROTOTYPE 91 ; inline CONSTANT: EPROTOTYPE 91
: ENOPROTOOPT 92 ; inline CONSTANT: ENOPROTOOPT 92
: EPROTONOSUPPORT 93 ; inline CONSTANT: EPROTONOSUPPORT 93
: ESOCKTNOSUPPORT 94 ; inline CONSTANT: ESOCKTNOSUPPORT 94
: EOPNOTSUPP 95 ; inline CONSTANT: EOPNOTSUPP 95
: EPFNOSUPPORT 96 ; inline CONSTANT: EPFNOSUPPORT 96
: EAFNOSUPPORT 97 ; inline CONSTANT: EAFNOSUPPORT 97
: EADDRINUSE 98 ; inline CONSTANT: EADDRINUSE 98
: EADDRNOTAVAIL 99 ; inline CONSTANT: EADDRNOTAVAIL 99
: ENETDOWN 100 ; inline CONSTANT: ENETDOWN 100
: ENETUNREACH 101 ; inline CONSTANT: ENETUNREACH 101
: ENETRESET 102 ; inline CONSTANT: ENETRESET 102
: ECONNABORTED 103 ; inline CONSTANT: ECONNABORTED 103
: ECONNRESET 104 ; inline CONSTANT: ECONNRESET 104
: ENOBUFS 105 ; inline CONSTANT: ENOBUFS 105
: EISCONN 106 ; inline CONSTANT: EISCONN 106
: ENOTCONN 107 ; inline CONSTANT: ENOTCONN 107
: ESHUTDOWN 108 ; inline CONSTANT: ESHUTDOWN 108
: ETOOMANYREFS 109 ; inline CONSTANT: ETOOMANYREFS 109
: ETIMEDOUT 110 ; inline CONSTANT: ETIMEDOUT 110
: ECONNREFUSED 111 ; inline CONSTANT: ECONNREFUSED 111
: EHOSTDOWN 112 ; inline CONSTANT: EHOSTDOWN 112
: EHOSTUNREACH 113 ; inline CONSTANT: EHOSTUNREACH 113
: EALREADY 114 ; inline CONSTANT: EALREADY 114
: EINPROGRESS 115 ; inline CONSTANT: EINPROGRESS 115
: ESTALE 116 ; inline CONSTANT: ESTALE 116
: EUCLEAN 117 ; inline CONSTANT: EUCLEAN 117
: ENOTNAM 118 ; inline CONSTANT: ENOTNAM 118
: ENAVAIL 119 ; inline CONSTANT: ENAVAIL 119
: EISNAM 120 ; inline CONSTANT: EISNAM 120
: EREMOTEIO 121 ; inline CONSTANT: EREMOTEIO 121
: EDQUOT 122 ; inline CONSTANT: EDQUOT 122
: ENOMEDIUM 123 ; inline CONSTANT: ENOMEDIUM 123
: EMEDIUMTYPE 124 ; inline CONSTANT: EMEDIUMTYPE 124
: ECANCELED 125 ; inline CONSTANT: ECANCELED 125
: ENOKEY 126 ; inline CONSTANT: ENOKEY 126
: EKEYEXPIRED 127 ; inline CONSTANT: EKEYEXPIRED 127
: EKEYREVOKED 128 ; inline CONSTANT: EKEYREVOKED 128
: EKEYREJECTED 129 ; inline CONSTANT: EKEYREJECTED 129
: EOWNERDEAD 130 ; inline CONSTANT: EOWNERDEAD 130
: ENOTRECOVERABLE 131 ; inline CONSTANT: ENOTRECOVERABLE 131

View File

@ -1,6 +1,6 @@
USING: kernel alien.c-types alien.strings sequences math alien.syntax unix USING: kernel alien.c-types alien.strings sequences math alien.syntax unix
vectors kernel namespaces continuations threads assocs vectors vectors kernel namespaces continuations threads assocs vectors
io.backend.unix io.encodings.utf8 unix.utilities ; io.backend.unix io.encodings.utf8 unix.utilities constants ;
IN: unix.process IN: unix.process
! Low-level Unix process launching utilities. These are used ! Low-level Unix process launching utilities. These are used
@ -39,34 +39,34 @@ FUNCTION: int execve ( char* path, char** argv, char** envp ) ;
[ [ fork-process dup zero? ] dip [ drop ] prepose ] dip [ [ fork-process dup zero? ] dip [ drop ] prepose ] dip
if ; inline if ; inline
: SIGKILL 9 ; inline CONSTANT: SIGKILL 9
: SIGTERM 15 ; inline CONSTANT: SIGTERM 15
FUNCTION: int kill ( pid_t pid, int sig ) ; FUNCTION: int kill ( pid_t pid, int sig ) ;
: PRIO_PROCESS 0 ; inline CONSTANT: PRIO_PROCESS 0
: PRIO_PGRP 1 ; inline CONSTANT: PRIO_PGRP 1
: PRIO_USER 2 ; inline CONSTANT: PRIO_USER 2
: PRIO_MIN -20 ; inline CONSTANT: PRIO_MIN -20
: PRIO_MAX 20 ; inline CONSTANT: PRIO_MAX 20
! which/who = 0 for current process ! which/who = 0 for current process
FUNCTION: int getpriority ( int which, int who ) ; FUNCTION: int getpriority ( int which, int who ) ;
FUNCTION: int setpriority ( int which, int who, int prio ) ; FUNCTION: int setpriority ( int which, int who, int prio ) ;
: set-priority ( n -- ) : set-priority ( n -- )
0 0 rot setpriority io-error ; [ 0 0 ] dip setpriority io-error ;
! Flags for waitpid ! Flags for waitpid
: WNOHANG 1 ; inline CONSTANT: WNOHANG 1
: WUNTRACED 2 ; inline CONSTANT: WUNTRACED 2
: WSTOPPED 2 ; inline CONSTANT: WSTOPPED 2
: WEXITED 4 ; inline CONSTANT: WEXITED 4
: WCONTINUED 8 ; inline CONSTANT: WCONTINUED 8
: WNOWAIT HEX: 1000000 ; inline CONSTANT: WNOWAIT HEX: 1000000
! Examining status ! Examining status

View File

@ -5,23 +5,23 @@ USING: alien.syntax system kernel ;
! Solaris. ! Solaris.
: O_RDONLY HEX: 0000 ; inline CONSTANT: O_RDONLY HEX: 0000
: O_WRONLY HEX: 0001 ; inline CONSTANT: O_WRONLY HEX: 0001
: O_RDWR HEX: 0002 ; inline CONSTANT: O_RDWR HEX: 0002
: O_APPEND HEX: 0008 ; inline CONSTANT: O_APPEND HEX: 0008
: O_CREAT HEX: 0100 ; inline CONSTANT: O_CREAT HEX: 0100
: O_TRUNC HEX: 0200 ; inline CONSTANT: O_TRUNC HEX: 0200
: SEEK_END 2 ; inline CONSTANT: SEEK_END 2
: SOL_SOCKET HEX: ffff ; inline CONSTANT: SOL_SOCKET HEX: ffff
: FD_SETSIZE cell 4 = 1024 65536 ? ; inline CONSTANT: FD_SETSIZE cell 4 = 1024 65536 ?
: SO_REUSEADDR 4 ; inline CONSTANT: SO_REUSEADDR 4
: SO_OOBINLINE HEX: 0100 ; inline CONSTANT: SO_OOBINLINE HEX: 0100
: SO_SNDTIMEO HEX: 1005 ; inline CONSTANT: SO_SNDTIMEO HEX: 1005
: SO_RCVTIMEO HEX: 1006 ; inline CONSTANT: SO_RCVTIMEO HEX: 1006
: F_SETFL 4 ; ! set file status flags : F_SETFL 4 ; ! set file status flags
: O_NONBLOCK HEX: 80 ; ! no delay : O_NONBLOCK HEX: 80 ; ! no delay
@ -58,24 +58,24 @@ C-STRUCT: sockaddr-un
{ "ushort" "family" } { "ushort" "family" }
{ { "char" max-un-path } "path" } ; { { "char" max-un-path } "path" } ;
: EINTR 4 ; inline CONSTANT: EINTR 4
: EAGAIN 11 ; inline CONSTANT: EAGAIN 11
: EINPROGRESS 150 ; inline CONSTANT: EINPROGRESS 150
: SOCK_STREAM 2 ; inline CONSTANT: SOCK_STREAM 2
: SOCK_DGRAM 1 ; inline CONSTANT: SOCK_DGRAM 1
: AF_UNSPEC 0 ; inline CONSTANT: AF_UNSPEC 0
: AF_UNIX 1 ; inline CONSTANT: AF_UNIX 1
: AF_INET 2 ; inline CONSTANT: AF_INET 2
: AF_INET6 26 ; inline CONSTANT: AF_INET6 26
: PF_UNSPEC AF_UNSPEC ; inline CONSTANT: PF_UNSPEC AF_UNSPEC
: PF_UNIX AF_UNIX ; inline CONSTANT: PF_UNIX AF_UNIX
: PF_INET AF_INET ; inline CONSTANT: PF_INET AF_INET
: PF_INET6 AF_INET6 ; inline CONSTANT: PF_INET6 AF_INET6
: IPPROTO_TCP 6 ; inline CONSTANT: IPPROTO_TCP 6
: IPPROTO_UDP 17 ; inline CONSTANT: IPPROTO_UDP 17
: AI_PASSIVE 8 ; inline CONSTANT: AI_PASSIVE 8

View File

@ -25,5 +25,5 @@ C-STRUCT: stat
FUNCTION: int __stat30 ( char* pathname, stat* buf ) ; FUNCTION: int __stat30 ( char* pathname, stat* buf ) ;
FUNCTION: int __lstat30 ( char* pathname, stat* buf ) ; FUNCTION: int __lstat30 ( char* pathname, stat* buf ) ;
: stat ( pathname buf -- n ) __stat30 ; inline CONSTANT: stat ( pathname buf -- n ) __stat30
: lstat ( pathname buf -- n ) __lstat30 ; inline CONSTANT: lstat ( pathname buf -- n ) __lstat30

View File

@ -25,5 +25,5 @@ C-STRUCT: stat
FUNCTION: int __stat13 ( char* pathname, stat* buf ) ; FUNCTION: int __stat13 ( char* pathname, stat* buf ) ;
FUNCTION: int __lstat13 ( char* pathname, stat* buf ) ; FUNCTION: int __lstat13 ( char* pathname, stat* buf ) ;
: stat ( pathname buf -- n ) __stat13 ; inline CONSTANT: stat ( pathname buf -- n ) __stat13
: lstat ( pathname buf -- n ) __lstat13 ; inline CONSTANT: lstat ( pathname buf -- n ) __lstat13

View File

@ -1,19 +1,19 @@
USING: kernel system combinators alien.syntax alien.c-types USING: kernel system combinators alien.syntax alien.c-types
math io.backend.unix vocabs.loader unix ; math io.backend.unix vocabs.loader unix constants ;
IN: unix.stat IN: unix.stat
! File Types ! File Types
: S_IFMT OCT: 170000 ; ! These bits determine file type. : S_IFMT OCT: 170000 ; ! These bits determine file type.
: S_IFDIR OCT: 40000 ; inline ! Directory. CONSTANT: S_IFDIR OCT: 40000 ! Directory.
: S_IFCHR OCT: 20000 ; inline ! Character device. CONSTANT: S_IFCHR OCT: 20000 ! Character device.
: S_IFBLK OCT: 60000 ; inline ! Block device. CONSTANT: S_IFBLK OCT: 60000 ! Block device.
: S_IFREG OCT: 100000 ; inline ! Regular file. CONSTANT: S_IFREG OCT: 100000 ! Regular file.
: S_IFIFO OCT: 010000 ; inline ! FIFO. CONSTANT: S_IFIFO OCT: 010000 ! FIFO.
: S_IFLNK OCT: 120000 ; inline ! Symbolic link. CONSTANT: S_IFLNK OCT: 120000 ! Symbolic link.
: S_IFSOCK OCT: 140000 ; inline ! Socket. CONSTANT: S_IFSOCK OCT: 140000 ! Socket.
: S_IFWHT OCT: 160000 ; inline ! Whiteout. CONSTANT: S_IFWHT OCT: 160000 ! Whiteout.
FUNCTION: int chmod ( char* path, mode_t mode ) ; FUNCTION: int chmod ( char* path, mode_t mode ) ;
FUNCTION: int fchmod ( int fd, mode_t mode ) ; FUNCTION: int fchmod ( int fd, mode_t mode ) ;

View File

@ -3,9 +3,9 @@
USING: alien.syntax ; USING: alien.syntax ;
IN: unix.statfs.freebsd IN: unix.statfs.freebsd
: MFSNAMELEN 16 ; inline ! length of type name including null */ CONSTANT: MFSNAMELEN 16 ! length of type name including null */
: MNAMELEN 88 ; inline ! size of on/from name bufs CONSTANT: MNAMELEN 88 ! size of on/from name bufs
: STATFS_VERSION HEX: 20030518 ; inline ! current version number CONSTANT: STATFS_VERSION HEX: 20030518 ! current version number
C-STRUCT: statfs C-STRUCT: statfs
{ "uint32_t" "f_version" } { "uint32_t" "f_version" }

View File

@ -3,8 +3,8 @@
USING: alien.syntax ; USING: alien.syntax ;
IN: unix.statfs.openbsd IN: unix.statfs.openbsd
: MFSNAMELEN 16 ; inline CONSTANT: MFSNAMELEN 16
: MNAMELEN 90 ; inline CONSTANT: MNAMELEN 90
C-STRUCT: statfs C-STRUCT: statfs
{ "u_int32_t" "f_flags" } { "u_int32_t" "f_flags" }

View File

@ -1,6 +1,6 @@
! Copyright (C) 2008 Doug Coleman. ! Copyright (C) 2008 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: alien.syntax ; USING: alien.syntax constants ;
IN: unix.statvfs.freebsd IN: unix.statvfs.freebsd
C-STRUCT: statvfs C-STRUCT: statvfs
@ -17,7 +17,7 @@ C-STRUCT: statvfs
{ "ulong" "f_namemax" } ; { "ulong" "f_namemax" } ;
! Flags ! Flags
: ST_RDONLY HEX: 1 ; inline ! Read-only file system CONSTANT: ST_RDONLY HEX: 1 ! Read-only file system
: ST_NOSUID HEX: 2 ; inline ! Does not honor setuid/setgid CONSTANT: ST_NOSUID HEX: 2 ! Does not honor setuid/setgid
FUNCTION: int statvfs ( char* path, statvfs* buf ) ; FUNCTION: int statvfs ( char* path, statvfs* buf ) ;

View File

@ -19,13 +19,13 @@ C-STRUCT: statvfs64
FUNCTION: int statvfs64 ( char* path, statvfs64* buf ) ; FUNCTION: int statvfs64 ( char* path, statvfs64* buf ) ;
: ST_RDONLY 1 ; inline ! Mount read-only. CONSTANT: ST_RDONLY 1 ! Mount read-only.
: ST_NOSUID 2 ; inline ! Ignore suid and sgid bits. CONSTANT: ST_NOSUID 2 ! Ignore suid and sgid bits.
: ST_NODEV 4 ; inline ! Disallow access to device special files. CONSTANT: ST_NODEV 4 ! Disallow access to device special files.
: ST_NOEXEC 8 ; inline ! Disallow program execution. CONSTANT: ST_NOEXEC 8 ! Disallow program execution.
: ST_SYNCHRONOUS 16 ; inline ! Writes are synced at once. CONSTANT: ST_SYNCHRONOUS 16 ! Writes are synced at once.
: ST_MANDLOCK 64 ; inline ! Allow mandatory locks on an FS. CONSTANT: ST_MANDLOCK 64 ! Allow mandatory locks on an FS.
: ST_WRITE 128 ; inline ! Write on file/directory/symlink. CONSTANT: ST_WRITE 128 ! Write on file/directory/symlink.
: ST_APPEND 256 ; inline ! Append-only file. CONSTANT: ST_APPEND 256 ! Append-only file.
: ST_IMMUTABLE 512 ; inline ! Immutable file. CONSTANT: ST_IMMUTABLE 512 ! Immutable file.
: ST_NOATIME 1024 ; inline ! Do not update access times. CONSTANT: ST_NOATIME 1024 ! Do not update access times.

View File

@ -1,6 +1,6 @@
! Copyright (C) 2008 Doug Coleman. ! Copyright (C) 2008 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: alien.syntax ; USING: alien.syntax constants ;
IN: unix.statvfs.macosx IN: unix.statvfs.macosx
C-STRUCT: statvfs C-STRUCT: statvfs
@ -17,7 +17,7 @@ C-STRUCT: statvfs
{ "ulong" "f_namemax" } ; { "ulong" "f_namemax" } ;
! Flags ! Flags
: ST_RDONLY HEX: 1 ; inline ! Read-only file system CONSTANT: ST_RDONLY HEX: 1 ! Read-only file system
: ST_NOSUID HEX: 2 ; inline ! Does not honor setuid/setgid CONSTANT: ST_NOSUID HEX: 2 ! Does not honor setuid/setgid
FUNCTION: int statvfs ( char* path, statvfs* buf ) ; FUNCTION: int statvfs ( char* path, statvfs* buf ) ;

View File

@ -1,10 +1,10 @@
! Copyright (C) 2008 Doug Coleman. ! Copyright (C) 2008 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: alien.syntax ; USING: alien.syntax constants ;
IN: unix.statvfs.netbsd IN: unix.statvfs.netbsd
: _VFS_NAMELEN 32 ; inline CONSTANT: _VFS_NAMELEN 32
: _VFS_MNAMELEN 1024 ; inline CONSTANT: _VFS_MNAMELEN 1024
C-STRUCT: statvfs C-STRUCT: statvfs
{ "ulong" "f_flag" } { "ulong" "f_flag" }

View File

@ -1,6 +1,6 @@
! Copyright (C) 2008 Doug Coleman. ! Copyright (C) 2008 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: alien.syntax ; USING: alien.syntax constants ;
IN: unix.statvfs.openbsd IN: unix.statvfs.openbsd
C-STRUCT: statvfs C-STRUCT: statvfs
@ -16,7 +16,7 @@ C-STRUCT: statvfs
{ "ulong" "f_flag" } { "ulong" "f_flag" }
{ "ulong" "f_namemax" } ; { "ulong" "f_namemax" } ;
: ST_RDONLY 1 ; inline CONSTANT: ST_RDONLY 1
: ST_NOSUID 2 ; inline CONSTANT: ST_NOSUID 2
FUNCTION: int statvfs ( char* path, statvfs* buf ) ; FUNCTION: int statvfs ( char* path, statvfs* buf ) ;

View File

@ -168,7 +168,7 @@ FUNCTION: int readdir_r ( void* dirp, dirent* entry, dirent** result ) ;
FUNCTION: ssize_t readlink ( char* path, char* buf, size_t bufsize ) ; FUNCTION: ssize_t readlink ( char* path, char* buf, size_t bufsize ) ;
: PATH_MAX 1024 ; inline CONSTANT: PATH_MAX 1024
: read-symbolic-link ( path -- path ) : read-symbolic-link ( path -- path )
PATH_MAX <byte-array> dup [ PATH_MAX <byte-array> dup [

View File

@ -6,18 +6,18 @@ unix calendar system accessors unix.time calendar.unix
vocabs.loader ; vocabs.loader ;
IN: unix.utmpx IN: unix.utmpx
: EMPTY 0 ; inline CONSTANT: EMPTY 0
: RUN_LVL 1 ; inline CONSTANT: RUN_LVL 1
: BOOT_TIME 2 ; inline CONSTANT: BOOT_TIME 2
: OLD_TIME 3 ; inline CONSTANT: OLD_TIME 3
: NEW_TIME 4 ; inline CONSTANT: NEW_TIME 4
: INIT_PROCESS 5 ; inline CONSTANT: INIT_PROCESS 5
: LOGIN_PROCESS 6 ; inline CONSTANT: LOGIN_PROCESS 6
: USER_PROCESS 7 ; inline CONSTANT: USER_PROCESS 7
: DEAD_PROCESS 8 ; inline CONSTANT: DEAD_PROCESS 8
: ACCOUNTING 9 ; inline CONSTANT: ACCOUNTING 9
: SIGNATURE 10 ; inline CONSTANT: SIGNATURE 10
: SHUTDOWN_TIME 11 ; inline CONSTANT: SHUTDOWN_TIME 11
FUNCTION: void setutxent ( ) ; FUNCTION: void setutxent ( ) ;
FUNCTION: void endutxent ( ) ; FUNCTION: void endutxent ( ) ;

View File

@ -131,7 +131,7 @@ M: ole32-error error.
: guid= ( a b -- ? ) : guid= ( a b -- ? )
[ 16 memory>byte-array ] bi@ = ; [ 16 memory>byte-array ] bi@ = ;
: GUID-STRING-LENGTH : GUID-STRING-LENGTH ( -- n )
"{01234567-89ab-cdef-0123-456789abcdef}" length ; inline "{01234567-89ab-cdef-0123-456789abcdef}" length ; inline
:: (guid-section>guid) ( string guid start end quot -- ) :: (guid-section>guid) ( string guid start end quot -- )

View File

@ -21,7 +21,7 @@ HELP: base64
{ $see-also <base64> } ; { $see-also <base64> } ;
HELP: <rpc-method> HELP: <rpc-method>
{ $values { "name" "a string" } { "params" "a sequence" } } { $values { "name" "a string" } { "params" "a sequence" } { "rpc-method" rpc-method } }
{ $description "creates a tuple reprsenting a method call which can be translated using send-rpc into an XML-RPC document" } { $description "creates a tuple reprsenting a method call which can be translated using send-rpc into an XML-RPC document" }
{ $see-also rpc-method <rpc-response> <rpc-fault> } ; { $see-also rpc-method <rpc-response> <rpc-fault> } ;
@ -30,7 +30,7 @@ HELP: rpc-method
{ $see-also <rpc-method> rpc-response rpc-fault } ; { $see-also <rpc-method> rpc-response rpc-fault } ;
HELP: <rpc-response> HELP: <rpc-response>
{ $values { "params" "a sequence" } } { $values { "params" "a sequence" } { "rpc-response" rpc-response } }
{ $description "creates a tuple representing a data response in XML-RPC" } { $description "creates a tuple representing a data response in XML-RPC" }
{ $see-also rpc-response <rpc-method> <rpc-fault> } ; { $see-also rpc-response <rpc-method> <rpc-fault> } ;
@ -39,7 +39,7 @@ HELP: rpc-response
{ $see-also <rpc-response> rpc-method rpc-fault } ; { $see-also <rpc-response> rpc-method rpc-fault } ;
HELP: <rpc-fault> HELP: <rpc-fault>
{ $values { "code" "an integer" } { "string" "a string" } } { $values { "code" "an integer" } { "string" "a string" } { "rpc-fault" rpc-fault } }
{ $description "creates a tuple representing an exception in RPC, to be returned to the caller. The code is a number representing what type of error it is, and the string is a description" } { $description "creates a tuple representing an exception in RPC, to be returned to the caller. The code is a number representing what type of error it is, and the string is a description" }
{ $see-also rpc-fault <rpc-method> <rpc-response> } ; { $see-also rpc-fault <rpc-method> <rpc-response> } ;

View File

@ -113,7 +113,7 @@ HELP: name
{ $see-also <name> tag } ; { $see-also <name> tag } ;
HELP: <name> HELP: <name>
{ $values { "space" "a string" } { "tag" "a string" } { "url" "a string" } { $values { "space" "a string" } { "main" "a string" } { "url" "a string" }
{ "name" "an XML tag name" } } { "name" "an XML tag name" } }
{ $description "creates a name tuple with the name-space space and the tag-name tag and the tag-url url." } { $description "creates a name tuple with the name-space space and the tag-name tag and the tag-url url." }
{ $see-also name <tag> } ; { $see-also name <tag> } ;
@ -135,7 +135,7 @@ HELP: xml
HELP: <xml> HELP: <xml>
{ $values { "prolog" "an XML prolog" } { "before" "a sequence of XML elements" } { $values { "prolog" "an XML prolog" } { "before" "a sequence of XML elements" }
{ "main" tag } { "after" "a sequence of XML elements" } { "xml" "an XML document" } } { "body" tag } { "after" "a sequence of XML elements" } { "xml" "an XML document" } }
{ $description "creates an XML document, delegating to the main tag, with the specified prolog, before, and after" } { $description "creates an XML document, delegating to the main tag, with the specified prolog, before, and after" }
{ $see-also xml <tag> } ; { $see-also xml <tag> } ;

View File

@ -221,10 +221,6 @@ HELP: assert-depth
{ $values { "quot" "a quotation" } } { $values { "quot" "a quotation" } }
{ $description "Runs a quotation. Throws an error if the quotation attempts to take input values from the stack, or leave outputs on the stack." } ; { $description "Runs a quotation. Throws an error if the quotation attempts to take input values from the stack, or leave outputs on the stack." } ;
HELP: <continuation>
{ $description "Constructs a new continuation." }
{ $notes "User code should call " { $link continuation } " instead." } ;
HELP: attempt-all HELP: attempt-all
{ $values { $values
{ "seq" sequence } { "quot" quotation } { "seq" sequence } { "quot" quotation }

View File

@ -21,12 +21,12 @@ ARTICLE: "io.streams.c" "ANSI C streams"
ABOUT: "io.streams.c" ABOUT: "io.streams.c"
HELP: <c-reader> HELP: <c-reader>
{ $values { "in" "a C FILE* handle" } { "stream" "a new stream" } } { $values { "handle" "a C FILE* handle" } { "stream" "a new stream" } }
{ $description "Creates a stream which reads data by calling C standard library functions." } { $description "Creates a stream which reads data by calling C standard library functions." }
{ $notes "Usually C streams are only used during bootstrap, and non-blocking OS-specific I/O routines are used during normal operation." } ; { $notes "Usually C streams are only used during bootstrap, and non-blocking OS-specific I/O routines are used during normal operation." } ;
HELP: <c-writer> HELP: <c-writer>
{ $values { "out" "a C FILE* handle" } { "stream" "a new stream" } } { $values { "handle" "a C FILE* handle" } { "stream" "a new stream" } }
{ $description "Creates a stream which writes data by calling C standard library functions." } { $description "Creates a stream which writes data by calling C standard library functions." }
{ $notes "Usually C streams are only used during bootstrap, and non-blocking OS-specific I/O routines are used during normal operation." } ; { $notes "Usually C streams are only used during bootstrap, and non-blocking OS-specific I/O routines are used during normal operation." } ;

View File

@ -191,6 +191,10 @@ HELP: exchange-unsafe
{ $values { "m" "a non-negative integer" } { "n" "a non-negative integer" } { "seq" "a mutable sequence" } } { $values { "m" "a non-negative integer" } { "n" "a non-negative integer" } { "seq" "a mutable sequence" } }
{ $description "Unsafe variant of " { $link exchange } " that does not perform bounds checks." } ; { $description "Unsafe variant of " { $link exchange } " that does not perform bounds checks." } ;
HELP: first-unsafe
{ $values { "seq" sequence } { "first" "the first element" } }
{ $contract "Unsafe variant of " { $link first } " that does not perform bounds checks." } ;
HELP: first2-unsafe HELP: first2-unsafe
{ $values { "seq" sequence } { "first" "the first element" } { "second" "the second element" } } { $values { "seq" sequence } { "first" "the first element" } { "second" "the second element" } }
{ $contract "Unsafe variant of " { $link first2 } " that does not perform bounds checks." } ; { $contract "Unsafe variant of " { $link first2 } " that does not perform bounds checks." } ;

View File

@ -101,16 +101,16 @@ M: integer nth-unsafe drop ;
INSTANCE: integer immutable-sequence INSTANCE: integer immutable-sequence
: first-unsafe ( seq -- elt ) : first-unsafe ( seq -- first )
0 swap nth-unsafe ; inline 0 swap nth-unsafe ; inline
: first2-unsafe ( seq -- elt1 elt2 ) : first2-unsafe ( seq -- first second )
[ first-unsafe ] [ 1 swap nth-unsafe ] bi ; inline [ first-unsafe ] [ 1 swap nth-unsafe ] bi ; inline
: first3-unsafe ( seq -- elt1 elt2 elt3 ) : first3-unsafe ( seq -- first second third )
[ first2-unsafe ] [ 2 swap nth-unsafe ] bi ; inline [ first2-unsafe ] [ 2 swap nth-unsafe ] bi ; inline
: first4-unsafe ( seq -- elt1 elt2 elt3 elt4 ) : first4-unsafe ( seq -- first second third fourth )
[ first3-unsafe ] [ 3 swap nth-unsafe ] bi ; inline [ first3-unsafe ] [ 3 swap nth-unsafe ] bi ; inline
: exchange-unsafe ( m n seq -- ) : exchange-unsafe ( m n seq -- )

View File

@ -344,6 +344,6 @@ HELP: make-inline
{ $side-effects "word" } ; { $side-effects "word" } ;
HELP: define-inline HELP: define-inline
{ $values { "word" word } { "quot" quotation } { "effect" effect } } { $values { "word" word } { "def" quotation } { "effect" effect } }
{ $description "Defines a word and makes it " { $link POSTPONE: inline } "." } { $description "Defines a word and makes it " { $link POSTPONE: inline } "." }
{ $side-effects "word" } ; { $side-effects "word" } ;

View File

@ -4,17 +4,15 @@ USING: help.markup help.syntax io.streams.string ;
IN: assoc-heaps IN: assoc-heaps
HELP: <assoc-heap> HELP: <assoc-heap>
{ $values { "assoc" assoc } { "heap" heap } }
{ $description "Constructs a new " { $link assoc-heap } " from two existing data structures." } ; { $description "Constructs a new " { $link assoc-heap } " from two existing data structures." } ;
HELP: <unique-max-heap> HELP: <unique-max-heap>
{ $values { $values { "unique-heap" assoc-heap } }
{ "unique-heap" assoc-heap } }
{ $description "Creates a new " { $link assoc-heap } " where the assoc is a hashtable and the heap is a max-heap. Popping an element from the heap leaves this element in the hashtable to ensure that the element will not be processed again." } ; { $description "Creates a new " { $link assoc-heap } " where the assoc is a hashtable and the heap is a max-heap. Popping an element from the heap leaves this element in the hashtable to ensure that the element will not be processed again." } ;
HELP: <unique-min-heap> HELP: <unique-min-heap>
{ $values { $values { "unique-heap" assoc-heap } }
{ "unique-heap" assoc-heap } }
{ $description "Creates a new " { $link assoc-heap } " where the assoc is a hashtable and the heap is a min-heap. Popping an element from the heap leaves this element in the hashtable to ensure that the element will not be processed again." } ; { $description "Creates a new " { $link assoc-heap } " where the assoc is a hashtable and the heap is a min-heap. Popping an element from the heap leaves this element in the hashtable to ensure that the element will not be processed again." } ;
{ <unique-max-heap> <unique-min-heap> } related-words { <unique-max-heap> <unique-min-heap> } related-words