[rrd-users] Fix for Tcl binding

Dave Bodenstab dave at bodenstab.org
Wed Oct 5 07:35:21 MEST 2005


Here's a patch for

Most of the calls to getopt_cleanup() used an incorrect argument.
In addition, it seems to me that since this is not a TclObj'ified
extension, why mess around with TclObj's at all?  A two-element
list of two integers is just <integer><space><integer>.
I've also ansi'fied the C which, if it had been done before, would have
caught the calls with invalid arguments.
This exposed additional problems with the function definitions;
I've fixed those also.
I've also fixed up the safe interpreter stuff; however due to RRD's
API, it's pretty useless.  A safe interpreter cannot even call 
rrd_graph since it writes to a filename supplied by the caller.
Finally, the extension has been tclstub'ified; it must now be linked
with the tclstub library.
It should also be either linked (on FreeBSD at least, probably Linux
also, perhaps other unixes) against librrd.so so the other dependent
libs (libfreetype, etc) are loaded, or explicitly reference the
dependent libs.  I'm not real familiar with libtool, so I've just
appended LIBS to the link line.


I've messed with mailgraph and written a simple cgi using rrdtool.
What you need is an API that lets a perl/tcl/etc. binding get the
output of rrdgraph directly -- skip the file stuff.  After all, if
I have to write an image file and then turn around a read it so the
cgi can deliver the image to the client, why bother with a specialized
.so?  ...Just run the rrdgraph program.   Yes, I know it's a little
more efficient to load the .so once rather than run the program multiple
times... but it would be even better if the whole "writing the image
to a file" could be avoided in the first place.  It also avoids the whole
business of picking a suitable "tmp" directory.

Even the other functions (rrdlast, rrdfetch, etc.) would be easier to
deal with if they did not insist on writing the result to stdout.

I think providing some interface to avoid the "write to stdout" or
"write a file" would be appreciated by all who want to embed rrd.
Certainly with .png files, it's possible to capture the image without
writing a file; I haven't looked, but it can't be too hard for the 

You could even wrap the new API's within the existing API's so that
no existing programs would be affected.

Dave Bodenstab
dave at bodenstab.org

-- Attached file removed by Ecartis and put at URL below --
-- Type: application/octet-stream
-- Size: 2k (2955 bytes)
-- URL : http://lists.ee.ethz.ch/p/Patch.gz

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

More information about the rrd-users mailing list