Code

Removed references to GIF
authoralex <alex@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Sat, 6 Apr 2002 12:25:29 +0000 (12:25 +0000)
committeralex <alex@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Sat, 6 Apr 2002 12:25:29 +0000 (12:25 +0000)
Changed y0 and such into Y0 and so

git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@116 a5681a0c-68f1-0310-ab6d-d61299d08faa

22 files changed:
NT-BUILD-TIPS.txt
bindings/perl-shared/Makefile.PL
bindings/perl-shared/RRDs.pm
bindings/perl-shared/ntmake.pl
bindings/perl-shared/t/base.t
doc/Makefile.am
doc/cdeftutorial.pod
doc/rrdgraph-old.pod
doc/rrdgraph_graph.src
doc/rrdtutorial.es.pod
examples/cgi-demo.cgi
examples/cgi-demo.cgi.in
examples/piped-demo.pl
examples/piped-demo.pl.in
examples/shared-demo.pl
examples/shared-demo.pl.in
src/rrd_cgi.c
src/rrd_gfx.c
src/rrd_gfx.h
src/rrd_graph.c
src/rrd_graph.h
src/rrd_tool.h

index 0354f5016b18a90cf1b2860136043a5e6a6b1067..d163d3f195a81acc0e44e606f75bac15ed02d606 100644 (file)
@@ -58,7 +58,7 @@ Is a library missing? But it does not stop with an error...
 
 4. nmake test (You must have Visual C++ on the machine!)
 
-After these steps it generates the test files (gifs and rrds),
+After these steps it generates the test files (svgs and rrds),
 and they seem to be good.
 
 The real problem in the shared perl modul is the following:
index b7732be459178295e68c133396a3bde17e40917c..76a81541ba74343a2ef008b7617743973062a270 100644 (file)
@@ -15,5 +15,5 @@ WriteMakefile(
     # Perl will figure out which one is valid
     'depend'      => {'RRDs.c' => "../../src/.libs/librrd_private.a"},
     'dynamic_lib'  => {'OTHERLDFLAGS' => "$librrd -lm"},
-    'realclean'    => {FILES => 't/demo?.rrd t/demo?.gif' }
+    'realclean'    => {FILES => 't/demo?.rrd t/demo?.png' }
 );
index 7ed87c20be4148ec5bd22d03def2e4d7b794fb70..2cd337033e7520b94715914aad60d0d5f39fa574 100644 (file)
@@ -75,10 +75,10 @@ B<RRDs::last> returns a single INTEGER representing the last update time.
  $lastupdate = RRDs::last ...
 
 B<RRDs::graph> returns an pointer to an ARRAY containing the x-size and y-size of the
-created gif and results of the PRINT arguments.
+created image and results of the PRINT arguments.
 
  ($averages,$xsize,$ysize) = RRDs::graph ...
- print "Gifsize: ${xsize}x${ysize}\n";
+ print "Imagesize: ${xsize}x${ysize}\n";
  print "Averages: ", (join ", ", @$averages);
 
 B<RRDs::info> returns a pointer to a hash. The keys of the hash
