fix usings
							parent
							
								
									5cc5d347ae
								
							
						
					
					
						commit
						b333583da4
					
				| 
						 | 
					@ -15,9 +15,8 @@ M: invalid-baud summary ( invalid-baud -- string )
 | 
				
			||||||
    " not supported" 3append ;
 | 
					    " not supported" 3append ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
HOOK: lookup-baud os ( m -- n )
 | 
					HOOK: lookup-baud os ( m -- n )
 | 
				
			||||||
HOOK: open-serial os ( serial -- serial' )
 | 
					HOOK: open-serial os ( serial -- stream )
 | 
				
			||||||
M: serial dispose ( serial -- ) stream>> dispose ;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    { [ os unix? ] [ "serial.unix" ] } 
 | 
					    { [ os unix? ] [ "io.serial.unix" ] } 
 | 
				
			||||||
} cond require
 | 
					} cond require
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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 kernel math.bitfields sequences system serial ;
 | 
					USING: alien.syntax kernel math.bitfields sequences system io.serial ;
 | 
				
			||||||
IN: io.serial.unix
 | 
					IN: io.serial.unix
 | 
				
			||||||
 | 
					
 | 
				
			||||||
M: bsd lookup-baud ( m -- n )
 | 
					M: bsd lookup-baud ( m -- n )
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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: assocs alien.syntax kernel serial system unix ;
 | 
					USING: assocs alien.syntax kernel io.serial system unix ;
 | 
				
			||||||
IN: io.serial.unix
 | 
					IN: io.serial.unix
 | 
				
			||||||
 | 
					
 | 
				
			||||||
: TCSANOW     0 ; inline
 | 
					: TCSANOW     0 ; inline
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4,6 +4,6 @@ USING: combinators system vocabs.loader ;
 | 
				
			||||||
IN: io.serial.unix.termios
 | 
					IN: io.serial.unix.termios
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    { [ os linux? ] [ "serial.unix.termios.linux" ] }
 | 
					    { [ os linux? ] [ "io.serial.unix.termios.linux" ] }
 | 
				
			||||||
    { [ os bsd? ] [ "serial.unix.termios.bsd" ] }
 | 
					    { [ os bsd? ] [ "io.serial.unix.termios.bsd" ] }
 | 
				
			||||||
} cond require
 | 
					} cond require
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,12 +2,12 @@
 | 
				
			||||||
! See http://factorcode.org/license.txt for BSD license.
 | 
					! See http://factorcode.org/license.txt for BSD license.
 | 
				
			||||||
USING: accessors alien.c-types alien.syntax combinators io.ports
 | 
					USING: accessors alien.c-types alien.syntax combinators io.ports
 | 
				
			||||||
io.streams.duplex io.unix.backend system kernel math math.bitfields
 | 
					io.streams.duplex io.unix.backend system kernel math math.bitfields
 | 
				
			||||||
vocabs.loader unix serial serial.unix.termios ;
 | 
					vocabs.loader unix io.serial io.serial.unix.termios ;
 | 
				
			||||||
IN: io.serial.unix
 | 
					IN: io.serial.unix
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<< {
 | 
					<< {
 | 
				
			||||||
    { [ os linux? ] [ "serial.unix.linux" ] }
 | 
					    { [ os linux? ] [ "io.serial.unix.linux" ] }
 | 
				
			||||||
    { [ os bsd? ] [ "serial.unix.bsd" ] }
 | 
					    { [ os bsd? ] [ "io.serial.unix.bsd" ] }
 | 
				
			||||||
} cond require >>
 | 
					} cond require >>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
FUNCTION: speed_t cfgetispeed ( termios* t ) ;
 | 
					FUNCTION: speed_t cfgetispeed ( termios* t ) ;
 | 
				
			||||||
| 
						 | 
					@ -31,9 +31,8 @@ FUNCTION: int cfsetspeed ( termios* t, speed_t s ) ;
 | 
				
			||||||
: <file-rw> ( path -- stream ) open-rw fd>duplex-stream ;
 | 
					: <file-rw> ( path -- stream ) open-rw fd>duplex-stream ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
M: unix open-serial ( serial -- serial' )
 | 
					M: unix open-serial ( serial -- serial' )
 | 
				
			||||||
    dup
 | 
					 | 
				
			||||||
    path>> { O_RDWR O_NOCTTY O_NDELAY } flags file-mode open-file
 | 
					    path>> { O_RDWR O_NOCTTY O_NDELAY } flags file-mode open-file
 | 
				
			||||||
    fd>duplex-stream >>stream ;
 | 
					    fd>duplex-stream ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
: serial-fd ( serial -- fd )
 | 
					: serial-fd ( serial -- fd )
 | 
				
			||||||
    stream>> in>> handle>> fd>> ;
 | 
					    stream>> in>> handle>> fd>> ;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue