Diff for /gforth/unix/socket.fs between versions 1.15 and 1.16

version 1.15, 2007/12/31 18:40:26 version 1.16, 2008/04/29 20:03:40
Line 17 Line 17
 \ You should have received a copy of the GNU General Public License  \ You should have received a copy of the GNU General Public License
 \ along with this program. If not, see http://www.gnu.org/licenses/.  \ along with this program. If not, see http://www.gnu.org/licenses/.
   
 require lib.fs  \c #include <netdb.h>
 [IFUNDEF] libc  c-function gethostbyname gethostbyname a -- a ( name -- hostent )
     s" os-type" environment? [IF]  \c #include <sys/types.h>
         2dup s" linux-gnu" str= [IF]  2drop  \c #include <sys/socket.h>
             library libc libc.so.6  c-function socket socket n n n -- n ( class type proto -- fd )
         [ELSE] 2dup s" cygwin" str= [IF]  2drop  c-function connect connect n a n -- n ( fd sock size -- err )
                 library libc cygwin1.dll  \c #include <stdio.h>
             [ELSE]  2dup s" bsd" search nip nip [IF]  2drop  c-function fdopen fdopen n a -- a ( fd fileattr -- file )
                     library libc libc.so  \c #include <arpa/inet.h>
                 [ELSE]  2dup s" darwin" string-prefix? [IF]  2drop  c-function htonl htonl n -- n ( x -- x' )
                         library libc libc.dylib  c-function htons htons n -- n ( x -- x' )
                     [ELSE]  2drop \ or add your stuff here  c-function ntohl ntohl n -- n ( x -- x' )
                     [THEN]  
                 [THEN]  
             [THEN]  
         [THEN]  
     [THEN]  
 [THEN]  
   
 libc gethostbyname ptr (ptr) gethostbyname ( name -- hostent )  
 libc socket int int int (int) socket ( class type proto -- fd )  
 libc connect int ptr int (int) connect ( fd sock size -- err )  
 libc fdopen int ptr (ptr) fdopen ( fd fileattr -- file )  
 libc htonl int (int) htonl ( x -- x' )  
 libc htons int (int) htons ( x -- x' )  
 libc ntohl int (int) ntohl ( x -- x' )  
   
 4 4 2Constant int%  4 4 2Constant int%
 2 2 2Constant short%  2 2 2Constant short%

Removed from v.1.15  
changed lines
  Added in v.1.16


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>