index ff01a410e68c6e2f9d97eb981fca205b077ec81b..dbde9bffabdbb7529b4c4c331592fba69f15bf83 100644 (file)
@@ -12,7 +12,7 @@ WriteMakefile(
    'INC'       => '-I../../src/ -I../../libraries/freetype-2.0.5/include -I ../../libraries/libart_lgpl-2.3.7 -I ../../libraries/zlib-1.1.4 -I ../../libraries/libpng-1.2.0',    
 # change this path to refer to your libc.lib
     'MYEXTLIB'  => 'c:/vc98/lib/libc.lib ../../src/release/rrd.lib ../../libraries/libart_lgpl-2.3.7/release/libart.lib ../../libraries/zlib-1.1.4/release/zlib.lib ../../libraries/libpng-1.2.0\release\png.lib ../../libraries/freetype-2.0.5/release/freetype.lib', 
-    'realclean'    => {FILES => 't/demo?.rrd t/demo?.gif' },
+    'realclean'    => {FILES => 't/demo?.rrd t/demo?.png' },
     ($] ge '5.005') ? (
         'AUTHOR' => 'Tobias Oetiker (oetiker@ee.ethz.ch)',
         'ABSTRACT' => 'Round Robin Database Tool',
index 0477f45421b41962f0a3c55a7d5baaceb8523b99..8154a11a8f8413c0da99555f95238164bb25eeab 100755 (executable)
@@ -30,8 +30,8 @@ my $RUNS  = 500;
 my $GRUNS = 4;
 my $RRD1  = "demo1.rrd";
 my $RRD2  = "demo2.rrd";
-my $GIF1  = "demo1.gif";
-my $GIF2  = "demo2.gif";
+my $PNG1  = "demo1.png";
+my $PNG2  = "demo2.png";
 my $time  = 30*int(time/30);
 my $START = $time-$RUNS*$STEP;
 
@@ -107,14 +107,14 @@ if ($ERROR = RRDs::error) {
   die "$0: unable to update `$RRD2': $ERROR\n";
 }
 
-print "* Creating $GRUNS graphs: $GIF1 & $GIF2\n\n";
+print "* Creating $GRUNS graphs: $PNG1 & $PNG2\n\n";
 my $now = $time;
 for (my $i=0;$i<$GRUNS;$i++) {
-  my @rrd_gifs = ($RRD1, $GIF1, $RRD2, $GIF2);
-  while (@rrd_gifs) {
-    my $RRD = shift(@rrd_gifs);
-    my $GIF = shift(@rrd_gifs);
-    my ($graphret,$xs,$ys) = RRDs::graph $GIF, "--title", 'Test GRAPH',
+  my @rrd_pngs = ($RRD1, $PNG1, $RRD2, $PNG2);
+  while (@rrd_pngs) {
+    my $RRD = shift(@rrd_pngs);
+    my $PNG = shift(@rrd_pngs);
+    my ($graphret,$xs,$ys) = RRDs::graph $PNG, "--title", 'Test GRAPH',
           "--vertical-label", 'Dummy Units', "--start", (-$RUNS*$STEP),
           "DEF:alpha=$RRD:a:AVERAGE",
           "DEF:beta=$RRD:b:AVERAGE",
@@ -143,7 +143,7 @@ for (my $i=0;$i<$GRUNS;$i++) {
     if ($ERROR = RRDs::error) {
       print "ERROR: $ERROR\n";
     } else {
-      print "GIF Size: ${xs}x${ys}\n";
+      print "Image Size: ${xs}x${ys}\n";
       print "Graph Return:\n",(join "\n", @$graphret),"\n\n";
     }
   }
index ba22f05e46ca2e81d918efd3cf4004fa0e009724..824fad974c4f7cc76e1f4ee26a35c952dde54f7c 100644 (file)
@@ -58,7 +58,7 @@ RRDp.pm:
        ln -s ../bindings/perl-piped/RRDp.pm .
 
 index.html:
-       rm index.html; ln -s rrdtool.html index.html
+       rm -f index.html; ln -s rrdtool.html index.html
 
 link: RRDp.pm RRDs.pm index.html
 
index 19070aecaa35a3e98bd95c6982a0bd58e9639847..fe580634e25032e1dc085c6c1407bebb9f5c9975 100644 (file)
@@ -725,7 +725,7 @@ If you do so, you won't be able to use these next GPRINTs:
 
 =head2 Degrees Celcius vs. Degrees Fahrenheit
 
-   rrdtool graph demo.gif --title="Demo Graph" \
+   rrdtool graph demo.png --title="Demo Graph" \
       DEF:cel=demo.rrd:exhaust:AVERAGE \
       CDEF:far=cel,32,-,0.55555,* \
       LINE2:cel#00a000:"D. Celsius" \
@@ -750,7 +750,7 @@ enough for this purpose and it saves a calculation.
 
 =head2 Changing unknown into zero
 
-   rrdtool graph demo.gif --title="Demo Graph" \
+   rrdtool graph demo.png --title="Demo Graph" \
       DEF:idat1=interface1.rrd:ds0:AVERAGE \
       DEF:idat2=interface2.rrd:ds0:AVERAGE \
       DEF:odat1=interface1.rrd:ds1:AVERAGE \
index 8e8038e98c1b56e1253d73907fd3a8b629fc1678..b464c4266408ba496dbc576dae382c2ae0b67beb 100644 (file)
@@ -20,7 +20,7 @@ S<[B<-w>|B<--width> I<pixels>]>
 S<[B<-h>|B<--height> I<pixels>]> 
 S<[B<-i>|B<--interlaced>]> 
 S<[B<-f>|B<--imginfo> I<formatstring>]> 
-S<[B<-a>|B<--imgformat> B<GIF>|B<PNG>]> 
+S<[B<-a>|B<--imgformat> B<SVG>|B<PNG>]> 
 S<[B<-z>|B<--lazy>]> 
 S<[B<-o>|B<--logarithmic>]>
 S<[B<-u>|B<--upper-limit> I<value>]> 
@@ -54,14 +54,11 @@ from generating graphs, it can also extract numerical reports.
 =item I<filename> 
 
 The name of the graph to generate. Since B<rrdtool> outputs
-GIFs and PNGs, it's recommended that the filename end in either
-F<.gif> or F<.png>.  B<rrdtool> does not enforce this, however.
+SVGs and PNGs, it's recommended that the filename end in either
+F<.svg> or F<.png>.  B<rrdtool> does not enforce this, however.
 If the  I<filename> is set to '-' the image file will be written
 to standard out.  All other output will get suppressed.
 
-PNG output is recommended, since it takes up to 40% less disk space
-and 20-30% less time to generate than a GIF file.
-
 If no graph functions are called, the graph will not be created.
 
 =item B<-s>|B<--start> I<seconds> (default end-1day)
@@ -170,20 +167,20 @@ specify the units used.
 =item B<-w>|B<--width> I<pixels> (default 400 pixel)
 
 Width of the drawing area within the graph. This affects the size of the
-gif.
+image.
 
 =item B<-h>|B<--height> I<pixels> (default 100 pixel)
 
 Width of the drawing area within the graph. This affects the size of the
-gif.
+image.
 
 =item B<-i>|B<--interlaced> (default: false)
 
-If you set this option, then the resulting GIF will be interlaced.
+If you set this option, then the resulting image will be interlaced.
 Most web browsers display these incrementally as they load. If
-you do not use this option, the GIFs default to being progressive
+you do not use this option, the image defaults to being progressive
 scanned. The only effect of this option is to control the format
-of the GIF on disk. It makes no changes to the layout or contents
+of the image on disk. It makes no changes to the layout or contents
 of the graph.
 
 =item B<-f>|B<--imginfo> I<formatstring>
@@ -197,13 +194,13 @@ would look like this:
 
  --imginfo '<IMG SRC="/img/%s" WIDTH="%lu" HEIGHT="%lu" ALT="Demo">'
 
-=item B<-a>|B<--imgformat> B<GIF>|B<PNG> (default: GIF)
+=item B<-a>|B<--imgformat> B<SVG>|B<PNG> (default: PNG)
 
 Allows you to produce PNG output from rrdtool. 
 
 =item B<-z>|B<--lazy> (default: false)
 
-Only generate the graph, if the current gif is out of date or not
+Only generate the graph, if the current image is out of date or not
 existent.
 
 =item B<-u>|B<--upper-limit> I<value> (default autoconfigure)
@@ -521,11 +518,11 @@ before placing the next row of legends.
 =head1 NOTE on Return Values
 
 Whenever rrd_graph gets called, it prints a line telling the size of
-the gif it has just created to STDOUT. This line looks like this: XSIZExYSIZE.
+the image it has just created to STDOUT. This line looks like this: XSIZExYSIZE.
 
 =head1 EXAMPLE 1
 
-  rrdtool graph demo.gif --title="Demo Graph" \
+  rrdtool graph demo.png --title="Demo Graph" \
           DEF:cel=demo.rrd:exhaust:AVERAGE \
           "CDEF:far=cel,1.8,*,32,+"" \
           LINE2:cel#00a000:"D. Celsius" \
@@ -538,7 +535,7 @@ I<*UNKNOWN*> values to 0.  This technique is useful if you are
 aggregating interface data where the start dates of the data sets
 doesn't match.
 
-  rrdtool graph demo.gif --title="Demo Graph" \
+  rrdtool graph demo.png --title="Demo Graph" \
          DEF:idat1=interface1.rrd:ds0:AVERAGE \
          DEF:idat2=interface2.rrd:ds0:AVERAGE \
          DEF:odat1=interface1.rrd:ds1:AVERAGE \
@@ -602,7 +599,7 @@ If the specialized function B<RRAs> exist for aberrant behavior detection, they
 can be used to generate the graph of a time series with confidence bands and
 failures.
 
-   rrdtool graph example.gif \
+   rrdtool graph example.png \
           DEF:obs=monitor.rrd:ifOutOctets:AVERAGE \
           DEF:pred=monitor.rrd:ifOutOctets:HWPREDICT \
           DEF:dev=monitor.rrd:ifOutOctets:DEVPREDICT \
index 732e03b1d39cc0c54c39d4ad0b3dd12a82ab3423..0209b0518d163fd78caccaafea77097cc341019b 100644 (file)
@@ -131,12 +131,12 @@ B<GPRINT:>I<vname>B<:>I<CF>B<:>I<format>
 
 I<Depriciated. Use the new form of this command in new scripts.>
 This is the same as B<PRINT> but now it is printed inside the graph.
-See L<PRINT> for more information.
+See L<PRINT|rrdgraph/PRINT> for more information.
 
 B<GPRINT:>I<vname>B<:>I<format>
 
 This is the same as B<PRINT> but now it is printed inside the graph.
-See L<PRINT> for more information.
+See L<PRINT|rrdgraph/PRINT> for more information.
 
 B<COMMENT:>I<text>
 
index c1f38b3d65c8bca6248dcb21b690dd50aa58e679..0c249eb88a72cb16fe7d50ad6790fcceeb584793 100644 (file)
@@ -76,7 +76,7 @@ probable es que empieces a usar RRDtool para guardar y procesar datos
 conseguidos a través de SNMP, y que los datos
 sean el número de bytes (o bits) transferidos desde y hacia una red u
 ordenador. RRDtool te permite crear una base de datos, guardar los
-datos en ellas, recuperarlos y crear gráficos en formato GIF o PNG,
+datos en ellas, recuperarlos y crear gráficos en formato SVG o PNG,
 para mostrarlos en un navegador web. Esas imágenes dependen de los
 datos que hayas guardado y pueden, por ejemplo, ser un sumario del
 promedio de uso de la red, o los picos de tráfico que ocurrieron.
@@ -332,12 +332,12 @@ Lo que representa exactamente esta salida lo vamos m
 
 Prueba este comando:
 
- rrdtool graph speed.gif                                 \
+ rrdtool graph speed.png                                 \
          --start 920804400 --end 920808000               \
          DEF:myspeed=test.rrd:speed:AVERAGE              \
          LINE2:myspeed#FF0000
 
-Este comando crea speed.gif, un gráfico de los datos desde las
+Este comando crea speed.png, un gráfico de los datos desde las
 12:00 hasta las 13:00. Contiene una definición de la variable myspeed
 y define el color como rojo. Notarás que el gráfico no comienza
 exactamente a las 12:00 sino a las 12:05, y es porque no tenemos datos
@@ -360,10 +360,10 @@ FFFFFF; el negro es la ausencia de todos los colores: 000000.
    violeta #FF00FF     (mezcla de rojo y azul)
    gris    #555555     (un tercio de cada uno de los colores)
 
-El archivo GIF que acabas de crear puede
+El archivo PNG que acabas de crear puede
 verse con tu visor de archivos de imagen favorito. Los navegadores lo
 mostrarán usando la URL
-``file://el/camino/de/directorios/hasta/speed.gif''
+``file://el/camino/de/directorios/hasta/speed.png''
 
 =head2 Gráficos con un poco de matemática
 
@@ -384,9 +384,9 @@ Donde nos equivocamos fue en que debimos medir en metros. As
 
 Vamos a corregirlo. Podríamos recrear la base de datos con los
 valores correctos, pero hay una forma mejor: ¡haciendo los cálculos
-mientras creamos el archivo gif!
+mientras creamos el archivo png!
 
-   rrdtool graph speed2.gif                           \
+   rrdtool graph speed2.png                           \
       --start 920804400 --end 920808000               \
       --vertical-label m/s                            \
       DEF:myspeed=test.rrd:speed:AVERAGE              \
@@ -395,7 +395,7 @@ mientras creamos el archivo gif!
 
 Cuando veas esta imagen, notarás que la ``m'' ha desaparecido, y
 ahora tienes los resultados correctos. Además hemos añadido una
-etiqueta a la imagen. Apartando esto, el archivo GIF es el mismo.
+etiqueta a la imagen. Apartando esto, el archivo PNG es el mismo.
 
 Las operaciones están en la sección del CDEF
 y están escritas en Notación Polaca Inversa (Reverse Polish Notation o
@@ -418,9 +418,9 @@ Como en nuestra base de datos cometimos un error guardando los
 valores en kilómetros, debemos compensar por ello, multiplicando por
 100, por lo que al aplicar esta corrección nos queda valor * 3600.
 
-Ahora vamos a crear este gif, agreándole un poco más de magia...
+Ahora vamos a crear este png, agreándole un poco más de magia...
 
-   rrdtool graph speed3.gif                           \
+   rrdtool graph speed3.png                           \
       --start 920804400 --end 920808000               \
       --vertical-label km/h                           \
       DEF:myspeed=test.rrd:speed:AVERAGE              \
@@ -449,9 +449,9 @@ Para calcular la parte de velocidad "excesiva":
 =head2 Magia gráfica
 
 Me gusta creer que virtualmente no hay limites para lo que RRDtool puede
-hacer con los datos. No voy a explicarlo en detalle, pero mira este GIF:
+hacer con los datos. No voy a explicarlo en detalle, pero mira este PNG:
 
-   rrdtool graph speed4.gif                           \
+   rrdtool graph speed4.png                           \
       --start 920804400 --end 920808000               \
       --vertical-label km/h                           \
       DEF:myspeed=test.rrd:speed:AVERAGE              \
@@ -464,21 +464,21 @@ hacer con los datos. No voy a explicarlo en detalle, pero mira este GIF:
       AREA:fast#550000:"Too fast"                     \
       STACK:over#FF0000:"Over speed"
 
-Vamos a crear una página HTML simple para ver los tres archivos GIF:
+Vamos a crear una página HTML simple para ver los tres archivos PNG:
 
    <HTML><HEAD><TITLE>Velocidad</TITLE></HEAD><BODY>
-   <IMG src="speed2.gif" alt="Speed in meters per second">
+   <IMG src="speed2.png" alt="Speed in meters per second">
    <BR>
-   <IMG src="speed3.gif" alt="Speed in kilometers per hour">
+   <IMG src="speed3.png" alt="Speed in kilometers per hour">
    <BR>
-   <IMG src="speed4.gif" alt="Traveled too fast?">
+   <IMG src="speed4.png" alt="Traveled too fast?">
    </BODY></HTML>
 
 Guárdalo como ``speed.html'' o algo parecido, y examínalo con un navegador.
 
 Ahora, todo lo que tienes que hacer es medir los datos regularmente
 y actualizar la base de datos. Cuando quieras verlos, vuelve a crear
-los archivos GIF y asegúrate que se carguen de nuevo en tu navegador
+los archivos PNG y asegúrate que se carguen de nuevo en tu navegador
 (Nota: presionar el botón de "refrescar" puede no ser suficiente; en
 particular, Netscape tiene un problema al respecto, por lo que
 necesitaras darle al botón mientras presionas la tecla de mayúsculas.
@@ -705,7 +705,7 @@ buscar exactamente como hacerlo funcionar en tu sistema operativo.
 
 Luego, tras recoger datos por un día, crea una imagen, usando:
 
-   rrdtool graph myrouter-day.gif --start -86400 \
+   rrdtool graph myrouter-day.png --start -86400 \
             DEF:inoctets=myrouter.rrd:input:AVERAGE \
             DEF:outoctets=myrouter.rrd:output:AVERAGE \
             AREA:inoctets#00FF00:"In traffic" \
@@ -874,7 +874,7 @@ Vamos a probarlos todos:
             978303300:2400:6:600:2400  \
             978303600:2700:4:600:2700  \
             978303900:3000:2:1200:3000
-   rrdtool graph all1.gif -s 978300600 -e 978304200 -h 400 \
+   rrdtool graph all1.png -s 978300600 -e 978304200 -h 400 \
             DEF:linea=all.rrd:a:AVERAGE LINE3:linea#FF0000:"Line A" \
             DEF:lineb=all.rrd:b:AVERAGE LINE3:lineb#00FF00:"Line B" \
             DEF:linec=all.rrd:c:AVERAGE LINE3:linec#0000FF:"Line C" \
@@ -922,7 +922,7 @@ terminando a las 00:10 (las U significan desconocido).
  - Línea  C:  u  u  2  2  2  0 -2 -6  2  0  2  u
  - Línea  D:  u  1  2  3  4  5  6  7  8  9 10  u
 
-Si tu archivo GIF muestra todo esto, has
+Si tu archivo PNG muestra todo esto, has
 entrado los datos correctamente, tu programa RRDtool está funcionando
 bien, el visor de gráficos no te engaña y hemos entrado en el 2000 sin
 problemas :) Puedes probar el mismo ejemplo cuatro veces, una por cada línea.
@@ -1131,7 +1131,7 @@ tiempo entre 920805000 y 920805900.
    rrdtool update seconds2.rrd \
       920805000:000 920805300:300 920805603:603 920805900:900
 
-   rrdtool graph seconds1.gif                       \
+   rrdtool graph seconds1.png                       \
       --start 920804700 --end 920806200             \
       --height 200                                  \
       --upper-limit 1.05 --lower-limit 0.95 --rigid \
@@ -1139,7 +1139,7 @@ tiempo entre 920805000 y 920805900.
       CDEF:unknown=seconds,UN                       \
       LINE2:seconds#0000FF                          \
       AREA:unknown#FF0000
-   rrdtool graph seconds2.gif                       \
+   rrdtool graph seconds2.png                       \
       --start 920804700 --end 920806200             \
       --height 200                                  \
       --upper-limit 1.05 --lower-limit 0.95 --rigid \
index 5ab4f49bffa1f4e61e61afb1b77414499b09e840..268742e3fa98b836c1fa553cae88b0c10a276b3b 100755 (executable)
@@ -11,7 +11,7 @@ the <TT>shared-demo.pl</TT>.
 <H1>This is NOT traffic</H1>
 
 
-<P><RRD::GRAPH cgi-demo1.gif 
+<P><RRD::GRAPH cgi-demo1.png 
            --lower-limit 0
            --start 'end-10h'
            --title "Graph in Localtime <RRD::TIME::NOW %c>"
@@ -22,7 +22,7 @@ the <TT>shared-demo.pl</TT>.
 </P>
 
 <P><RRD::SETENV TZ UTC>
-   <RRD::GRAPH cgi-demo2.gif 
+   <RRD::GRAPH cgi-demo2.png 
            --lower-limit 0
            --start 'end-10h'
            --title "Graph in UTC"
index 4dd3e9473263d1a49832d2baa439e745c4bb9809..9ec15872e663d52cb2d4a2e94019b5549b99b296 100755 (executable)
@@ -11,7 +11,7 @@ the <TT>shared-demo.pl</TT>.
 <H1>This is NOT traffic</H1>
 
 
-<P><RRD::GRAPH cgi-demo1.gif 
+<P><RRD::GRAPH cgi-demo1.png 
            --lower-limit 0
            --start 'end-10h'
            --title "Graph in Localtime <RRD::TIME::NOW %c>"
@@ -22,7 +22,7 @@ the <TT>shared-demo.pl</TT>.
 </P>
 
 <P><RRD::SETENV TZ UTC>
-   <RRD::GRAPH cgi-demo2.gif 
+   <RRD::GRAPH cgi-demo2.png 
            --lower-limit 0
            --start 'end-10h'
            --title "Graph in UTC"
index 561d9267d3babd16c684e6aea311fff67b58b55d..2dbbcc413884e2328093826dc62b9f702e46b328 100755 (executable)
@@ -1,4 +1,4 @@
-#! /bin/perl 
+#! /usr/bin/perl 
 
 #makes things work when run without install
 use lib qw( ../bindings/perl-piped/blib/lib  ../lib/perl );
@@ -16,7 +16,7 @@ $STEP = 300;
 $RUNS = 12*24*30*6;
 $GRUNS = 20;
 $RRD = "piped-demo.rrd";
-$GIF = "piped-demo.gif";
+$SVG = "piped-demo.svg";
 $PNG = "piped-demo.png";
 
 # some magic to find the correct rrdtol executable
@@ -67,11 +67,11 @@ printf "-- performance analysis Update test\n".
 print "\n";
 # creating some graphs
 
-print "* Creating $GRUNS GIF graphs: $GIF\n\n";
+print "* Creating $GRUNS SVG graphs: $SVG\n\n";
 $now = time;
 for ($i=0;$i<$GRUNS;$i++) {
-RRDp::cmd "graph $GIF ", "--title 'Test GRAPH' ",
-       "--height 150 --vertical-label 'Dummy Units' ".
+RRDp::cmd "graph $SVG ", "--title 'Test GRAPH' ",
+       "--imgformat SVG --height 150 --vertical-label 'Dummy Units' ".
        "--start now".(-$RUNS*$STEP),
        "--color ARROW#bfbfbf",
         "DEF:alpha=$RRD:in:AVERAGE",
index 6021f5d47605cfa85a82412a04ded015ab55ec80..41005d85925d81790ad1ca5755a061eab24b488b 100755 (executable)
@@ -16,7 +16,7 @@ $STEP = 300;
 $RUNS = 12*24*30*6;
 $GRUNS = 20;
 $RRD = "piped-demo.rrd";
-$GIF = "piped-demo.gif";
+$SVG = "piped-demo.svg";
 $PNG = "piped-demo.png";
 
 # some magic to find the correct rrdtol executable
@@ -67,11 +67,11 @@ printf "-- performance analysis Update test\n".
 print "\n";
 # creating some graphs
 
-print "* Creating $GRUNS GIF graphs: $GIF\n\n";
+print "* Creating $GRUNS SVG graphs: $SVG\n\n";
 $now = time;
 for ($i=0;$i<$GRUNS;$i++) {
-RRDp::cmd "graph $GIF ", "--title 'Test GRAPH' ",
-       "--height 150 --vertical-label 'Dummy Units' ".
+RRDp::cmd "graph $SVG ", "--title 'Test GRAPH' ",
+       "--imgformat SVG --height 150 --vertical-label 'Dummy Units' ".
        "--start now".(-$RUNS*$STEP),
        "--color ARROW#bfbfbf",
         "DEF:alpha=$RRD:in:AVERAGE",
index 437d4639ec3f7eca5e03635e00c70eac1002cdf2..42d03dcf9df46d386d16f40129c8851cc8f9c980 100755 (executable)
@@ -1,4 +1,4 @@
-#! /bin/perl 
+#! /usr/bin/perl 
 
 
 END {
@@ -36,8 +36,8 @@ my $RUNS  = 500;
 my $GRUNS = 4;
 my $RRD1  = "shared-demo.rrd";
 my $RRD2  = "shared-demob.rrd";
-my $GIF1  = "shared-demo1.gif";
-my $GIF2  = "shared-demo2.gif";
+my $PNG1  = "shared-demo1.png";
+my $PNG2  = "shared-demo2.png";
 my $time  = 30*int(time/30);
 my $START = $time-$RUNS*$STEP;
 
@@ -109,18 +109,18 @@ if ($ERROR = RRDs::error) {
   die "$0: unable to update `$RRD2': $ERROR\n";
 }
 
-print "* Creating $GRUNS graphs: $GIF1 & $GIF2\n\n";
+print "* Creating $GRUNS graphs: $PNG1 & $PNG2\n\n";
 my $now = $time;
 for (my $i=0;$i<$GRUNS;$i++) {
-  my @rrd_gifs = ($RRD1, $GIF1, $RRD2, $GIF2);
-  while (@rrd_gifs) {
-    my $RRD = shift(@rrd_gifs);
-    my $GIF = shift(@rrd_gifs);
-    my ($graphret,$xs,$ys) = RRDs::graph $GIF, "--title", 'Test GRAPH', 
+  my @rrd_pngs = ($RRD1, $PNG1, $RRD2, $PNG2);
+  while (@rrd_pngs) {
+    my $RRD = shift(@rrd_pngs);
+    my $PNG = shift(@rrd_pngs);
+    my ($graphret,$xs,$ys) = RRDs::graph $PNG, "--title", 'Test GRAPH', 
     '--base', '1024',
           "--vertical-label", 'Dummy Units', "--start", (-$RUNS*$STEP),
           "--end", $time,
-         "--interlace", "--imgformat","GIF",
+         "--interlace", "--imgformat","PNG",
           "DEF:alpha=$RRD:a:AVERAGE",
           "DEF:beta=$RRD:b:AVERAGE",
           "DEF:gamma=$RRD:c:AVERAGE",
@@ -147,7 +147,7 @@ for (my $i=0;$i<$GRUNS;$i++) {
     if ($ERROR = RRDs::error) {
       print "ERROR: $ERROR\n";
     } else {
-      print "GIF Size: ${xs}x${ys}\n";
+      print "Image Size: ${xs}x${ys}\n";
       print "Graph Return:\n",(join "\n", @$graphret),"\n\n";
     }
   }
index fafb4e0b0cc94ba633f2f2c1cc82cc7bc1515de8..61df205225161e37a7766a6095abe69e33ccc491 100755 (executable)
@@ -36,8 +36,8 @@ my $RUNS  = 500;
 my $GRUNS = 4;
 my $RRD1  = "shared-demo.rrd";
 my $RRD2  = "shared-demob.rrd";
-my $GIF1  = "shared-demo1.gif";
-my $GIF2  = "shared-demo2.gif";
+my $PNG1  = "shared-demo1.png";
+my $PNG2  = "shared-demo2.png";
 my $time  = 30*int(time/30);
 my $START = $time-$RUNS*$STEP;
 
@@ -109,18 +109,18 @@ if ($ERROR = RRDs::error) {
   die "$0: unable to update `$RRD2': $ERROR\n";
 }
 
-print "* Creating $GRUNS graphs: $GIF1 & $GIF2\n\n";
+print "* Creating $GRUNS graphs: $PNG1 & $PNG2\n\n";
 my $now = $time;
 for (my $i=0;$i<$GRUNS;$i++) {
-  my @rrd_gifs = ($RRD1, $GIF1, $RRD2, $GIF2);
-  while (@rrd_gifs) {
-    my $RRD = shift(@rrd_gifs);
-    my $GIF = shift(@rrd_gifs);
-    my ($graphret,$xs,$ys) = RRDs::graph $GIF, "--title", 'Test GRAPH', 
+  my @rrd_pngs = ($RRD1, $PNG1, $RRD2, $PNG2);
+  while (@rrd_pngs) {
+    my $RRD = shift(@rrd_pngs);
+    my $PNG = shift(@rrd_pngs);
+    my ($graphret,$xs,$ys) = RRDs::graph $PNG, "--title", 'Test GRAPH', 
     '--base', '1024',
           "--vertical-label", 'Dummy Units', "--start", (-$RUNS*$STEP),
           "--end", $time,
-         "--interlace", "--imgformat","GIF",
+         "--interlace", "--imgformat","PNG",
           "DEF:alpha=$RRD:a:AVERAGE",
           "DEF:beta=$RRD:b:AVERAGE",
           "DEF:gamma=$RRD:c:AVERAGE",
@@ -147,7 +147,7 @@ for (my $i=0;$i<$GRUNS;$i++) {
     if ($ERROR = RRDs::error) {
       print "ERROR: $ERROR\n";
     } else {
-      print "GIF Size: ${xs}x${ys}\n";
+      print "Image Size: ${xs}x${ys}\n";
       print "Graph Return:\n",(join "\n", @$graphret),"\n\n";
     }
   }
index f6a5908c4ec5f5ae695057bbc7f6f13fe4e255a4..9c81c1543cae8d00df10b29d273a303a2ba1baec 100644 (file)
@@ -253,6 +253,7 @@ char* includefile(long argc, char **args){
   }
 }
 
+static
 char* rrdstrip(char *buf){
   char *start;
   if (buf == NULL) return NULL;
@@ -442,6 +443,7 @@ char* printtimenow(long argc, char **args) {
 }
 
 /* scan aLine until an unescaped '>' arives */
+static
 char* scanargs(char *aLine, long *argc, char ***args)
 {
   char        *getP, *putP;
index bd84706dab17c45510b00caf2c1c6cb9db5b5dab..e5653b5d62ab5aeb0d90c649048ed404e0fca0da 100644 (file)
@@ -64,15 +64,15 @@ gfx_canvas_t *gfx_new_canvas (void) {
 
 /* create a new line */
 gfx_node_t  *gfx_new_line(gfx_canvas_t *canvas, 
-                          double x0, double y0, 
-                          double x1, double y1,
+                          double X0, double Y0, 
+                          double X1, double Y1,
                           double width, gfx_color_t color){
-  return gfx_new_dashed_line(canvas, x0, y0, x1, y1, width, color, 0, 0);
+  return gfx_new_dashed_line(canvas, X0, Y0, X1, Y1, width, color, 0, 0);
 }
 
 gfx_node_t  *gfx_new_dashed_line(gfx_canvas_t *canvas, 
-                          double x0, double y0, 
-                          double x1, double y1,
+                          double X0, double Y0, 
+                          double X1, double Y1,
                           double width, gfx_color_t color,
                           double dash_on, double dash_off){
 
@@ -82,8 +82,8 @@ gfx_node_t  *gfx_new_dashed_line(gfx_canvas_t *canvas,
   if (node == NULL) return NULL;
   vec = art_new(ArtVpath, 3);
   if (vec == NULL) return NULL;
-  vec[0].code = ART_MOVETO_OPEN; vec[0].x=x0+LINEOFFSET; vec[0].y=y0+LINEOFFSET;
-  vec[1].code = ART_LINETO; vec[1].x=x1+LINEOFFSET; vec[1].y=y1+LINEOFFSET;
+  vec[0].code = ART_MOVETO_OPEN; vec[0].x=X0+LINEOFFSET; vec[0].y=Y0+LINEOFFSET;
+  vec[1].code = ART_LINETO; vec[1].x=X1+LINEOFFSET; vec[1].y=Y1+LINEOFFSET;
   vec[2].code = ART_END;
   
   node->points = 3;
@@ -98,9 +98,9 @@ gfx_node_t  *gfx_new_dashed_line(gfx_canvas_t *canvas,
 
 /* create a new area */
 gfx_node_t   *gfx_new_area   (gfx_canvas_t *canvas, 
-                             double x0, double y0,
-                             double x1, double y1,
-                             double x2, double y2,
+                             double X0, double Y0,
+                             double X1, double Y1,
+                             double X2, double Y2,
                              gfx_color_t color) {
 
   gfx_node_t *node;
@@ -109,10 +109,10 @@ gfx_node_t   *gfx_new_area   (gfx_canvas_t *canvas,
   if (node == NULL) return NULL;
   vec = art_new(ArtVpath, 5);
   if (vec == NULL) return NULL;
-  vec[0].code = ART_MOVETO; vec[0].x=x0; vec[0].y=y0;
-  vec[1].code = ART_LINETO; vec[1].x=x1; vec[1].y=y1;
-  vec[2].code = ART_LINETO; vec[2].x=x2; vec[2].y=y2;
-  vec[3].code = ART_LINETO; vec[3].x=x0; vec[3].y=y0;
+  vec[0].code = ART_MOVETO; vec[0].x=X0; vec[0].y=Y0;
+  vec[1].code = ART_LINETO; vec[1].x=X1; vec[1].y=Y1;
+  vec[2].code = ART_LINETO; vec[2].x=X2; vec[2].y=Y2;
+  vec[3].code = ART_LINETO; vec[3].x=X0; vec[3].y=Y0;
   vec[4].code = ART_END;
   
   node->points = 5;
@@ -128,8 +128,8 @@ int           gfx_add_point  (gfx_node_t *node,
                              double x, double y){
   if (node == NULL) return 1;
   if (node->type == GFX_AREA) {
-    double x0 = node->path[0].x;
-    double y0 = node->path[0].y;
+    double X0 = node->path[0].x;
+    double Y0 = node->path[0].y;
     node->points -= 2;
     art_vpath_add_point (&(node->path),
                          &(node->points),
@@ -140,7 +140,7 @@ int           gfx_add_point  (gfx_node_t *node,
                          &(node->points),
                          &(node->points_max),
                          ART_LINETO,
-                         x0,y0);
+                         X0,Y0);
     art_vpath_add_point (&(node->path),
                          &(node->points),
                          &(node->points_max),
@@ -384,12 +384,14 @@ int           gfx_render_png (gfx_canvas_t *canvas,
             case GFX_H_RIGHT:  pen_x -= text_width; break;
             case GFX_H_CENTER: pen_x -= text_width / 2.0; break;          
             case GFX_H_LEFT: break;          
+            case GFX_H_NULL: break;          
             }
 
             switch(node->valign){
             case GFX_V_TOP:    pen_y += text_height; break;
             case GFX_V_CENTER: pen_y += text_height / 2.0; break;          
             case GFX_V_BOTTOM: break;          
+            case GFX_V_NULL: break;          
             }
 
             glyph_index=0;
index ed107cb0188ecd62f6816bee6c121c8086ad15be..d2cb97d5eb732ed9dd5c3f89ea8ac37395494c9c 100644 (file)
@@ -50,21 +50,21 @@ gfx_canvas_t *gfx_new_canvas (void);
 
 /* create a new line */
 gfx_node_t   *gfx_new_line   (gfx_canvas_t *canvas, 
-                             double x0, double y0, 
-                             double x1, double y1,
+                             double X0, double Y0, 
+                             double X1, double Y1,
                              double width, gfx_color_t color);
 
 gfx_node_t   *gfx_new_dashed_line   (gfx_canvas_t *canvas, 
-                             double x0, double y0, 
-                             double x1, double y1,
+                             double X0, double Y0, 
+                             double X1, double Y1,
                              double width, gfx_color_t color,
                              double dash_on, double dash_off);
 
 /* create a new area */
 gfx_node_t   *gfx_new_area   (gfx_canvas_t *canvas, 
-                             double x0, double y0,
-                             double x1, double y1,
-                             double x2, double y2,
+                             double X0, double Y0,
+                             double X1, double Y1,
+                             double X2, double Y2,
                              gfx_color_t  color);
 
 /* add a point to a line or to an area */
index bfce36f1477f872044b567e2c168c06b65a1bd05..5f5ab2740a06d61f031f04e36c911be4657fc5ec 100644 (file)
@@ -12,7 +12,6 @@
 #ifdef WIN32
 #include <io.h>
 #include <fcntl.h>
-#define RRD_DEFAULT_FONT "c:/winnt/fonts/COUR.TTF"
 #endif
 
 #include "rrd_graph.h"
@@ -1220,7 +1219,6 @@ print_calc(image_desc_t *im, char ***prdata)
            }
            }
            break;
-        case GF_COMMENT:
        case GF_LINE:
        case GF_AREA:
        case GF_TICK:
@@ -1229,6 +1227,7 @@ print_calc(image_desc_t *im, char ***prdata)
        case GF_VRULE:
            graphelement = 1;
            break;
+        case GF_COMMENT:
        case GF_DEF:
        case GF_CDEF:       
        case GF_VDEF:       
@@ -1250,7 +1249,7 @@ leg_place(image_desc_t *im)
     int   border = im->text_prop[TEXT_PROP_LEGEND].size*2.0;
     int   fill=0, fill_last;
     int   leg_c = 0;
-    int   leg_x = border, leg_y = im->ygif;
+    int   leg_x = border, leg_y = im->yimg;
     int   leg_cc;
     int   glue = 0;
     int   i,ii, mark = 0;
@@ -1311,7 +1310,7 @@ leg_place(image_desc_t *im)
            if (i == im->gdes_c -1 ) prt_fctn ='l';
            
            /* is it time to place the legends ? */
-           if (fill > im->xgif - 2*border){
+           if (fill > im->ximg - 2*border){
                if (leg_c > 1) {
                    /* go back one */
                    i--; 
@@ -1329,12 +1328,12 @@ leg_place(image_desc_t *im)
        if (prt_fctn != '\0'){
            leg_x = border;
            if (leg_c >= 2 && prt_fctn == 'j') {
-               glue = (im->xgif - fill - 2* border) / (leg_c-1);
+               glue = (im->ximg - fill - 2* border) / (leg_c-1);
            } else {
                glue = 0;
            }
-           if (prt_fctn =='c') leg_x =  (im->xgif - fill) / 2.0;
-           if (prt_fctn =='r') leg_x =  im->xgif - fill - border;
+           if (prt_fctn =='c') leg_x =  (im->ximg - fill) / 2.0;
+           if (prt_fctn =='r') leg_x =  im->ximg - fill - border;
 
            for(ii=mark;ii<=i;ii++){
                if(im->gdes[ii].legend[0]=='\0')
@@ -1360,7 +1359,7 @@ leg_place(image_desc_t *im)
            mark = ii;
        }          
     }
-    im->ygif = leg_y;
+    im->yimg = leg_y;
     free(legspace);
   }
   return 0;
@@ -1384,7 +1383,7 @@ horizontal_grid(image_desc_t   *im)
     double   gridstep;
     double   scaledstep;
     char     graph_label[100];
-    double   x0,x1,y0;
+    double   X0,X1,Y0;
     int      labfact,gridind;
     int      decimals, fractionals;
     char     labfmt[64];
@@ -1455,16 +1454,16 @@ horizontal_grid(image_desc_t   *im)
        labfact = im->ylabfact;
     }
     
-   x0=im->xorigin;
-   x1=im->xorigin+im->xsize;
+   X0=im->xorigin;
+   X1=im->xorigin+im->xsize;
    
     sgrid = (int)( im->minval / gridstep - 1);
     egrid = (int)( im->maxval / gridstep + 1);
     scaledstep = gridstep/im->magfact;
     for (i = sgrid; i <= egrid; i++){
-       y0=ytr(im,gridstep*i);
-       if ( y0 >= im->yorigin-im->ysize
-                && y0 <= im->yorigin){       
+       Y0=ytr(im,gridstep*i);
+       if ( Y0 >= im->yorigin-im->ysize
+                && Y0 <= im->yorigin){       
            if(i % labfact == 0){               
                if (i==0 || im->symbol == ' ') {
                    if(scaledstep < 1){
@@ -1486,21 +1485,21 @@ horizontal_grid(image_desc_t   *im)
                }
 
               gfx_new_text ( im->canvas,
-                             x0-im->text_prop[TEXT_PROP_AXIS].size/1.5, y0,
+                             X0-im->text_prop[TEXT_PROP_AXIS].size/1.5, Y0,
                              im->graph_col[GRC_FONT],
                              im->text_prop[TEXT_PROP_AXIS].font,
                              im->text_prop[TEXT_PROP_AXIS].size,
                              im->tabwidth, 0.0, GFX_H_RIGHT, GFX_V_CENTER,
                              graph_label );
               gfx_new_line ( im->canvas,
-                             x0-2,y0,
-                             x1+2,y0,
+                             X0-2,Y0,
+                             X1+2,Y0,
                              MGRIDWIDTH, im->graph_col[GRC_MGRID] );          
               
            } else {            
               gfx_new_line ( im->canvas,
-                             x0-1,y0,
-                             x1+1,y0,
+                             X0-1,Y0,
+                             X1+1,Y0,
                              GRIDWIDTH, im->graph_col[GRC_GRID] );            
               
            }       
@@ -1517,7 +1516,7 @@ horizontal_log_grid(image_desc_t   *im)
     int      ii,i;
     int      minoridx=0, majoridx=0;
     char     graph_label[100];
-    double   x0,x1,y0;   
+    double   X0,X1,Y0;   
     double   value, pixperstep, minstep;
 
     /* find grid spaceing */
@@ -1540,8 +1539,8 @@ horizontal_log_grid(image_desc_t   *im)
        if(pixperstep > 2 *  im->text_prop[TEXT_PROP_LEGEND].size){majoridx = i;}
     }
    
-   x0=im->xorigin;
-   x1=im->xorigin+im->xsize;
+   X0=im->xorigin;
+   X1=im->xorigin+im->xsize;
     /* paint minor grid */
     for (value = pow((double)10, log10(im->minval) 
                          - fmod(log10(im->minval),log10(yloglab[minoridx][0])));
@@ -1550,11 +1549,11 @@ horizontal_log_grid(image_desc_t   *im)
        if (value < im->minval) continue;
        i=0;    
        while(yloglab[minoridx][++i] > 0){          
-          y0 = ytr(im,value * yloglab[minoridx][i]);
-          if (y0 <= im->yorigin - im->ysize) break;
+          Y0 = ytr(im,value * yloglab[minoridx][i]);
+          if (Y0 <= im->yorigin - im->ysize) break;
           gfx_new_line ( im->canvas,
-                         x0-1,y0,
-                         x1+1,y0,
+                         X0-1,Y0,
+                         X1+1,Y0,
                          GRIDWIDTH, im->graph_col[GRC_GRID] );
        }
     }
@@ -1567,16 +1566,16 @@ horizontal_log_grid(image_desc_t   *im)
        if (value < im->minval) continue;
        i=0;    
        while(yloglab[majoridx][++i] > 0){          
-          y0 = ytr(im,value * yloglab[majoridx][i]);    
-          if (y0 <= im->yorigin - im->ysize) break;
+          Y0 = ytr(im,value * yloglab[majoridx][i]);    
+          if (Y0 <= im->yorigin - im->ysize) break;
           gfx_new_line ( im->canvas,
-                         x0-2,y0,
-                         x1+2,y0,
+                         X0-2,Y0,
+                         X1+2,Y0,
                          MGRIDWIDTH, im->graph_col[GRC_MGRID] );
           
           sprintf(graph_label,"%3.0e",value * yloglab[majoridx][i]);
           gfx_new_text ( im->canvas,
-                         x0-im->text_prop[TEXT_PROP_AXIS].size/1.5, y0,
+                         X0-im->text_prop[TEXT_PROP_AXIS].size/1.5, Y0,
                          im->graph_col[GRC_FONT],
                          im->text_prop[TEXT_PROP_AXIS].font,
                          im->text_prop[TEXT_PROP_AXIS].size,
@@ -1596,7 +1595,7 @@ vertical_grid(
     time_t ti, tilab;
     long factor;
     char graph_label[100];
-    double x0,y0,y1; /* points for filled graph and more*/
+    double X0,Y0,Y1; /* points for filled graph and more*/
    
 
     /* the type of time grid is determined by finding
@@ -1619,8 +1618,8 @@ vertical_grid(
     }
     
     /* y coords are the same for every line ... */
-    y0 = im->yorigin;
-    y1 = im->yorigin-im->ysize;
+    Y0 = im->yorigin;
+    Y1 = im->yorigin-im->ysize;
    
 
     /* paint the minor grid */
@@ -1632,8 +1631,8 @@ vertical_grid(
        ){
        /* are we inside the graph ? */
        if (ti < im->start || ti > im->end) continue;
-       x0 = xtr(im,ti);       
-       gfx_new_line(im->canvas,x0,y0+1, x0,y1-1,GRIDWIDTH, im->graph_col[GRC_GRID]);
+       X0 = xtr(im,ti);       
+       gfx_new_line(im->canvas,X0,Y0+1, X0,Y1-1,GRIDWIDTH, im->graph_col[GRC_GRID]);
        
     }
 
@@ -1646,8 +1645,8 @@ vertical_grid(
        ){
        /* are we inside the graph ? */
        if (ti < im->start || ti > im->end) continue;
-       x0 = xtr(im,ti);
-       gfx_new_line(im->canvas,x0,y0+2, x0,y1-2,MGRIDWIDTH, im->graph_col[GRC_MGRID]);
+       X0 = xtr(im,ti);
+       gfx_new_line(im->canvas,X0,Y0+2, X0,Y1-2,MGRIDWIDTH, im->graph_col[GRC_MGRID]);
        
     }
     /* paint the labels below the graph */
@@ -1667,7 +1666,7 @@ vertical_grid(
 # error "your libc has no strftime I guess we'll abort the exercise here."
 #endif
        gfx_new_text ( im->canvas,
-                     xtr(im,tilab), y0+im->text_prop[TEXT_PROP_AXIS].size/1.5,
+                     xtr(im,tilab), Y0+im->text_prop[TEXT_PROP_AXIS].size/1.5,
                      im->graph_col[GRC_FONT],
                      im->text_prop[TEXT_PROP_AXIS].font,
                      im->text_prop[TEXT_PROP_AXIS].size,
@@ -1706,7 +1705,7 @@ axis_paint(
     gfx_new_area ( im->canvas, 
                   im->xorigin+im->xsize+3,  im->yorigin-3,
                   im->xorigin+im->xsize+3,  im->yorigin+4,
-                  im->xorigin+im->xsize+8,  im->yorigin+0.5,   // LINEOFFSET
+                  im->xorigin+im->xsize+8,  im->yorigin+0.5, /* LINEOFFSET */
                   im->graph_col[GRC_ARROW]);
    
    
@@ -1718,26 +1717,26 @@ grid_paint(image_desc_t   *im)
 {   
     long i;
     int res=0;
-    double x0,y0; /* points for filled graph and more*/
+    double X0,Y0; /* points for filled graph and more*/
     gfx_node_t *node;
 
     /* draw 3d border */
-    node = gfx_new_area (im->canvas, 0,im->ygif,
-                                 2,im->ygif-2,
+    node = gfx_new_area (im->canvas, 0,im->yimg,
+                                 2,im->yimg-2,
                                  2,2,im->graph_col[GRC_SHADEA]);
-    gfx_add_point( node , im->xgif - 2, 2 );
-    gfx_add_point( node , im->xgif, 0 );
+    gfx_add_point( node , im->ximg - 2, 2 );
+    gfx_add_point( node , im->ximg, 0 );
     gfx_add_point( node , 0,0 );
-/*    gfx_add_point( node , 0,im->ygif ); */
+/*    gfx_add_point( node , 0,im->yimg ); */
    
-    node =  gfx_new_area (im->canvas, 2,im->ygif-2,
-                                  im->xgif-2,im->ygif-2,
-                                  im->xgif - 2, 2,
+    node =  gfx_new_area (im->canvas, 2,im->yimg-2,
+                                  im->ximg-2,im->yimg-2,
+                                  im->ximg - 2, 2,
                                  im->graph_col[GRC_SHADEB]);
-    gfx_add_point( node ,   im->xgif,0);
-    gfx_add_point( node ,   im->xgif,im->ygif);
-    gfx_add_point( node ,   0,im->ygif);
-/*    gfx_add_point( node , 0,im->ygif ); */
+    gfx_add_point( node ,   im->ximg,0);
+    gfx_add_point( node ,   im->ximg,im->yimg);
+    gfx_add_point( node ,   0,im->yimg);
+/*    gfx_add_point( node , 0,im->yimg ); */
    
    
     if (im->draw_x_grid == 1 )
@@ -1753,7 +1752,7 @@ grid_paint(image_desc_t   *im)
        /* dont draw horizontal grid if there is no min and max val */
        if (! res ) {
          char *nodata = "No Data found";
-          gfx_new_text(im->canvas,im->xgif/2, (2*im->yorigin-im->ysize) / 2,
+          gfx_new_text(im->canvas,im->ximg/2, (2*im->yorigin-im->ysize) / 2,
                        im->graph_col[GRC_FONT],
                        im->text_prop[TEXT_PROP_AXIS].font,
                        im->text_prop[TEXT_PROP_AXIS].size,
@@ -1792,7 +1791,7 @@ grid_paint(image_desc_t   *im)
    
     /* graph title */
     gfx_new_text( im->canvas,
-                 im->xgif/2, im->text_prop[TEXT_PROP_TITLE].size,
+                 im->ximg/2, im->text_prop[TEXT_PROP_TITLE].size,
                  im->graph_col[GRC_FONT],
                  im->text_prop[TEXT_PROP_TITLE].font,
                  im->text_prop[TEXT_PROP_TITLE].size, im->tabwidth, 0.0,
@@ -1806,8 +1805,8 @@ grid_paint(image_desc_t   *im)
            continue;
         
        /* im->gdes[i].leg_y is the bottom of the legend */
-               x0 = im->gdes[i].leg_x;
-               y0 = im->gdes[i].leg_y;
+               X0 = im->gdes[i].leg_x;
+               Y0 = im->gdes[i].leg_y;
                /* Box needed? */
                if (       im->gdes[i].gf != GF_GPRINT
                        && im->gdes[i].gf != GF_COMMENT) {
@@ -1820,20 +1819,20 @@ grid_paint(image_desc_t   *im)
                    boxV = boxH;
 
                    node = gfx_new_area(im->canvas,
-                               x0,y0-boxV,
-                               x0,y0,
-                               x0+boxH,y0,
+                               X0,Y0-boxV,
+                               X0,Y0,
+                               X0+boxH,Y0,
                                im->gdes[i].col);
-                   gfx_add_point ( node, x0+boxH, y0-boxV );
+                   gfx_add_point ( node, X0+boxH, Y0-boxV );
                    node = gfx_new_line(im->canvas,
-                               x0,y0-boxV, x0,y0,
+                               X0,Y0-boxV, X0,Y0,
                                1,0x000000FF);
-                   gfx_add_point(node,x0+boxH,y0);
-                   gfx_add_point(node,x0+boxH,y0-boxV);
+                   gfx_add_point(node,X0+boxH,Y0);
+                   gfx_add_point(node,X0+boxH,Y0-boxV);
                    gfx_close_path(node);
-                   x0 += boxH / 1.25 * 2;
+                   X0 += boxH / 1.25 * 2;
                }
-               gfx_new_text ( im->canvas, x0, y0,
+               gfx_new_text ( im->canvas, X0, Y0,
                                   im->graph_col[GRC_FONT],
                                   im->text_prop[TEXT_PROP_AXIS].font,
                                   im->text_prop[TEXT_PROP_AXIS].size,
@@ -1851,21 +1850,21 @@ grid_paint(image_desc_t   *im)
 int lazy_check(image_desc_t *im){
     FILE *fd = NULL;
        int size = 1;
-    struct stat  gifstat;
+    struct stat  imgstat;
     
     if (im->lazy == 0) return 0; /* no lazy option */
-    if (stat(im->graphfile,&gifstat) != 0) 
+    if (stat(im->graphfile,&imgstat) != 0) 
       return 0; /* can't stat */
     /* one pixel in the existing graph is more then what we would
        change here ... */
-    if (time(NULL) - gifstat.st_mtime > 
+    if (time(NULL) - imgstat.st_mtime > 
        (im->end - im->start) / im->xsize) 
       return 0;
     if ((fd = fopen(im->graphfile,"rb")) == NULL) 
       return 0; /* the file does not exist */
     switch (im->canvas->imgformat) {
     case IF_PNG:
-          size = PngSize(fd,&(im->xgif),&(im->ygif));
+          size = PngSize(fd,&(im->ximg),&(im->yimg));
           break;
     default:
           size = 1;
@@ -1949,7 +1948,9 @@ graph_size_location(image_desc_t *im, int elements, int piechart )
        Xmain    =0,    Ymain    =0,
        Xpie     =0,    Ypie     =0,
        Xxlabel  =0,    Yxlabel  =0,
+#if 0
        Xlegend  =0,    Ylegend  =0,
+#endif
        Xspacing =10,   Yspacing =10;
 
     if (im->ylegend[0] != '\0') {
@@ -2000,13 +2001,13 @@ graph_size_location(image_desc_t *im, int elements, int piechart )
     ** forget about it at all; the legend will have to fit in the
     ** size already allocated.
     */
-    im->xgif = Xylabel + Xmain + Xpie + Xspacing;
-    if (Xmain) im->xgif += Xspacing;
-    if (Xpie) im->xgif += Xspacing;
+    im->ximg = Xylabel + Xmain + Xpie + Xspacing;
+    if (Xmain) im->ximg += Xspacing;
+    if (Xpie) im->ximg += Xspacing;
     im->xorigin = Xspacing + Xylabel;
-    if (Xtitle > im->xgif) im->xgif = Xtitle;
+    if (Xtitle > im->ximg) im->ximg = Xtitle;
     if (Xvertical) {
-       im->xgif += Xvertical;
+       im->ximg += Xvertical;
        im->xorigin += Xvertical;
     }
     xtr(im,0);
@@ -2021,33 +2022,33 @@ graph_size_location(image_desc_t *im, int elements, int piechart )
     */
 
     /* reserve space for main and/or pie */
-    im->ygif = Ymain + Yxlabel;
-    if (im->ygif < Ypie) im->ygif = Ypie;
-    im->yorigin = im->ygif - Yxlabel;
+    im->yimg = Ymain + Yxlabel;
+    if (im->yimg < Ypie) im->yimg = Ypie;
+    im->yorigin = im->yimg - Yxlabel;
     /* reserve space for the title *or* some padding above the graph */
     if (Ytitle) {
-       im->ygif += Ytitle;
+       im->yimg += Ytitle;
        im->yorigin += Ytitle;
     } else {
-       im->ygif += Yspacing;
+       im->yimg += Yspacing;
        im->yorigin += Yspacing;
     }
     /* reserve space for padding below the graph */
-    im->ygif += Yspacing;
+    im->yimg += Yspacing;
     ytr(im,DNAN);
 
     /* Determine where to place the legends onto the image.
-    ** Adjust im->ygif to match the space requirements.
+    ** Adjust im->yimg to match the space requirements.
     */
     if(leg_place(im)==-1)
        return -1;
 
     /* last of three steps: check total height of image */
-    if (im->ygif < Yvertical) im->ygif = Yvertical;
+    if (im->yimg < Yvertical) im->yimg = Yvertical;
 
 #if 0
-    if (Xlegend > im->xgif) {
-       im->xgif = Xlegend;
+    if (Xlegend > im->ximg) {
+       im->ximg = Xlegend;
        /* reposition Pie */
 #endif
 
@@ -2056,10 +2057,10 @@ graph_size_location(image_desc_t *im, int elements, int piechart )
     ** padding.
     */
     if (elements) {
-       im->pie_x = im->xgif - Xspacing - Xpie/2;
+       im->pie_x = im->ximg - Xspacing - Xpie/2;
         im->pie_y = im->yorigin-Ymain+Ypie/2;
     } else {
-       im->pie_x = im->xgif/2;
+       im->pie_x = im->ximg/2;
         im->pie_y = im->yorigin-Ypie/2;
     }
 
@@ -2135,11 +2136,11 @@ graph_paint(image_desc_t *im, char ***calcpr)
   
   node=gfx_new_area ( im->canvas,
                       0, 0,
-                      im->xgif, 0,
-                      im->xgif, im->ygif,
+                      im->ximg, 0,
+                      im->ximg, im->yimg,
                       im->graph_col[GRC_BACK]);
 
-  gfx_add_point(node,0, im->ygif);
+  gfx_add_point(node,0, im->yimg);
 
   if (piechart != 2) {
     node=gfx_new_area ( im->canvas,
@@ -2347,7 +2348,7 @@ graph_paint(image_desc_t *im, char ***calcpr)
       return (-1);
     }
   }
-  gfx_render (im->canvas,im->xgif,im->ygif,0x0,fo);
+  gfx_render (im->canvas,im->ximg,im->yimg,0x0,fo);
   if (strcmp(im->graphfile,"-") != 0)
     fclose(fo);
   return 0;
@@ -2455,8 +2456,8 @@ rrd_graph(int argc, char **argv, char ***prdata, int *xsize, int *ysize)
     ** Also, if needed, print a line with information about the image.
     */
 
-    *xsize=im.xgif;
-    *ysize=im.ygif;
+    *xsize=im.ximg;
+    *ysize=im.yimg;
     if (im.imginfo) {
        char *filename;
        if (!(*prdata)) {
@@ -2477,7 +2478,7 @@ rrd_graph(int argc, char **argv, char ***prdata, int *xsize, int *ysize)
            filename--;
        }
 
-       sprintf((*prdata)[0],im.imginfo,filename,(long)(im.canvas->zoom*im.xgif),(long)(im.canvas->zoom*im.ygif));
+       sprintf((*prdata)[0],im.imginfo,filename,(long)(im.canvas->zoom*im.ximg),(long)(im.canvas->zoom*im.yimg));
     }
     im_free(&im);
     return 0;
@@ -2489,8 +2490,8 @@ rrd_graph_init(image_desc_t *im)
     int i;
 
     im->xlab_user.minsec = -1;
-    im->xgif=0;
-    im->ygif=0;
+    im->ximg=0;
+    im->yimg=0;
     im->xsize = 400;
     im->ysize = 100;
     im->step = 0;
index 3abb1547baf4128c3f403ff863cca31f516710aa..de73a72037179f18cbe8acb6edb02daf814af501 100644 (file)
@@ -136,15 +136,16 @@ typedef struct image_desc_t {
                                      values outside */
     char*          imginfo;        /* construct an <IMG ... tag and return 
                                      as first retval */
-    int            lazy;           /* only update the gif if there is reasonable
-                                     probablility that the existing one is out of date */
+    int            lazy;           /* only update the image if there is
+                                     reasonable probablility that the
+                                     existing one is out of date */
     int            logarithmic;    /* scale the yaxis logarithmic */
     
     /* status information */
            
     long           xorigin,yorigin;/* where is (0,0) of the graph */
     long           pie_x,pie_y;    /* where is the centerpoint */
-    long           xgif,ygif;      /* total size of the gif */
+    long           ximg,yimg;      /* total size of the image */
     double         magfact;        /* numerical magnitude*/
     long         base;            /* 1000 or 1024 depending on what we graph */
     char           symbol;         /* magnitude symbol for y-axis */
index 76bd7a7acced9327aa484ec30780cac4bc07f3c0..5ba481bd1d7c6ea2508382192eb6b0a173c53ad7 100644 (file)
@@ -119,8 +119,6 @@ info_t *rrd_info(int, char **);
 
 /* HELPER FUNCTIONS */
 
-int GifSize(FILE *, long *, long *);
-int PngSize(FILE *, long *, long *);
 int PngSize(FILE *, long *, long *);
 
 int rrd_create_fn(char *file_name, rrd_t *rrd);