On Fri, Nov 07, 2003 at 04:30:42PM +0100, Pitisi wrote:
Hi.
> I write a C program and try to use RRD commands in it, but I can't find
> any documentation about librrd API.
Unfortunately there is no documentation of the API around. :-(

> Can somebody tell me where I can find such a documentation, or describe
> the syntax of the update command. I tried the following:
> int ret;
> char *cmd_update[5];
> 
> cmd_update[0] = "update";
> cmd_update[1] = "fic.rrd";
> cmd_update[2] = "--template";
> cmd_update[3] = "DSName";
> cmd_update[4] = "1067264490:1280";
Is cmd_update[5] === NULL ?
If I recall correctly the rrd_* functions parse the input with getopt and
if you give options on the command line the argv array is
NULL terminated at argv[argc].

Another pitfall is caused by the fact that getopt uses the optind
variable and this variable is global !

So you have to reset optind before each call to rrd_*()
It's a simple optind=0 but its annoying...

Hope this helps...Andreas.

P.S.: Hmmm... Maybe I will write a small documentation of the rrdtool-API.

-- 
Dipl.-Ing. Andreas Maus             science+computing ag
System Administration               Hagellocher Weg 71-75
mail: [EMAIL PROTECTED]   72070 Tuebingen, Germany
tel.: +49 7071 9457 456             www.science-computing.de

-- Binary/unsupported file stripped by Ecartis --
-- Err : No filename to use for decode, file stripped.
-- Type: application/pgp-signature


--
Unsubscribe mailto:[EMAIL PROTECTED]
Help        mailto:[EMAIL PROTECTED]
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

Reply via email to