summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 58ec29c)
raw | patch | inline | side by side (parent: 58ec29c)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Mon, 2 May 2005 20:27:13 +0000 (20:27 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Mon, 2 May 2005 20:27:13 +0000 (20:27 +0000) |
program/confignt/config.h | patch | blob | history | |
program/src/win32comp.c | [new file with mode: 0644] | patch | blob |
index 3a7336b047bc9ee0d045f00a4726f8756a982c17..d4d8be7654b87e3149c99e1ab4e8b056ab9d9f2d 100644 (file)
-/* config.h.nt: what configure _would_ say, if it ran on NT */
+/* config.h.in. Generated from configure.ac by autoheader. */
+#ifndef CONFIG_H
+#define CONFIG_H
-#define STDC_HEADERS 1
+#include <math.h>
+#include <float.h>
-/* Define if you have the strftime function. */
-#define HAVE_STRFTIME 1
+/* realloc does not support NULL as argument */
-/* Define if you have the <math.h> header file. */
+#define HAVE_STRFTIME 1
+#define HAVE_TIME_H 1
+#define HAVE_LOCALE_H 1
+#define HAVE_TZSET 1
+#define HAVE_SETLOCALE 1
#define HAVE_MATH_H 1
-
+#define HAVE_FLOAT_H 1
+#define HAVE_MEMMOVE 1
+#define HAVE_MALLOC_H 1
+#define HAVE_MKTIME 1
+#define HAVE_STRFTIME 1
+#define HAVE_STRING_H 1
+#define HAVE_VPRINTF 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_STAT_H 1
-#define rrd_realloc(a,b) realloc((a), (b))
+//#define PACKAGE "rrdtool"
+//#define PACKAGE_NAME "rrdtool"
+//#define PACKAGE_STRING "rrdtool 1.2rc6"
+//#define PACKAGE_VERSION "1.2rc6"
+//#define VERSION "1.2rc6"
+
+#define STDC_HEADERS 1
+#define RRD_DEFAULT_FONT "arial.ttf"
#define snprintf _snprintf
+#define strftime strftime_
-/* Code in rrd_graph.c:rrd_graph_init() uses the %windir% environment
- * variable to find the actual location of this relative font path to avoid
- * the recompile problem if the system directory is c:/windows vs. d:/winnt.
- */
+#define NO_NULL_REALLOC 1
+#if 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
-#define RRD_DEFAULT_FONT "cour.ttf"
+//#define DEBUG 1
+/* Vertical label angle: 90.0 (default) or 270.0 */
#define RRDGRAPH_YLEGEND_ANGLE 90.0
-#define HAVE_STRING_H 1
+/* Define to 1 if you have the ANSI C header files. */
+
+
+#endif /* CONFIG_H */
diff --git a/program/src/win32comp.c b/program/src/win32comp.c
--- /dev/null
+++ b/program/src/win32comp.c
@@ -0,0 +1,67 @@
+// compatibility routines, non reentrant ....\r
+\r
+#include <string.h> \r
+#include <time.h>\r
+\r
+struct tm* localtime_r(const time_t* t, struct tm* r) {\r
+ struct tm * temp;\r
+ temp = localtime(t);\r
+ memcpy(r,temp,sizeof(struct tm));\r
+ return(r);\r
+}\r
+\r
+struct tm* gmtime_r(const time_t* t, struct tm* r) {\r
+ struct tm * temp;\r
+ temp = gmtime(t);\r
+ memcpy(r,temp,sizeof(struct tm));\r
+ return r;\r
+}\r
+\r
+char* ctime_r (const time_t* t, char* buf) {\r
+ char * temp;\r
+ temp = asctime(localtime(t));\r
+ strcpy(buf,temp);\r
+ return(buf);\r
+}\r
+\r
+/*\r
+ s \r
+ Points to the string from which to extract tokens. \r
+\r
+ delim \r
+ Points to a null-terminated set of delimiter characters. \r
+\r
+ save_ptr\r
+ Is a value-return parameter used by strtok_r() to record its progress through s1. \r
+*/\r
+\r
+\r
+char * strtok_r (char *s, const char *delim, char **save_ptr) {\r
+ char *token;\r
+\r
+ if (s == NULL) s = *save_ptr;\r
+\r
+ /* Scan leading delimiters. */\r
+ s += strspn(s, delim);\r
+ if (*s == '\0')\r
+ {\r
+ *save_ptr = s;\r
+ return NULL;\r
+ }\r
+\r
+ /* Find the end of the token. */\r
+ token = s;\r
+ s = strpbrk (token, delim);\r
+ if (s == NULL) {\r
+ /* This token finishes the string. */\r
+ *save_ptr = token;\r
+ while (**save_ptr != '\0') (*save_ptr)++;\r
+ } else\r
+ {\r
+ /* Terminate the token and make *SAVE_PTR point past it. */\r
+ *s = '\0';\r
+ *save_ptr = s + 1;\r
+ }\r
+ return token;\r
+}\r
+\r