[rrd-developers] Re: Wnat to use rrd into C

Henrik Stoerner henrik at hswn.dk
Thu Jul 20 22:47:47 MEST 2006

On Thu, Jul 20, 2006 at 12:07:49PM -0700, Travis Spencer wrote:
> Hey Henrik (and everyone else),
> Thanks for the example and info.  I have a few questions about it though.
> On 7/7/06, Henrik Stoerner <henrik at hswn.dk> wrote:
> >The C API is basically just like the commandline API. E.g. to create a
> >graph you would run a command like
> By using the C API directly, I have to link against librrd.  This
> means that any such code that I write must be released under a
> GPL-compatible license.  Correct?

I really cannot answer for Toby and how he interprets the licensing
for RRDtool. It's a question I haven't had to ask, since my code is 
also GPL licensed. Toby has an exemption clause in his COPYRIGHT
file where under certain circumstances RRDtool is licensed under
another license, e.g. the LGPL. Read the RRDtool docs and judge for

BTW, the GPL doesn't require you to release your sourcecode as 
long as you are only using it in-house. It's the act of distributing
your program to others that invokes the GPL's reciprocal licensing.

But that discussion belongs elsewhere, I think.

> [snip]
> >    /* Was it OK ? */
> >    if (rrd_test_error() || (result != 0)) {
> >        if (calcpr) {
> >            int i;
> >            for (i=0; (calcpr[i]); i++) free(calcpr[i]);
> >            calcpr = NULL;
> >        }
> Does calcpr have to be freed later if the call to rrd_graph was
> successful?  I don't see that in your example or in hobbitgraph.c
> (which this example is very similar to).

I believe so, yes. From what I remember, the calcpr memory is allocated
by rrd_graph(), but it is your responsibility to free it after you've
finished using it.

If my code doesn't do it, it is probably because this particular tool
never runs for very long, so any memory leaks are not terribly
important. You may of course have different needs.


Unsubscribe mailto:rrd-developers-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-developers-request at list.ee.ethz.ch?subject=help
Archive     http://lists.ee.ethz.ch/rrd-developers
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi

More information about the rrd-developers mailing list