[mercury-users] passing self defined types from C to mercury

Pieter Laeremans pieter.laeremans at student.kuleuven.ac.be
Wed Mar 26 01:00:19 AEDT 2003


Hi,

Something isn't clear to me about passing a self defined type from a
mercury predicate implemented in C  to Mercury itself.

I have a Mercury predicate defined:

:- pred convert_data(liblnpdata::di, event::uo, robotstatus::di,
robotstatus::uo, io__io::di, io__io::uo) is det.

and a self defined type:

:- type event --->
	touch_sensor_push(sensor);
	touch_sensor_release(sensor);
	light_sensor_event(sensor, int).


liblnp is an abstract data type (it's a C-pointer actually) the convert
function has to do some parsing on the data and then return an
apropriate event.  Is there some way I can acces the type constructor of
self defined types from within the C-code or do I have to write helper
predicates to do that ?

Thanks in advance,

Pieter





--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list