[Biocorba-l] C and the new IDL
Ewan Birney
birney@ebi.ac.uk
Sun, 12 Nov 2000 19:57:10 +0000 (GMT)
On Sun, 12 Nov 2000 ableasby@hgmp.mrc.ac.uk wrote:
> First to add my thanks to Alan. Being from the EMBOSS lot, and
> therefore speaking from the C pointerview, it was pretty painless
> getting things going.
>
> I hadn't looked at CORBA or ORBIT programming details before today
> and have to say the documentation is a tad thin... but the header
> file from orbit-idl is excellent help if you stare at it with your
> eyes slightly out of focus for a while. Still, the fact that I could
> knock together something to return the sequences, ids, length etc in
> short order is a credit to the biocorba folk.
The C mapping is only really documented in the C mapping standard,
and even then it is ... interesting to understand...
I guess you have written a client not a server. Servers in C are *real*
fun...
>
> It works but I don't know enough about ORBIT internals to know whether
> it leaks. Are there any C programmers apart from me here? I saw the
> python exchange but maybe there's some prejudice against C looking at
> the start of the IDL and the "waaay too long comment" >8-> Any help in
> giving the code the once-over before I tidy and EMOSSify it would be
> appreciated e.g. do successive calls to get (e.g.) a sequence eat
> memory if not freed (if so how and when) or are the contents
> overwritten by the next call? Anyone successfully used PURIFY for
> ORBIT code? I'll post the code to any volunteers.
>
I am not sure that purify does well on this code base - orbit does do
some pretty wierd things down there, but orbit itself does not leak memory
- gnome would have shouted years ago if it idid (indeed, it has done in
the past).
For strings you need to call CORBA_free(string) on it to realse the
pointer to the char*. If you get back a pointer from ORBit calling
CORBA_free on it will remove the client side data structures.
biocorba provides for the simplest reference counting system between
client and server. You should call object->unref (the C call will be
suitably long) before you discard the client side structures with a
CORBA_free call. There is no official necessity for clients to do this
except that this is the biocorba standard...
> On the IDL: It would be very useful for the EMBOSS way of doing things
> if at least one call would return the ID rather than display-id and
> primary_id being the same as the accession_number. EMBOSS
> prefers having both. I'll have a play retrieving stuff from
> the feature tables over the next few days. There are two ways
> EMBOSS deals with these at the moment and, if my luck holds,
> hopefully one of them might mesh. If not I hope you all don't
> mind some comments from a newbie here.
great to see another C hacker playing with CORBA. I have a long experience
now with C ORBs (client and server) so .... you are in good (or is it
bad ;) ) company...
>
> Cheers,
>
> (the other)
> Alan
>
> _______________________________________________
> Biocorba-l mailing list
> Biocorba-l@biocorba.org
> http://www.biocorba.org/mailman/listinfo/biocorba-l
>
-----------------------------------------------------------------
Ewan Birney. Mobile: +44 (0)7970 151230, Work: +44 1223 494420
<birney@ebi.ac.uk>.
-----------------------------------------------------------------