alien.c-types: fix help lint
							parent
							
								
									9c943e5ad0
								
							
						
					
					
						commit
						c55bdc0d34
					
				| 
						 | 
				
			
			@ -66,12 +66,12 @@ HELP: unbox-return
 | 
			
		|||
{ $notes "This is an internal word used by the compiler when compiling callbacks." } ;
 | 
			
		||||
 | 
			
		||||
HELP: define-deref
 | 
			
		||||
{ $values { "name" "a word name" } }
 | 
			
		||||
{ $values { "c-type" "a C type" } }
 | 
			
		||||
{ $description "Defines a word " { $snippet "*name" } " with stack effect " { $snippet "( c-ptr -- value )" } " for reading a value with C type " { $snippet "name" } " stored at an alien pointer." }
 | 
			
		||||
{ $notes "This is an internal word called when defining C types, there is no need to call it on your own." } ;
 | 
			
		||||
 | 
			
		||||
HELP: define-out
 | 
			
		||||
{ $values { "name" "a word name" } }
 | 
			
		||||
{ $values { "c-type" "a C type" } }
 | 
			
		||||
{ $description "Defines a word " { $snippet "<" { $emphasis "name" } ">" } " with stack effect " { $snippet "( value -- array )" } ". This word allocates a byte array large enough to hold a value with C type " { $snippet "name" } ", and writes the value at the top of the stack to the array." }
 | 
			
		||||
{ $notes "This is an internal word called when defining C types, there is no need to call it on your own." } ;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -297,11 +297,11 @@ M: long-long-type box-parameter ( n c-type -- )
 | 
			
		|||
M: long-long-type box-return ( c-type -- )
 | 
			
		||||
    f swap box-parameter ;
 | 
			
		||||
 | 
			
		||||
: define-deref ( name -- )
 | 
			
		||||
: define-deref ( c-type -- )
 | 
			
		||||
    [ name>> CHAR: * prefix "alien.c-types" create ] [ c-getter 0 prefix ] bi
 | 
			
		||||
    (( c-ptr -- value )) define-inline ;
 | 
			
		||||
 | 
			
		||||
: define-out ( word -- )
 | 
			
		||||
: define-out ( c-type -- )
 | 
			
		||||
    [ name>> "alien.c-types" constructor-word ]
 | 
			
		||||
    [ dup c-setter '[ _ heap-size (byte-array) [ 0 @ ] keep ] ] bi
 | 
			
		||||
    (( value -- c-ptr )) define-inline ;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue