[fpc-pascal] Trying to convert some C code

Ole J. R√łtne ole.rotne at online.no
Tue Nov 7 11:42:50 CET 2006


Hello

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;
};

char *BN_bn2hex(const BIGNUM *a);


I guess my problem is understanding pointers, and how they work.
Tried something like this (did cut some checks & stuff to make it short):

  _BnBn2Hex: TBN_bn2hex = nil;
Function InitLib:boolean;
Begin
  LibHandle := LoadLibrary('libeay32.dll');
  _BnBn2Hex := GetProcAddress( BnLibHandle, 'BN_bn2hex');
  result := true;
End;
End.

Ole JR




More information about the fpc-pascal mailing list