Subject: Ada binding and void*
Author: Geobert (Ido), 2004-12-20 13:43:01
I'm writing an Ada binding on lamip plug sdk. I use an old software (1999!!!) called c2ada to translate the .h of include directory. I have a problem on plug_in.h as it uses void* type on lamip_writeData and lamip_url_read and c2ada don"t know how to manage it... Can the void* be changed to something else ?
Replies
Author: ciberfred, 2004-12-20 18:15:23
i think it's for .ads files. well.. good question, i use void* because datas could be short, int or long int. depend of resolution of songs (8/16/32 bits). I don't remember if there are some 'unknow' data type in ADA but i think not as long as ada is a strict language.
Maybe there is a workaround on the net...
Maybe there is a workaround on the net...
Author: Geobert (Ido), 2004-12-20 21:17:29
I think I can put something as "unknown" type in Ada code but I'll loose the strong type checking which help to avoid a lot of bugs ;)
For you're problem, maybe an union with these 3 diffrent type can do the job ? So you're code will be stronger.
What do you think ?
For you're problem, maybe an union with these 3 diffrent type can do the job ? So you're code will be stronger.
What do you think ?
Author: ciberfred, 2004-12-20 22:00:29
union will complicate code. i don't think it's a good idea. The advantage of the C is that there is this unknow data type, so i use it :)
Author: Geobert (Ido), 2004-12-21 00:04:11
ok you're the boss ;)
I suppose the size_t parameter says how much you must read in the memory ? So I'll translate the void* by System.Adresse Ada type
I suppose the size_t parameter says how much you must read in the memory ? So I'll translate the void* by System.Adresse Ada type