[Lazarus] translation from c-header
Sven Barth
pascaldragon at googlemail.com
Sun Jun 19 01:06:32 CEST 2016
Am 18.06.2016 14:20 schrieb "Koenraad Lelong" <lazarus2 at de-brouwerij.be>:
>
> Hi,
>
> I'm trying to port pigpio to fpc (http://abyz.co.uk/rpi/pigpio/).
> h2pas has a problem with this :
> c : typedef void *(gpioThreadFunc_t) (void *);
> How would this be translated to Pascal ?
> I know it's a function without result (= procedure), but what about the
paramater ?
> Later that function/procedure is used like this :
> function gpioStartThread(f:gpioThreadFunc_t;
userdata:pointer):Ppthread_t;cdecl;external;
>
>
> I also have a doubt about this :
>
> c : typedef void (*gpioTimerFunc_t) (void);
> Pascal : gpioTimerFunc_t = procedure (_para1:pointer);cdecl;
>
> Is this OK ?
>
> I'm not fluent with c, even less with such typedef's.
Yes, that should be correct.
Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20160619/570e8c23/attachment-0002.html>
More information about the Lazarus
mailing list