/*****************************************************************************
- * RRDtool 1.1.x Copyright Tobias Oetiker, 1997 - 2002
+ * RRDtool 1.2rc6 Copyright by Tobi Oetiker, 1997-2005
*****************************************************************************
* rrd_open.c Open an RRD File
*****************************************************************************
* $Id$
* $Log$
+ * Revision 1.10 2004/05/26 22:11:12 oetiker
+ * reduce compiler warnings. Many small fixes. -- Mike Slifcak <slif@bellsouth.net>
+ *
* Revision 1.9 2003/04/29 21:56:49 oetiker
* readline in rrd_open.c reads the file in 8 KB blocks, and calls realloc for
* each block. realloc is very slow in Mac OS X for huge blocks, e.g. when
/* positioned to the first cdp in the first rra */
int
-rrd_open(char *file_name, FILE **in_file, rrd_t *rrd, int rdwr)
+rrd_open(const char *file_name, FILE **in_file, rrd_t *rrd, int rdwr)
{
rrd_init(rrd);
if (rdwr == RRD_READONLY) {
-#ifndef WIN32
+#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
mode = "r";
#else
mode = "rb";
#endif
} else {
-#ifndef WIN32
+#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
mode = "r+";
#else
mode = "rb+";
if (mem) free(mem);
}
-int readfile(char *file_name, char **buffer, int skipfirst){
+int readfile(const char *file_name, char **buffer, int skipfirst){
long writecnt=0,totalcnt = MEMBLK;
long offset = 0;
FILE *input=NULL;