Hi.

While looking at osmocom/netif/datagram.h I've noticed that it's organized
differently compared to other libosmo*. Most notably, it does not have structure
definitions, only brief declarations in datagram.h while the actual definition 
is in
datagram.c

This effectively means that client code using the library do not have access to
struct internals and have to use various "osmo_dgram_.x_set_*()" functions to
manipulate them.

This got me curious - what are the pros and cons of this approach?

I can see the benefit of being able to change struct internals without changing 
the
API. I can also see the downside in having to define lot's of boilerplate
setter/getter functions.

What else?

Are there other nice things about this approach? Is there a way to avoid or at 
least
simplify setter/getter boilerplate? Are there some other downsides to this?

-- 
Max Suraev <[email protected]> http://www.sysmocom.de/
======================================================================= 
* sysmocom - systems for mobile communications GmbH
* Alt-Moabit 93 
* 10559 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B 
* Geschaeftsfuehrer / Managing Director: Harald Welte 




Reply via email to