[procps] Re: Old library calls

  • From: Karel Zak <kzak@xxxxxxxxxx>
  • To: procps@xxxxxxxxxxxxx
  • Date: Tue, 10 Jul 2012 13:31:55 +0200

On Tue, Jul 03, 2012 at 08:57:43PM +1000, Craig Small wrote:
> On Mon, Jul 02, 2012 at 09:21:42PM +0200, Karel Zak wrote:
> >  Please, design the library in extendible way, hide all details and
> >  *don't export any struct members* by the API, always use functions,
> >  don't use typedef for structs, for example something like:
> [...]
> >     printf("Free: %ull\n", procps_sysmem_get_free(m));
> So procps_sysmem_get_free(m) is better than m->free ?
> I think that's what you are saying.

 Yes, definitely better. For function names you can use symbols
 versioning. Also, you can generated data on demand, convert to
 another units, etc. The functions make the API more flexible and
 stable.

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com

Other related posts: