Commit 86681c8d authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

ported to gstdio, removed unnecessary includes.

2005-03-04  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/*: ported to gstdio, removed unnecessary includes.
parent 56d285db
2005-03-04 Sven Neumann <sven@gimp.org>
* plug-ins/common/*: ported to gstdio, removed unnecessary includes.
2005-03-04 Sven Neumann <sven@gimp.org> 2005-03-04 Sven Neumann <sven@gimp.org>
* plug-ins/FractalExplorer * plug-ins/FractalExplorer
......
...@@ -53,8 +53,6 @@ ...@@ -53,8 +53,6 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <gtk/gtk.h>
#include <libgimp/gimp.h> #include <libgimp/gimp.h>
#include <libgimp/gimpui.h> #include <libgimp/gimpui.h>
......
...@@ -28,14 +28,13 @@ ...@@ -28,14 +28,13 @@
#include <glib/gstdio.h> #include <glib/gstdio.h>
#include <gtk/gtk.h>
#include <libgimp/gimp.h> #include <libgimp/gimp.h>
#include "bmp.h" #include "bmp.h"
#include "libgimp/stdplugins-intl.h" #include "libgimp/stdplugins-intl.h"
#if !defined(WIN32) || defined(__MINGW32__) #if !defined(WIN32) || defined(__MINGW32__)
#define BI_RGB 0 #define BI_RGB 0
#define BI_RLE8 1 #define BI_RLE8 1
......
...@@ -34,8 +34,6 @@ ...@@ -34,8 +34,6 @@
#include <glib/gstdio.h> #include <glib/gstdio.h>
#include <gtk/gtk.h>
#include <libgimp/gimp.h> #include <libgimp/gimp.h>
#include <libgimp/gimpui.h> #include <libgimp/gimpui.h>
...@@ -43,6 +41,7 @@ ...@@ -43,6 +41,7 @@
#include "libgimp/stdplugins-intl.h" #include "libgimp/stdplugins-intl.h"
static gint cur_progress = 0; static gint cur_progress = 0;
static gint max_progress = 0; static gint max_progress = 0;
static gint encoded = 0; static gint encoded = 0;
......
...@@ -27,11 +27,6 @@ ...@@ -27,11 +27,6 @@
#include "config.h" #include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <gtk/gtk.h>
#include <libgimp/gimp.h> #include <libgimp/gimp.h>
#include <libgimp/gimpui.h> #include <libgimp/gimpui.h>
......
...@@ -22,17 +22,13 @@ ...@@ -22,17 +22,13 @@
* Possible future additions: * Possible future additions:
* + Save (perhaps optionally?) the palette in a KCF * + Save (perhaps optionally?) the palette in a KCF
*/ */
#include "config.h" #include "config.h"
#include <errno.h> #include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h> #include <string.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <gtk/gtk.h> #include <glib/gstdio.h>
#include <libgimp/gimp.h> #include <libgimp/gimp.h>
#include <libgimp/gimpui.h> #include <libgimp/gimpui.h>
...@@ -298,7 +294,7 @@ load_image (const gchar *file, ...@@ -298,7 +294,7 @@ load_image (const gchar *file,
/* Open the file for reading */ /* Open the file for reading */
fp = fopen (file, "r"); fp = g_fopen (file, "r");
if (fp == NULL) if (fp == NULL)
{ {
...@@ -570,7 +566,7 @@ save_image (const gchar *file, ...@@ -570,7 +566,7 @@ save_image (const gchar *file,
drawable = gimp_drawable_get (layer); drawable = gimp_drawable_get (layer);
/* Open the file for writing */ /* Open the file for writing */
fp = fopen (file, "w"); fp = g_fopen (file, "w");
if (fp == NULL) if (fp == NULL)
{ {
......
...@@ -72,11 +72,10 @@ ...@@ -72,11 +72,10 @@
#include "config.h" #include "config.h"
#include <errno.h> #include <errno.h>
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <gtk/gtk.h> #include <glib/gstdio.h>
#include <libgimp/gimp.h> #include <libgimp/gimp.h>
#include <libgimp/gimpui.h> #include <libgimp/gimpui.h>
...@@ -1999,7 +1998,7 @@ CML_save_to_file_response (GtkWidget *dialog, ...@@ -1999,7 +1998,7 @@ CML_save_to_file_response (GtkWidget *dialog,
! force_overwrite (filename, dialog)) ! force_overwrite (filename, dialog))
return; return;
file = fopen (filename, "w"); file = g_fopen (filename, "w");
if (! file) if (! file)
{ {
...@@ -2214,7 +2213,7 @@ CML_load_parameter_file (const gchar *filename, ...@@ -2214,7 +2213,7 @@ CML_load_parameter_file (const gchar *filename,
gint seed = 0; gint seed = 0;
gint old2new_function_id[] = { 3, 4, 5, 6, 7, 9, 10, 11, 1, 2 }; gint old2new_function_id[] = { 3, 4, 5, 6, 7, 9, 10, 11, 1, 2 };
file = fopen (filename, "r"); file = g_fopen (filename, "r");
if (!file) if (!file)
{ {
......
...@@ -29,9 +29,8 @@ ...@@ -29,9 +29,8 @@
#include "config.h" #include "config.h"
#include <string.h> #include <string.h>
#include <aalib.h>
#include <gtk/gtk.h> #include <aalib.h>
#include <libgimp/gimp.h> #include <libgimp/gimp.h>
#include <libgimp/gimpui.h> #include <libgimp/gimpui.h>
......
...@@ -21,8 +21,6 @@ ...@@ -21,8 +21,6 @@
#include "config.h" #include "config.h"
#include <gtk/gtk.h>
#include <libgimp/gimp.h> #include <libgimp/gimp.h>
#include <libgimp/gimpui.h> #include <libgimp/gimpui.h>
......
...@@ -46,12 +46,8 @@ ...@@ -46,12 +46,8 @@
#include "config.h" #include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h> #include <string.h>
#include <gtk/gtk.h>
#include <libgimp/gimp.h> #include <libgimp/gimp.h>
#include <libgimp/gimpui.h> #include <libgimp/gimpui.h>
...@@ -604,7 +600,7 @@ render_frame (gint32 whichframe) ...@@ -604,7 +600,7 @@ render_frame (gint32 whichframe)
{ {
printf( "playback: Asked for frame number %d in a %d-frame animation!\n", printf( "playback: Asked for frame number %d in a %d-frame animation!\n",
(int) (whichframe+1), (int) total_frames); (int) (whichframe+1), (int) total_frames);
exit(-1); gimp_quit ();
} }
drawable = gimp_drawable_get (layers[total_frames-(whichframe+1)]); drawable = gimp_drawable_get (layers[total_frames-(whichframe+1)]);
......
...@@ -30,8 +30,6 @@ ...@@ -30,8 +30,6 @@
#include "config.h" #include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h> #include <string.h>
#include <libgimp/gimp.h> #include <libgimp/gimp.h>
......
...@@ -39,8 +39,6 @@ ...@@ -39,8 +39,6 @@
#include "config.h" #include "config.h"
#include <gtk/gtk.h>
#include <libgimp/gimp.h> #include <libgimp/gimp.h>
#include <libgimp/gimpui.h> #include <libgimp/gimpui.h>
......
...@@ -34,8 +34,6 @@ ...@@ -34,8 +34,6 @@
#include <string.h> #include <string.h>
#include <gtk/gtk.h>
#include <libgimp/gimp.h> #include <libgimp/gimp.h>
#include <libgimp/gimpui.h> #include <libgimp/gimpui.h>
......
...@@ -17,9 +17,8 @@ ...@@ -17,9 +17,8 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "config.h"
#include <gtk/gtk.h> #include "config.h"
#include <libgimp/gimp.h> #include <libgimp/gimp.h>
#include <libgimp/gimpui.h> #include <libgimp/gimpui.h>
......
...@@ -102,14 +102,7 @@ ...@@ -102,14 +102,7 @@
#include "config.h" #include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h> #include <string.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <gtk/gtk.h>
#include <libgimp/gimp.h> #include <libgimp/gimp.h>
#include <libgimp/gimpui.h> #include <libgimp/gimpui.h>
......
...@@ -26,15 +26,15 @@ ...@@ -26,15 +26,15 @@
#include "config.h" #include "config.h"
#include <string.h> #include <string.h>
#include <sys/stat.h>
#include <gtk/gtk.h> #include <glib/gstdio.h>
#include <libgimp/gimp.h> #include <libgimp/gimp.h>
#include <libgimp/gimpui.h> #include <libgimp/gimpui.h>
#include "libgimp/stdplugins-intl.h" #include "libgimp/stdplugins-intl.h"
/* lets prototype */ /* lets prototype */
static void query (void); static void query (void);
static void run (const gchar *name, static void run (const gchar *name,
...@@ -394,7 +394,7 @@ doDialog (void) ...@@ -394,7 +394,7 @@ doDialog (void)
doLabel (vbox, _("Uncompressed size: %s"), memsize); doLabel (vbox, _("Uncompressed size: %s"), memsize);
g_free (memsize); g_free (memsize);
if (filename && !stat (filename, &st) && !gimp_image_is_dirty (imageID)) if (filename && !g_stat (filename, &st) && !gimp_image_is_dirty (imageID))
{ {
gchar *memsize = gimp_memsize_to_string (st.st_size); gchar *memsize = gimp_memsize_to_string (st.st_size);
......
...@@ -27,18 +27,10 @@ ...@@ -27,18 +27,10 @@
#include "config.h" #include "config.h"
#include <errno.h> #include <errno.h>
#include <stdio.h>
#include <string.h> #include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <gtk/gtk.h> #include <glib/gstdio.h>
#ifdef G_OS_WIN32
#include <libgimpbase/gimpwin32-io.h>
#endif
#include <libgimpmath/gimpmath.h>
#include <libgimp/gimp.h> #include <libgimp/gimp.h>
#include <libgimp/gimpui.h> #include <libgimp/gimpui.h>
...@@ -920,7 +912,7 @@ cm_load_file_response_callback (GtkWidget *dialog, ...@@ -920,7 +912,7 @@ cm_load_file_response_callback (GtkWidget *dialog,
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
fp = fopen (filename, "r"); fp = g_fopen (filename, "r");
if (fp) if (fp)
{ {
...@@ -1054,7 +1046,7 @@ cm_save_file_response_callback (GtkWidget *dialog, ...@@ -1054,7 +1046,7 @@ cm_save_file_response_callback (GtkWidget *dialog,
return; return;
} }
file = fopen (filename, "w"); file = g_fopen (filename, "w");
if (! file) if (! file)
{ {
......
...@@ -21,8 +21,6 @@ ...@@ -21,8 +21,6 @@
#include "config.h" #include "config.h"
#include <gtk/gtk.h>
#include <libgimp/gimp.h> #include <libgimp/gimp.h>
#include <libgimp/gimpui.h> #include <libgimp/gimpui.h>
......
...@@ -23,9 +23,6 @@ ...@@ -23,9 +23,6 @@
#include "config.h" #include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <libgimp/gimp.h> #include <libgimp/gimp.h>
#include <libgimp/gimpui.h> #include <libgimp/gimpui.h>
......
...@@ -29,15 +29,10 @@ ...@@ -29,15 +29,10 @@
#include "config.h" #include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h> #include <string.h>
#include <gtk/gtk.h>
#include <libgimp/gimp.h> #include <libgimp/gimp.h>
#include <libgimp/gimpui.h> #include <libgimp/gimpui.h>
#include <libgimpmath/gimpmath.h>
#include "libgimp/stdplugins-intl.h" #include "libgimp/stdplugins-intl.h"
......
...@@ -59,21 +59,26 @@ ...@@ -59,21 +59,26 @@
#include "config.h" #include "config.h"
#include <stdlib.h> #include <string.h>
#include <stdio.h> #include <errno.h>
#include <sys/types.h> #include <sys/types.h>
#ifdef HAVE_SYS_PARAM_H #ifdef HAVE_SYS_PARAM_H
#include <sys/param.h> #include <sys/param.h>
#endif #endif
#ifdef HAVE_SYS_WAIT_H #ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h> #include <sys/wait.h>
#endif #endif
#include <sys/stat.h> #include <sys/stat.h>
#include <string.h>
#ifdef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif #endif
#include <errno.h>
#include <glib/gstdio.h>
#include <libgimp/gimp.h> #include <libgimp/gimp.h>
...@@ -378,7 +383,7 @@ save_image (const Compressor *compressor, ...@@ -378,7 +383,7 @@ save_image (const Compressor *compressor,
tmpname, tmpname,
tmpname) && valid_file (tmpname))) tmpname) && valid_file (tmpname)))
{ {
unlink (tmpname); g_unlink (tmpname);
g_free (tmpname); g_free (tmpname);
return GIMP_PDB_EXECUTION_ERROR; return GIMP_PDB_EXECUTION_ERROR;
} }
...@@ -399,7 +404,7 @@ save_image (const Compressor *compressor, ...@@ -399,7 +404,7 @@ save_image (const Compressor *compressor,
{ {
FILE *f; FILE *f;
if (!(f = fopen (filename, "w"))) if (!(f = g_fopen (filename, "w")))
{ {
g_message (_("Could not open '%s' for writing: %s"), g_message (_("Could not open '%s' for writing: %s"),
gimp_filename_to_utf8 (filename), g_strerror (errno)); gimp_filename_to_utf8 (filename), g_strerror (errno));
...@@ -450,8 +455,8 @@ save_image (const Compressor *compressor, ...@@ -450,8 +455,8 @@ save_image (const Compressor *compressor,
STARTUPINFO startupinfo; STARTUPINFO startupinfo;
PROCESS_INFORMATION processinfo; PROCESS_INFORMATION processinfo;
in = fopen (tmpname, "rb"); in = g_fopen (tmpname, "rb");
out = fopen (filename, "wb"); out = g_fopen (filename, "wb");
startupinfo.cb = sizeof (STARTUPINFO); startupinfo.cb = sizeof (STARTUPINFO);
startupinfo.lpReserved = NULL; startupinfo.lpReserved = NULL;
...@@ -485,7 +490,7 @@ save_image (const Compressor *compressor, ...@@ -485,7 +490,7 @@ save_image (const Compressor *compressor,
} }
#endif /* G_OS_WIN32 */ #endif /* G_OS_WIN32 */
unlink (tmpname); g_unlink (tmpname);
g_free (tmpname); g_free (tmpname);
return GIMP_PDB_SUCCESS; return GIMP_PDB_SUCCESS;
...@@ -530,7 +535,7 @@ load_image (const Compressor *compressor, ...@@ -530,7 +535,7 @@ load_image (const Compressor *compressor,
{ {
FILE *f; FILE *f;
if (! (f = fopen (tmpname, "w"))) if (! (f = g_fopen (tmpname, "w")))
{ {
g_message (_("Could not open '%s' for writing: %s"), g_message (_("Could not open '%s' for writing: %s"),
gimp_filename_to_utf8 (tmpname), g_strerror (errno)); gimp_filename_to_utf8 (tmpname), g_strerror (errno));
...@@ -586,8 +591,8 @@ load_image (const Compressor *compressor, ...@@ -586,8 +591,8 @@ load_image (const Compressor *compressor,
STARTUPINFO startupinfo; STARTUPINFO startupinfo;
PROCESS_INFORMATION processinfo; PROCESS_INFORMATION processinfo;
in = fopen (filename, "rb"); in = g_fopen (filename, "rb");
out = fopen (tmpname, "wb"); out = g_fopen (tmpname, "wb");
startupinfo.cb = sizeof (STARTUPINFO); startupinfo.cb = sizeof (STARTUPINFO);
startupinfo.lpReserved = NULL; startupinfo.lpReserved = NULL;
...@@ -626,7 +631,7 @@ load_image (const Compressor *compressor, ...@@ -626,7 +631,7 @@ load_image (const Compressor *compressor,
image_ID = gimp_file_load (run_mode, tmpname, tmpname); image_ID = gimp_file_load (run_mode, tmpname, tmpname);
unlink (tmpname); g_unlink (tmpname);
g_free (tmpname); g_free (tmpname);
if (image_ID != -1) if (image_ID != -1)
......
...@@ -54,15 +54,7 @@ ...@@ -54,15 +54,7 @@
#include "config.h" #include "config.h"
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <string.h> #include <string.h>
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <gtk/gtk.h>
#include <libgimp/gimp.h> #include <libgimp/gimp.h>
#include <libgimp/gimpui.h> #include <libgimp/gimpui.h>
......
...@@ -21,11 +21,9 @@ ...@@ -21,11 +21,9 @@
#include "config.h" #include "config.h"
#include <stdlib.h>
#include <string.h> #include <string.h>
#include <stdio.h>
#include <gtk/gtk.h> #include <glib/gstdio.h>
#include <libgimp/gimp.h> #include <libgimp/gimp.h>
#include <libgimp/gimpui.h> #include <libgimp/gimpui.h>
...@@ -382,7 +380,7 @@ save_image (Config *config, ...@@ -382,7 +380,7 @@ save_image (Config *config,
guint8 *img_buffer, *img_buffer_end; guint8 *img_buffer, *img_buffer_end;
gchar *basename; gchar *basename;
fp = fopen (config->file_name, "w"); fp = g_fopen (config->file_name, "w");
if (!fp) if (!fp)
return FALSE; return FALSE;
......
...@@ -22,11 +22,8 @@ ...@@ -22,11 +22,8 @@
#include "config.h" #include "config.h"
#include <stdlib.h>
#include <string.h> #include <string.h>
#include <gtk/gtk.h>
#include <libgimp/gimp.h> #include <libgimp/gimp.h>
#include <libgimp/gimpui.h> #include <libgimp/gimpui.h>
......
...@@ -36,12 +36,11 @@ ...@@ -36,12 +36,11 @@
#include "config.h" #include "config.h"
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h>