Re: [fpc-pascal] Trying to convert some C code

2006-11-07 Thread Florian Klaempfl
Please don't start new topis by replying to another one. This makes reading mails in the tree view very confusing. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

SV: [fpc-pascal] Resending: Trying to convert some C code

2006-11-07 Thread Ole J. Røtne
> -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 is just another way of saying unsi

Re: [fpc-pascal] Resending: Trying to convert some C code

2006-11-07 Thread Henry Vermaak
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

SV: [fpc-pascal] Resending: Trying to convert some C code

2006-11-07 Thread Ole J. Røtne
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] Resending: Trying to convert some

SV: [fpc-pascal] Resending: Trying to convert some C code

2006-11-07 Thread Ole J. Røtne
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 > > i'm no guru, but her

Re: [fpc-pascal] Fpc compiler error win32 "Entrypoint _mainCRTStartup not defined"

2006-11-07 Thread Marius Ellen
Cool, just copying the old 2.0.4 ppc386.exe into the bin\i386-win32 seems to be enough (or at least it compiles win32 and wince without any troubles now) Thank you! Marius Florian Klaempfl wrote: Please ensure to use 2.0.4 as starting compiler. ___

Re: [fpc-pascal] Resending: Trying to convert some C code

2006-11-07 Thread Felipe Monteiro de Carvalho
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

Re: [fpc-pascal] Resending: Trying to convert some C code

2006-11-07 Thread Henry Vermaak
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

Re: [fpc-pascal] Trying to convert some C code

2006-11-07 Thread Felipe Monteiro de Carvalho
since this is from a c library you should define {$packrecords c} on the unit with this code. type BIGNUM = bignum_st; PBIGNUM = ^bignum_st; bignum_st = record d: PBN_ULONG; top: cint; dmax: cint; neg: cint; flags: cint; end; TBN_bn2hex = function (const a: PBIGNUM): PChar;

Re: [fpc-pascal] Resending: Trying to convert some C code

2006-11-07 Thread Henry Vermaak
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

[fpc-pascal] Resending: Trying to convert some C code

2006-11-07 Thread Ole J. Røtne
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; };

Re: [fpc-pascal] Fpc compiler error win32 "Entrypoint _mainCRTStartup not defined"

2006-11-07 Thread Florian Klaempfl
Marius schrieb: > Hello, > > Was trying the last trunk and got this error on the i386-win32. Its not > a big deal, we still got a working fpc/lazarus for win32 & wince, just > wundering if this is a known (or fixable) error. > > cd \fpcsrc > make clean OS_TARGET=win32 CPU_TARGET=i386 > make insta

[fpc-pascal] Trying to convert some C code

2006-11-07 Thread Ole J. Røtne
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 ho

[fpc-pascal] Fpc compiler error win32 "Entrypoint _mainCRTStartup not defined"

2006-11-07 Thread Marius
Hello, Was trying the last trunk and got this error on the i386-win32. Its not a big deal, we still got a working fpc/lazarus for win32 & wince, just wundering if this is a known (or fixable) error. cd \fpcsrc make clean OS_TARGET=win32 CPU_TARGET=i386 make install OS_TARGET=win32 CPU_TARGET=