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.
USING: accessors byte-arrays alien.c-types alien.data kernel
continuations destructors sequences io openssl openssl.libcrypto
checksums checksums.stream ;
checksums checksums.stream classes.struct ;
IN: checksums.openssl
ERROR: unknown-digest name ;
@ -23,7 +23,7 @@ TUPLE: evp-md-context < disposable handle ;
: <evp-md-context> ( -- ctx )
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*
handle>> EVP_MD_CTX_cleanup drop ;

View File

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

View File

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