[M3devel] open array parameter passing, to external C procedure

Dragiša Durić dragisha at m3w.org
Mon Feb 6 09:50:51 CET 2012


I have this case:

extern int epoll_wait (int __epfd, struct epoll_event *__events,
                       int __maxevents, int __timeout);

And I would like to do it like:

<*EXTERNAL*> 
PROCEDURE epoll_wait (epfd: int; VAR events: ARRAY OF epoll_event; timeout: int := -1): int;

…
VAR
  events: ARRAY [0..MaxEvents-1] OF epoll_event;

…

WITH res = epoll_wait(epfd, events, 2) DO
  …
END;

Can I expect cm3 to do "right thing". Or I have to place parameters "by hand" using ADR and SIZE?

TIA,
dd




More information about the M3devel mailing list