Merge branch 'master' of factorcode.org:/git/factor

db4
Joe Groff 2010-04-28 15:49:00 -07:00
commit add082faa3
8 changed files with 29 additions and 7 deletions

1
.gitignore vendored
View File

@ -12,6 +12,7 @@ Factor/factor
*.res
*.RES
*.image
factor.image.fresh
*.dylib
factor
factor.com

View File

@ -35,7 +35,8 @@ HELP: STRUCT:
{ "Struct classes cannot have a superclass defined." }
{ "The slots of a struct must all have a type declared. The type must be a C type." }
{ { $link read-only } " slots on structs are not enforced, though they may be declared." }
} } ;
}
"Additionally, structs may use bit fields. A slot specifier may use the syntax " { $snippet "bits: n" } " to specify that the bit width of the slot is " { $snippet "n" } ". Bit width may be specified on signed or unsigned integer slots. The layout of bit fields is not guaranteed to match that of any particular C compiler." } ;
HELP: S{
{ $syntax "S{ class slots... }" }

View File

@ -192,12 +192,13 @@ HELP: <datagram>
}
}
{ $notes
"To accept UDP/IP packets from any host, use an address specifier returned by the following code, where 1234 is the desired port number:"
{ $code "f 1234 <inet> resolve-host" }
"To accept UDP/IP packets from the loopback interface only, use an address specifier returned by the following code, where 1234 is the desired port number:"
{ $code "\"localhost\" 1234 <inet> resolve-host" }
"To accept UDP/IP packets from any host, use an address specifier where the host name is set to " { $link f } ":"
{ $code "f 1234 <inet4> <datagram>" }
"To create a datagram socket bound to a randomly-assigned port, set the port number in the address specifier to 0, and then read the " { $snippet "addr" } " slot of the datagram instance to obtain the actual port number it is bound to:"
{ $code "f 0 <inet4> <datagram>" }
"To accept UDP/IP packets from the loopback interface only, use an address specifier like the following:"
{ $code "\"127.0.0.1\" 1234 <inet4> <datagram>s" }
"Since " { $link resolve-host } " can return multiple address specifiers, your code must create a datagram socket for each one and co-ordinate packet sending accordingly."
"Datagrams are low-level binary ports that don't map onto streams, so the constructor does not use an encoding"
}
{ $errors "Throws an error if the port is already in use, or if the OS forbids access." } ;

View File

@ -25,7 +25,8 @@ test_program_installed() {
exit_script() {
if [[ $FIND_MAKE_TARGET -eq true ]] ; then
$ECHO $MAKE_TARGET;
# Must be echo not $ECHO
echo $MAKE_TARGET;
fi
exit $1
}

View File

@ -0,0 +1 @@
Doug Coleman

View File

@ -0,0 +1,6 @@
! Copyright (C) 2010 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: build-support sequences tools.test ;
IN: build-support.tests
[ f ] [ factor.sh-make-target empty? ] unit-test

View File

@ -0,0 +1,10 @@
! Copyright (C) 2010 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: arrays io io.backend io.encodings.utf8 io.launcher ;
IN: build-support
CONSTANT: factor.sh-path "resource:build-support/factor.sh"
: factor.sh-make-target ( -- string )
factor.sh-path normalize-path "make-target" 2array
utf8 [ readln ] with-process-reader ;

View File

@ -0,0 +1 @@
unix