summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bdf5f55)
raw | patch | inline | side by side (parent: bdf5f55)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sun, 14 Sep 2008 00:42:53 +0000 (00:42 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sun, 14 Sep 2008 00:42:53 +0000 (00:42 +0000) |
diff --git a/program/configure.ac b/program/configure.ac
index 7bd2913f37ccd32f959b50bf616f1e1c4837dce0..cc2e998d3fdeddf1254391c5bd9e808579ca41f0 100644 (file)
--- a/program/configure.ac
+++ b/program/configure.ac
dnl At the TOP of the HEADER
AH_TOP([
-
#ifndef RRD_CONFIG_H
#define RRD_CONFIG_H
+
/* IEEE can be prevented from raising signals with fpsetmask(0) */
#undef MUST_DISABLE_FPMASK
/* IEEE math only works if SIGFPE gets actively set to IGNORE */
-
#undef MUST_DISABLE_SIGFPE
/* realloc does not support NULL as argument */
# endif
#endif
- ])
+])
AH_BOTTOM([
-/* make sure that we pickup the correct stuff from all headers */
-#ifdef HAVE_FEATURES_H
-#undef _XOPEN_SOURCE /* keep unmodified */
-#undef _BSD_SOURCE /* keep unmodified */
-#define _XOPEN_SOURCE 600
-#define _BSD_SOURCE 1
-# include <features.h>
-#endif
-
-/* FreeBSD 4.8 wants this included BEFORE sys/types.h */
-#ifdef HAVE_SYS_MMAN_H
-# include <sys/mman.h>
-#endif
-
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
-#ifdef HAVE_SYS_PARAM_H
-# include <sys/param.h>
-#endif
-#ifndef MAXPATH
-# ifdef PATH_MAX
-# define MAXPATH PATH_MAX
-# endif
-#endif
-#ifndef MAXPATH
-/* else try the BSD variant */
-# ifdef MAXPATHLEN
-# define MAXPATH MAXPATHLEN
-# endif
-#endif
-
-#ifdef HAVE_ERRNO_H
-# include <errno.h>
-#endif
-
-#if !defined HAVE_MADVISE && defined HAVE_POSIX_MADVISE
-/* use posix_madvise family */
-# define madvise posix_madvise
-# define MADV_NORMAL POSIX_MADV_NORMAL
-# define MADV_RANDOM POSIX_MADV_RANDOM
-# define MADV_SEQUENTIAL POSIX_MADV_SEQUENTIAL
-# define MADV_WILLNEED POSIX_MADV_WILLNEED
-# define MADV_DONTNEED POSIX_MADV_DONTNEED
-#endif
-#if defined HAVE_MADVISE || defined HAVE_POSIX_MADVISE
-# define USE_MADVISE 1
-#endif
-
-#ifdef HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
-#ifdef TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# ifdef HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-
-#ifdef HAVE_SYS_TIMES_H
-# include <sys/times.h>
-#endif
-
-#ifdef HAVE_SYS_RESOURCE_H
-# include <sys/resource.h>
-#if (defined(__svr4__) && defined(__sun__))
-/* Solaris headers (pre 2.6) do not have a getrusage prototype.
- Use this instead. */
-extern int getrusage(int, struct rusage *);
-#endif /* __svr4__ && __sun__ */
-#endif
-
-
-/* define strrchr, strchr and memcpy, memmove in terms of bsd funcs
- make sure you are NOT using bcopy, index or rindex in the code */
-
-#ifdef STDC_HEADERS
-# include <string.h>
-#else
-# ifndef HAVE_STRCHR
-# define strchr index
-# define strrchr rindex
-# endif
-char *strchr (), *strrchr ();
-# ifndef HAVE_MEMMOVE
-# define memcpy(d, s, n) bcopy ((s), (d), (n))
-# define memmove(d, s, n) bcopy ((s), (d), (n))
-# endif
-#endif
-
-#ifdef NO_NULL_REALLOC
-# define rrd_realloc(a,b) ( (a) == NULL ? malloc( (b) ) : realloc( (a) , (b) ))
-#else
-# define rrd_realloc(a,b) realloc((a), (b))
-#endif
-
-#ifdef NEED_MALLOC_MALLOC_H
+#ifdef MUST_HAVE_MALLOC_MALLOC_H
# include <malloc/malloc.h>
#endif
-#ifdef HAVE_STDIO_H
-# include <stdio.h>
-#endif
+#include <rrd_config_bottom.h>
-#ifdef HAVE_STDLIB_H
-# include <stdlib.h>
#endif
-
-#ifdef HAVE_CTYPE_H
-# include <ctype.h>
-#endif
-
-#ifdef HAVE_DIRENT_H
-# include <dirent.h>
-# define NAMLEN(dirent) strlen((dirent)->d_name)
-#else
-# define dirent direct
-# define NAMLEN(dirent) (dirent)->d_namlen
-# ifdef HAVE_SYS_NDIR_H
-# include <sys/ndir.h>
-# endif
-# ifdef HAVE_SYS_DIR_H
-# include <sys/dir.h>
-# endif
-# ifdef HAVE_NDIR_H
-# include <ndir.h>
-# endif
-#endif
-
-#ifdef MUST_DISABLE_SIGFPE
-# include <signal.h>
-#endif
-
-#ifdef MUST_DISABLE_FPMASK
-# include <floatingpoint.h>
-#endif
-
-
-#ifdef HAVE_MATH_H
-# include <math.h>
-#endif
-
-#ifdef HAVE_FLOAT_H
-# include <float.h>
-#endif
-
-#ifdef HAVE_IEEEFP_H
-# include <ieeefp.h>
-#endif
-
-#ifdef HAVE_FP_CLASS_H
-# include <fp_class.h>
-#endif
-
-/* for Solaris */
-#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASS))
-# define HAVE_ISINF 1
-# ifdef isinf
-# undef isinf /* confuse autoconf */
-# endif
-# define isinf(a) (fpclass(a) == FP_NINF || fpclass(a) == FP_PINF)
-#endif
-
-/* solaris 10 it defines isnan such that only forte can compile it ... bad bad */
-#if (defined(HAVE_ISNAN) && defined(isnan) && defined(HAVE_FPCLASS))
-# undef isnan /* confuse autoconf to NOT remove this */
-# define isnan(a) (fpclass(a) == FP_SNAN || fpclass(a) == FP_QNAN)
-#endif
-
-/* for OSF1 Digital Unix */
-#if (! defined(HAVE_ISINF) && defined(HAVE_FP_CLASS) && defined(HAVE_FP_CLASS_H))
-# define HAVE_ISINF 1
-# define isinf(a) (fp_class(a) == FP_NEG_INF || fp_class(a) == FP_POS_INF)
-#endif
-
-#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_PLUS_INF) && defined(FP_MINUS_INF))
-# define HAVE_ISINF 1
-# define isinf(a) (fpclassify(a) == FP_MINUS_INF || fpclassify(a) == FP_PLUS_INF)
-#endif
-
-#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_INFINITE))
-# define HAVE_ISINF 1
-# define isinf(a) (fpclassify(a) == FP_INFINITE)
-#endif
-
-/* for AIX */
-#if (! defined(HAVE_ISINF) && defined(HAVE_CLASS))
-# define HAVE_ISINF 1
-# define isinf(a) (class(a) == FP_MINUS_INF || class(a) == FP_PLUS_INF)
-#endif
-
-#if (! defined (HAVE_FINITE) && defined (HAVE_ISFINITE))
-# define HAVE_FINITE 1
-# define finite(a) isfinite(a)
-#endif
-
-#if (! defined(HAVE_FINITE) && defined(HAVE_ISNAN) && defined(HAVE_ISINF))
-# define HAVE_FINITE 1
-# define finite(a) (! isnan(a) && ! isinf(a))
-#endif
-
-#ifndef HAVE_FINITE
-#error "Can't compile without finite function"
-#endif
-
-#ifndef HAVE_ISINF
-#error "Can't compile without isinf function"
-#endif
-
-#if (! defined(HAVE_FDATASYNC) && defined(HAVE_FSYNC))
-#define fdatasync fsync
-#endif
-
-#if (!defined(HAVE_FDATASYNC) && !defined(HAVE_FSYNC))
-#error "Can't compile with without fsync and fdatasync"
-#endif
-
-#endif /* RRD_CONFIG_H */
])
dnl Process Special Options
AC_DEFINE(HAVE_ISINF)],[AC_MSG_RESULT(no)])])
dnl finite is BSD, isfinite is C99, so prefer the latter
-AC_CACHE_CHECK([whether isfinite is broken],[have_broken_isfinite],[
+AC_CACHE_CHECK([whether isfinite is broken],[ac_cv_have_broken_isfinite],[
AC_TRY_RUN([
#ifdef HAVE_MATH_H
#include <math.h>
#endif
#endif
return 0;
-}],[
-have_broken_isfinite=no],have_broken_isfinite=yes,[
+}],[ac_cv_have_broken_isfinite=no],[ac_cv_have_broken_isfinite=yes],[
case "${target}" in
- hppa*-*-hpux*) have_broken_isfinite=yes ;;
- *-sun-solaris2.8) have_broken_isfinite=yes ;;
- *) have_broken_isfinite=no ;;
+ hppa*-*-hpux*) ac_cv_have_broken_isfinite=yes ;;
+ *-sun-solaris2.8) ac_cv_have_broken_isfinite=yes ;;
+ *) ac_cv_have_broken_isfinite=no ;;
esac])
])
-if test "x$have_broken_isfinite" = "xno"; then
+
+dnl the test does not seem to work on solaris 2.8
+dnl so lets fix this by hand
+case "${target}" in
+ *-sun-solaris2.8) ac_cv_have_broken_isfinite=yes ;;
+esac
+
+if test "x$ac_cv_have_broken_isfinite" = "xno"; then
AC_DEFINE(HAVE_ISFINITE)
else
-AC_CHECK_FUNCS(finite,[],
- [AC_CHECK_FUNCS(isfinite,[],
- [AC_MSG_CHECKING(for isfinite with <math.h>)
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>
+ AC_CHECK_FUNCS(finite,[],
+ [AC_CHECK_FUNCS(isfinite,[],
+ [AC_MSG_CHECKING(for isfinite with <math.h>)
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>
volatile int x;volatile float f; ]],[[x = isfinite(f)]])],[AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_ISFINITE)],[AC_MSG_RESULT(no)])])])
-fi
+fi
AC_FULL_IEEE
[[#include <stdlib.h>
#include <malloc/malloc.h>]],
[[malloc(1)]]
- ),
- [AC_DEFINE(NEED_MALLOC_MALLOC_H)
+ ),[
+ AC_DEFINE([MUST_HAVE_MALLOC_MALLOC_H])
AC_MSG_RESULT([yes we do])],
[AC_MSG_ERROR([Can not figure how to compile malloc])]
)
index 4e911c056e61fc1447b3b3401ce9f91c43cbef5c..c2e9b3da212bb33e40818a1da0858dbbd0f1355c 100644 (file)
--- a/program/doc/rrdgraph.pod
+++ b/program/doc/rrdgraph.pod
the actual graph, C<SHADEA> for the left and top border, C<SHADEB> for the
right and bottom border, C<GRID>, C<MGRID> for the major grid, C<FONT> for
the color of the font, C<AXIS> for the axis of the graph, C<FRAME> for the
-line around the color spots and finally C<ARROW> for the arrow head pointing
+line around the color spots, and finally C<ARROW> for the arrow head pointing
up and forward. Each color is composed out of three hexadecimal numbers
specifying its rgb color component (00 is off, FF is maximum) of red, green
and blue. Optionally you may add another hexadecimal number specifying the
[B<-n>|B<--font> I<FONTTAG>B<:>I<size>B<:>[I<font>]]
-This lets you customize which font to use for the various text
-elements on the RRD graphs. C<DEFAULT> sets the default value for all
-elements, C<TITLE> for the title, C<AXIS> for the axis labels, C<UNIT>
-for the vertical unit label, C<LEGEND> for the graph legend.
+This lets you customize which font to use for the various text elements on
+the RRD graphs. C<DEFAULT> sets the default value for all elements, C<TITLE>
+for the title, C<AXIS> for the axis labels, C<UNIT> for the vertical unit
+label, C<LEGEND> for the graph legend, C<WATERMARK> for the watermark on the
+edge of the graph.
Use Times for the title: C<--font TITLE:13:Times>
index a88eef31592c959ea36ef5b3638193cda468e117..8ff671d6a28b1b3ed23a6c8529e17fe2710186ed 100644 (file)
--- a/program/src/Makefile.am
+++ b/program/src/Makefile.am
noinst_HEADERS = \
unused.h \
rrd_getopt.h rrd_parsetime.h \
- rrd_i18n.h \
+ rrd_config_bottom.h rrd_i18n.h \
rrd_format.h rrd_tool.h rrd_xport.h rrd.h rrd_rpncalc.h \
rrd_hw.h rrd_hw_math.h rrd_hw_update.h \
fnv.h rrd_graph.h \
index dd07f5170d07d99293cc81e0bd4e01411c526a88..e9e6f11ab5a6a45c37ef3453daff06a92ade17e8 100644 (file)
--- a/program/src/rrd_format.h
+++ b/program/src/rrd_format.h
RRA_delta_neg = 2,
/* RRA_dependent_rra_idx = 3, */
RRA_window_len = 4,
- RRA_failure_threshold = 5,
+ RRA_failure_threshold = 5
/* For CF_FAILURES, number of violations within the last
* window required to mark a failure. */
};
index 08d0815d0bd5235bb9684f954f924078a87c64ea..cb0627cc5febc5bf8bab5a7250c9524d48c2b773 100644 (file)
--- a/program/src/rrd_graph.c
+++ b/program/src/rrd_graph.c
static void
rrd_set_font_desc (
image_desc_t *im,int prop,char *font, double size ){
- strncpy(im->text_prop[prop].font, font, sizeof(text_prop[prop].font) - 1);
- im->text_prop[prop].font[sizeof(text_prop[prop].font) - 1] = '\0';
- im->text_prop[prop].size = size;
- im->text_prop[prop].font_desc = pango_font_description_from_string( font );
- pango_font_description_set_size(im->text_prop[prop].font_desc, size * PANGO_SCALE);
+ if (font){
+ strncpy(im->text_prop[prop].font, font, sizeof(text_prop[prop].font) - 1);
+ im->text_prop[prop].font[sizeof(text_prop[prop].font) - 1] = '\0';
+ im->text_prop[prop].font_desc = pango_font_description_from_string( font );
+ };
+ if (size > 0){
+ im->text_prop[prop].size = size;
+ };
+ if (im->text_prop[prop].font_desc && im->text_prop[prop].size ){
+ pango_font_description_set_size(im->text_prop[prop].font_desc, im->text_prop[prop].size * PANGO_SCALE);
+ };
}
void rrd_graph_init(