update openssl.libcrypto structs

Joe Groff 2009-09-18 17:50:20 -05:00
parent 9d73018ec1
commit 0a67837069
3 changed files with 38 additions and 38 deletions

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors byte-arrays alien.c-types alien.data kernel USING: accessors byte-arrays alien.c-types alien.data kernel
continuations destructors sequences io openssl openssl.libcrypto continuations destructors sequences io openssl openssl.libcrypto
checksums checksums.stream ; checksums checksums.stream classes.struct ;
IN: checksums.openssl IN: checksums.openssl
ERROR: unknown-digest name ; ERROR: unknown-digest name ;
@ -23,7 +23,7 @@ TUPLE: evp-md-context < disposable handle ;
: <evp-md-context> ( -- ctx ) : <evp-md-context> ( -- ctx )
evp-md-context new-disposable evp-md-context new-disposable
"EVP_MD_CTX" <c-object> dup EVP_MD_CTX_init >>handle ; EVP_MD_CTX <struct> dup EVP_MD_CTX_init >>handle ;
M: evp-md-context dispose* M: evp-md-context dispose*
handle>> EVP_MD_CTX_cleanup drop ; handle>> EVP_MD_CTX_cleanup drop ;

View File

@ -31,7 +31,7 @@ TUPLE: openssl-context < secure-context aliens sessions ;
] [ drop ] if ; ] [ drop ] if ;
: password-callback ( -- alien ) : password-callback ( -- alien )
"int" { "void*" "int" "bool" "void*" } "cdecl" int { void* int bool void* } "cdecl"
[| buf size rwflag password! | [| buf size rwflag password! |
password [ B{ 0 } password! ] unless password [ B{ 0 } password! ] unless

View File

@ -5,8 +5,8 @@
! !
! export LD_LIBRARY_PATH=/opt/local/lib ! export LD_LIBRARY_PATH=/opt/local/lib
USING: alien alien.syntax combinators kernel system USING: alien alien.c-types alien.syntax combinators kernel system
alien.libraries ; alien.libraries classes.struct ;
IN: openssl.libcrypto IN: openssl.libcrypto
@ -20,35 +20,35 @@ IN: openssl.libcrypto
} cond } cond
>> >>
C-STRUCT: bio-method STRUCT: bio-method
{ "int" "type" } { type int }
{ "void*" "name" } { name void* }
{ "void*" "bwrite" } { bwrite void* }
{ "void*" "bread" } { bread void* }
{ "void*" "bputs" } { bputs void* }
{ "void*" "bgets" } { bgets void* }
{ "void*" "ctrl" } { ctrl void* }
{ "void*" "create" } { create void* }
{ "void*" "destroy" } { destroy void* }
{ "void*" "callback-ctrl" } ; { callback-ctrl void* } ;
C-STRUCT: bio STRUCT: bio
{ "void*" "method" } { method void* }
{ "void*" "callback" } { callback void* }
{ "void*" "cb-arg" } { cb-arg void* }
{ "int" "init" } { init int }
{ "int" "shutdown" } { shutdown int }
{ "int" "flags" } { flags int }
{ "int" "retry-reason" } { retry-reason int }
{ "int" "num" } { num int }
{ "void*" "ptr" } { ptr void* }
{ "void*" "next-bio" } { next-bio void* }
{ "void*" "prev-bio" } { prev-bio void* }
{ "int" "references" } { references int }
{ "ulong" "num-read" } { num-read ulong }
{ "ulong" "num-write" } { num-write ulong }
{ "void*" "crypto-ex-data-stack" } { crypto-ex-data-stack void* }
{ "int" "crypto-ex-data-dummy" } ; { crypto-ex-data-dummy int } ;
CONSTANT: BIO_NOCLOSE HEX: 00 CONSTANT: BIO_NOCLOSE HEX: 00
CONSTANT: BIO_CLOSE HEX: 01 CONSTANT: BIO_CLOSE HEX: 01
@ -103,11 +103,11 @@ FUNCTION: void* BIO_f_buffer ( ) ;
CONSTANT: EVP_MAX_MD_SIZE 64 CONSTANT: EVP_MAX_MD_SIZE 64
C-STRUCT: EVP_MD_CTX STRUCT: EVP_MD_CTX
{ "EVP_MD*" "digest" } { digest EVP_MD* }
{ "ENGINE*" "engine" } { engine ENGINE* }
{ "ulong" "flags" } { flags ulong }
{ "void*" "md_data" } ; { md_data void* } ;
TYPEDEF: void* EVP_MD* TYPEDEF: void* EVP_MD*
TYPEDEF: void* ENGINE* TYPEDEF: void* ENGINE*