The R Project SVN R

Rev

Rev 46788 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 46788 Rev 51087
Line 1... Line 1...
1
/*
1
/*
2
 *  R : A Computer Language for Statistical Data Analysis
2
 *  R : A Computer Language for Statistical Data Analysis
3
 *  Copyright (C) 1999-2008  Guido Masarotto and the R Development Core Team
3
 *  Copyright (C) 1999-2010  Guido Masarotto and the R Development Core Team
4
 *
4
 *
5
 *  This program is free software; you can redistribute it and/or modify
5
 *  This program is free software; you can redistribute it and/or modify
6
 *  it under the terms of the GNU General Public License as published by
6
 *  it under the terms of the GNU General Public License as published by
7
 *  the Free Software Foundation; either version 2 of the License, or
7
 *  the Free Software Foundation; either version 2 of the License, or
8
 *  (at your option) any later version.
8
 *  (at your option) any later version.
Line 68... Line 68...
68
   in a different thread from the one where R runs.
68
   in a different thread from the one where R runs.
69
*/
69
*/
70
static void my_png_error(png_structp png_ptr, png_const_charp msg)
70
static void my_png_error(png_structp png_ptr, png_const_charp msg)
71
{
71
{
72
    R_ShowMessage((char *) msg);
72
    R_ShowMessage((char *) msg);
-
 
73
#if PNG_LIBPNG_VER < 10400
73
    longjmp(png_ptr->jmpbuf,1);
74
    longjmp(png_ptr->jmpbuf,1);
-
 
75
#else
-
 
76
    longjmp(png_jmpbuf(png_ptr),1);
-
 
77
#endif
74
}
78
}
75
 
79
 
76
static void my_png_warning(png_structp png_ptr, png_const_charp msg)
80
static void my_png_warning(png_structp png_ptr, png_const_charp msg)
77
{
81
{
78
    warning("libpng: %s",(char *) msg);
82
    warning("libpng: %s",(char *) msg);
Line 122... Line 126...
122
    }
126
    }
123
 
127
 
124
    /* Set error handling.  REQUIRED if you aren't supplying your own
128
    /* Set error handling.  REQUIRED if you aren't supplying your own
125
     * error handling functions in the png_create_write_struct() call.
129
     * error handling functions in the png_create_write_struct() call.
126
     */
130
     */
-
 
131
#if PNG_LIBPNG_VER < 10400
127
    if (setjmp(png_ptr->jmpbuf)) {
132
    if (setjmp(png_ptr->jmpbuf))
-
 
133
#else
-
 
134
    if (setjmp(png_jmpbuf(png_ptr)))
-
 
135
#endif
-
 
136
{
128
	/* If we get here, we had a problem writing the file */
137
	/* If we get here, we had a problem writing the file */
129
	free(scanline);
138
	free(scanline);
130
	png_destroy_write_struct(&png_ptr, &info_ptr);
139
	png_destroy_write_struct(&png_ptr, &info_ptr);
131
	return 0;
140
	return 0;
132
    }
141
    }