more solaris 10 portability changes ....
authoroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Tue, 27 Oct 2009 17:04:03 +0000 (17:04 +0000)
committeroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Tue, 27 Oct 2009 17:04:03 +0000 (17:04 +0000)
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1954 a5681a0c-68f1-0310-ab6d-d61299d08faa

src/rrd_client.c
src/rrd_graph.h
src/rrd_restore.c

index b018ee0..034beca 100644 (file)
@@ -26,6 +26,7 @@
 
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h>
 #include <errno.h>
 #include <assert.h>
 #include <pthread.h>
@@ -33,6 +34,7 @@
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <netdb.h>
+#include <limits.h>
 
 #ifndef ENODATA
 #define ENODATA ENOENT
index d3de4cf..c11ac2f 100644 (file)
@@ -9,6 +9,11 @@
 #include <cairo-pdf.h>
 #include <cairo-svg.h>
 #include <cairo-ps.h>
+
+/* without this will not compile on solaris */
+#ifndef __EXTENSIONS__
+#define __EXTENSIONS__
+#endif
 #include <pango/pangocairo.h>
 
 
index d75247d..d351cba 100644 (file)
@@ -275,21 +275,26 @@ static int get_xml_double(
     double *value)
 {
     
-    char *text;
+    xmlChar *text;
     double temp;    
     if ((text = (char *)get_xml_text(reader))!= NULL){
-        if (strcasestr(text,"nan")){
+        char *c = text;
+        while (c){
+            *c=tolower((unsigned char)(*c));
+            c++;
+        }
+        if (xmlStrcasestr(text,(xmlChar *)"nan")){
             *value = DNAN;
             xmlFree(text);
             return 0;            
         }
-        else if (strcasestr(text,"-inf")){
+        else if (xmlStrcasestr(text,(xmlChar *)"-inf")){
             *value = -DINF;
             xmlFree(text);
             return 0;            
         }
-        else if (strcasestr(text,"+inf")
-                 || strcasestr(text,"inf")){
+        else if (xmlStrcasestr(text,(xmlChar *)"+inf")
+                 || xmlStrcasestr(text,(xmlChar *)"inf")){
             *value = DINF;
             xmlFree(text);
             return 0;