> -Opprinnelig melding-
> Fra: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] På vegne av
> Henry Vermaak
> Sendt: 7. november 2006 15:04
> Til: FPC-Pascal users discussions
> Emne: Re: [fpc-pascal] Resending: Trying to convert some C code
>
> >BN_ULONG
BN_ULONG is just another way of saying unsigned long.
But redefined because it's C & for different compilers/platforms i think.
in that case, use d: PCardinal or pcULong (in ctypes - probably better)
As in, is this right "way" to convert parameter & return value..?
char *BN_bn2hex(const BIGNU
Will try this to , thanks for the tip :)
> -Opprinnelig melding-
> Fra: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] På vegne av
> Felipe Monteiro de Carvalho
> Sendt: 7. november 2006 12:42
> Til: FPC-Pascal users discussions
> Emne: Re: [fpc-pascal] Resendi
Thanks for the replies
> -Opprinnelig melding-
> Fra: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] På vegne av
> Henry Vermaak
> Sendt: 7. november 2006 12:19
> Til: FPC-Pascal users discussions
> Emne: Re: [fpc-pascal] Resending: Trying to convert some C code
ops .. only now I saw this.
You don't need to encapsulate the procedure variable inside a real
procedure. You can call a procedure variable, like if it was a
procedure.
Try this code:
Unit bn;
{$MODE DELPHI}{$H+}
{$packrecords c}
interface
uses ctypes, DynLibs;
type
bignum_st = record
d
another one:
function BN_Bn2Hex(a:BNPtr):PChar;
begin
_BnBn2Hex(a);
end;
i also assume that it should be Result := _BnBn2Hex(a); ? i don't
quite see the use of this function...
henry
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http
i'm no guru, but here's a couple of things that you might try:
{$PACKRECORDS C} to make sure about that struct (gives me problems on
osx if i don't use it)
BN_ULONG *d;
what is BN_ULONG? make sure it's the same size of:
d:pointer;
you forgot the calling convention here:
Type
TBN_b
Hello again
My 5 year old kid did send this before I got it ready,
So here goes again..
Would any FPC guru help me converting this C code?
(it's from bn.h/libeay32.dll)
typedef struct bignum_st BIGNUM;
struct bignum_st
{
BN_ULONG *d;
int top;
int dmax;
int neg;
int flags;
};