diff --git a/ChangeLog b/ChangeLog index c32f2888b7..2fd9d17ef3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2005-03-04 Sven Neumann + + * plug-ins/common/CEL.c + * plug-ins/common/gbr.c + * plug-ins/common/gih.c + * plug-ins/common/gqbist.c + * plug-ins/common/pat.c + * plug-ins/common/pnm.c + * plug-ins/common/postscript.c + * plug-ins/common/raw.c + * plug-ins/common/sample_colorize.c + * plug-ins/faxg3/faxg3.c + * plug-ins/imagemap/imap_preferences.c + * plug-ins/print/print.c: added missing parameter to g_open() calls, + ported some functions I missed earlier. + 2005-03-04 Bill Skaggs * app/core/gimpimage.c diff --git a/plug-ins/common/CEL.c b/plug-ins/common/CEL.c index dc01a9d926..d76bce5123 100644 --- a/plug-ins/common/CEL.c +++ b/plug-ins/common/CEL.c @@ -258,7 +258,7 @@ need_palette (const gchar *file) FILE *fp; guchar header[32]; - fp = fopen (file, "rb"); + fp = g_fopen (file, "rb"); if (!fp) return FALSE; @@ -457,7 +457,7 @@ load_image (const gchar *file, } else { - fp = fopen (palette_file, "r"); + fp = g_fopen (palette_file, "r"); } if (fp != NULL) diff --git a/plug-ins/common/gbr.c b/plug-ins/common/gbr.c index ad42aa6154..1415e31458 100644 --- a/plug-ins/common/gbr.c +++ b/plug-ins/common/gbr.c @@ -318,7 +318,7 @@ load_image (const gchar *filename) GimpImageType image_type; gssize size; - fd = g_open (filename, O_RDONLY | _O_BINARY); + fd = g_open (filename, O_RDONLY | _O_BINARY, 0); if (fd == -1) { diff --git a/plug-ins/common/gih.c b/plug-ins/common/gih.c index f64618a4d5..b4c1541546 100644 --- a/plug-ins/common/gih.c +++ b/plug-ins/common/gih.c @@ -640,7 +640,7 @@ gih_load_image (const gchar *filename) gchar *paramstring; GimpParasite *pipe_parasite; - fd = g_open (filename, O_RDONLY | _O_BINARY); + fd = g_open (filename, O_RDONLY | _O_BINARY, 0); if (fd == -1) { diff --git a/plug-ins/common/gqbist.c b/plug-ins/common/gqbist.c index d5a8579ee2..7120321dc0 100644 --- a/plug-ins/common/gqbist.c +++ b/plug-ins/common/gqbist.c @@ -615,7 +615,7 @@ load_data (gchar *name) FILE *f; guint8 buf[288]; - f = fopen (name, "rb"); + f = g_fopen (name, "rb"); if (f == NULL) { return FALSE; @@ -650,7 +650,7 @@ save_data (gchar *name) FILE *f; guint8 buf[288]; - f = fopen (name, "wb"); + f = g_fopen (name, "wb"); if (f == NULL) { return FALSE; diff --git a/plug-ins/common/pat.c b/plug-ins/common/pat.c index 9a7cc12a31..24d93a8e3f 100644 --- a/plug-ins/common/pat.c +++ b/plug-ins/common/pat.c @@ -15,6 +15,10 @@ #include #include +#ifdef HAVE_UNISTD_H +#include +#endif + #include #include @@ -291,7 +295,7 @@ load_image (const gchar *filename) GimpImageBaseType base_type; GimpImageType image_type; - fd = g_open (filename, O_RDONLY | _O_BINARY); + fd = g_open (filename, O_RDONLY | _O_BINARY, 0); if (fd == -1) { diff --git a/plug-ins/common/pnm.c b/plug-ins/common/pnm.c index 7d27c35e35..f22d589981 100644 --- a/plug-ins/common/pnm.c +++ b/plug-ins/common/pnm.c @@ -427,7 +427,7 @@ load_image (const gchar *filename) int ctr; /* open the file */ - fd = g_open (filename, O_RDONLY | _O_BINARY); + fd = g_open (filename, O_RDONLY | _O_BINARY, 0); if (fd == -1) { diff --git a/plug-ins/common/postscript.c b/plug-ins/common/postscript.c index 40b04ab491..19a88378d8 100644 --- a/plug-ins/common/postscript.c +++ b/plug-ins/common/postscript.c @@ -1377,7 +1377,7 @@ get_bbox (const gchar *filename, FILE *ifp; int retval = -1; - ifp = fopen (filename, "rb"); + ifp = g_fopen (filename, "rb"); if (ifp == NULL) return -1; diff --git a/plug-ins/common/raw.c b/plug-ins/common/raw.c index 1e61cd079b..802c75f731 100644 --- a/plug-ins/common/raw.c +++ b/plug-ins/common/raw.c @@ -228,7 +228,7 @@ run (const gchar *name, { gimp_get_data ("file_raw_load", runtime); - preview_fd = g_open (param[1].data.d_string, O_RDONLY); + preview_fd = g_open (param[1].data.d_string, O_RDONLY, 0); if (preview_fd < 0) { @@ -431,7 +431,7 @@ raw_load_palette (RawGimpData *data, if (palette_file) { - fd = g_open (palette_file, O_RDONLY); + fd = g_open (palette_file, O_RDONLY, 0); if (! fd) return FALSE; @@ -827,7 +827,7 @@ preview_update (GimpPreviewArea *preview) { gint fd; - fd = g_open (palfile, O_RDONLY); + fd = g_open (palfile, O_RDONLY, 0); lseek (fd, runtime->palette_offset, SEEK_SET); read (fd, preview_cmap, (runtime->palette_type == RAW_PALETTE_RGB) ? 768 : 1024); diff --git a/plug-ins/common/sample_colorize.c b/plug-ins/common/sample_colorize.c index 43633efd76..2199b82f82 100644 --- a/plug-ins/common/sample_colorize.c +++ b/plug-ins/common/sample_colorize.c @@ -25,6 +25,8 @@ #include #include +#include + #include #include @@ -1712,7 +1714,7 @@ p_print_ppm (const gchar *ppm_name) if (ppm_name == NULL) return; - fp = fopen (ppm_name, "w"); + fp = g_fopen (ppm_name, "w"); if(fp) { fprintf(fp, "P3\n# CREATOR: Gimp sample coloros\n256 256\n255\n"); @@ -1838,7 +1840,7 @@ p_get_filevalues (void) */ g_values.tol_col_err = 5.5; - l_fp = fopen("sample_colorize.values", "r"); + l_fp = g_fopen("sample_colorize.values", "r"); if (l_fp != NULL) { fgets(&l_buf[0], 999, l_fp); @@ -2636,7 +2638,7 @@ p_sample_analyze (t_GDRW *sample_gdrw) if(g_show_progress) gimp_progress_init (_("Sample Analyze...")); prot_fp = NULL; - if(g_Sdebug) prot_fp = fopen("sample_colors.dump", "w"); + if(g_Sdebug) prot_fp = g_fopen ("sample_colors.dump", "w"); p_print_values(prot_fp); /* ------------------------------------------------ diff --git a/plug-ins/faxg3/faxg3.c b/plug-ins/faxg3/faxg3.c index 172e8d2b22..5fdf2f789b 100644 --- a/plug-ins/faxg3/faxg3.c +++ b/plug-ins/faxg3/faxg3.c @@ -212,7 +212,7 @@ load_image (const gchar *filename) init_byte_tab( 0, byte_tab ); - fd = g_open (filename, O_RDONLY | _O_BINARY); + fd = g_open (filename, O_RDONLY | _O_BINARY, 0); if (fd < 0) { diff --git a/plug-ins/imagemap/imap_preferences.c b/plug-ins/imagemap/imap_preferences.c index 93b643c3b5..b093812c1b 100644 --- a/plug-ins/imagemap/imap_preferences.c +++ b/plug-ins/imagemap/imap_preferences.c @@ -23,14 +23,13 @@ #include "config.h" -#include #include #include -#include +#include #include "libgimp/gimp.h" -#include "libgimpwidgets/gimpwidgets.h" +#include "libgimp/gimpui.h" #include "imap_command.h" #include "imap_file.h" @@ -166,9 +165,9 @@ preferences_load(PreferencesData_t *data) char buf[256]; gchar *filename; - filename = g_build_filename (gimp_directory (), "imagemaprc", NULL); + filename = gimp_personal_rc_file ("imagemaprc"); - in = fopen(filename, "r"); + in = g_fopen(filename, "r"); g_free(filename); if (in) { while (fgets(buf, sizeof(buf), in)) { @@ -189,9 +188,9 @@ preferences_save(PreferencesData_t *data) gchar *filename; ColorSelData_t *colors = &data->colors; - filename = g_build_filename (gimp_directory (), "imagemaprc", NULL); + filename = gimp_personal_rc_file ("imagemaprc"); - out = fopen(filename, "w"); + out = g_fopen(filename, "w"); if (out) { fprintf(out, "# Imagemap plug-in resource file\n\n"); if (data->default_map_type == NCSA) diff --git a/plug-ins/print/print.c b/plug-ins/print/print.c index d282c89bbb..103db28ac9 100644 --- a/plug-ins/print/print.c +++ b/plug-ins/print/print.c @@ -34,6 +34,8 @@ #include #endif +#include + #include "libgimp/gimp.h" #include "libgimp/gimpui.h" @@ -477,7 +479,7 @@ run (const gchar *name, } } else - prn = fopen (stp_get_output_to(vars), "wb"); + prn = g_fopen (stp_get_output_to(vars), "wb"); if (prn != NULL) { @@ -776,7 +778,7 @@ printrc_load (void) filename = gimp_personal_rc_file ("printrc"); - if ((fp = fopen(filename, "r")) != NULL) + if ((fp = g_fopen(filename, "r")) != NULL) { /* * File exists - read the contents and update the printer list... @@ -1018,7 +1020,7 @@ printrc_save (void) filename = gimp_personal_rc_file ("printrc"); - if ((fp = fopen(filename, "w")) != NULL) + if ((fp = g_fopen(filename, "w")) != NULL) { /* * Write the contents of the printer list...