Convert to native encoding (if requested) only after expanding completely.

2004-01-11  Tor Lillqvist  <tml@iki.fi>

	* app/config/gimpconfig-path.c: Convert to native encoding (if
	requested) only after expanding completely. (Mentioned in #130118,
	patch by Sven.)

	* app/base/tile-swap.c
	* app/pdb/image_cmds.c
	* app/plug-in/plug-in.c
	* libgimp/gimp.c
	* libgimpbase/gimpdatafiles.c
	* libgimpbase/gimpenv.c
	* libgimpmodule/gimpmoduledb.c
	* plug-ins/common/bz2.c
	* plug-ins/common/gz.c
	* plug-ins/common/mail.c
	* plug-ins/common/ps.c
	* plug-ins/common/url.c
	* plug-ins/gfig/gfig-preview.c
	* plug-ins/helpbrowser/helpbrowser.c
	* plug-ins/print/print.c
	* plug-ins/script-fu/script-fu-scripts.c
	* tools/pdbgen/pdb/image.pdb: Remove __EMX__ ifdefs. EMX port is
	unmaintained, presumed dead. (#131109)
This commit is contained in:
Tor Lillqvist 2004-01-11 21:25:24 +00:00 committed by Tor Lillqvist
parent a9ed4eb605
commit 6ee79a7530
26 changed files with 101 additions and 535 deletions

View File

@ -1,3 +1,28 @@
2004-01-11 Tor Lillqvist <tml@iki.fi>
* app/config/gimpconfig-path.c: Convert to native encoding (if
requested) only after expanding completely. (Mentioned in #130118,
patch by Sven.)
* app/base/tile-swap.c
* app/pdb/image_cmds.c
* app/plug-in/plug-in.c
* libgimp/gimp.c
* libgimpbase/gimpdatafiles.c
* libgimpbase/gimpenv.c
* libgimpmodule/gimpmoduledb.c
* plug-ins/common/bz2.c
* plug-ins/common/gz.c
* plug-ins/common/mail.c
* plug-ins/common/ps.c
* plug-ins/common/url.c
* plug-ins/gfig/gfig-preview.c
* plug-ins/helpbrowser/helpbrowser.c
* plug-ins/print/print.c
* plug-ins/script-fu/script-fu-scripts.c
* tools/pdbgen/pdb/image.pdb: Remove __EMX__ ifdefs. EMX port is
unmaintained, presumed dead. (#131109)
2004-01-11 Dov Grobgeld <dov@imagic.weizmann.ac.il>
* plug-ins/common/CEL.c: fixed bug in registration

View File

@ -186,7 +186,7 @@ tile_swap_exit1 (gpointer key,
tile_swap_print_gaps (def_swap_file);
}
#if defined (__EMX__) || defined (G_OS_WIN32)
#ifdef G_OS_WIN32
/* should close before unlink */
if (swap_file->fd > 0)
{

View File

@ -35,7 +35,9 @@
#define SUBSTS_ALLOC 4
static inline gchar * extract_token (const gchar **str);
static gchar * gimp_config_path_expand_only (const gchar *path,
GError **error);
static inline gchar * extract_token (const gchar **str);
/**
@ -58,6 +60,30 @@ gchar *
gimp_config_path_expand (const gchar *path,
gboolean recode,
GError **error)
{
g_return_val_if_fail (path != NULL, NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
if (recode)
{
gchar *retval;
gchar *expanded = gimp_config_path_expand_only (path, error);
retval = g_filename_from_utf8 (expanded, -1, NULL, NULL, error);
g_free (expanded);
return retval;
}
else
{
return gimp_config_path_expand_only (path, error);
}
}
static gchar *
gimp_config_path_expand_only (const gchar *path,
GError **error)
{
const gchar *p;
const gchar *s;
@ -70,20 +96,7 @@ gimp_config_path_expand (const gchar *path,
gint length = 0;
gint i;
g_return_val_if_fail (path != NULL, NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
if (recode)
{
if (!(filename = g_filename_from_utf8 (path, -1, NULL, NULL, error)))
return NULL;
p = filename;
}
else
{
p = path;
}
p = path;
while (*p)
{
@ -163,11 +176,11 @@ gimp_config_path_expand (const gchar *path,
}
if (n_substs == 0)
return recode ? filename : g_strdup (path);
return g_strdup (path);
expanded = g_new (gchar, length + 1);
p = recode ? filename : path;
p = path;
n = expanded;
while (*p)

View File

@ -190,8 +190,6 @@ register_image_procs (Gimp *gimp)
#define FINITE(x) isfinite(x)
#elif defined (G_OS_WIN32)
#define FINITE(x) _finite(x)
#elif defined (__EMX__)
#define FINITE(x) isfinite(x)
#else
#error "no FINITE() implementation available?!"
#endif

View File

@ -62,13 +62,6 @@
#endif /* G_OS_WIN32 || G_WITH_CYGWIN */
#ifdef __EMX__
#include <fcntl.h>
#include <process.h>
#define _O_BINARY O_BINARY
#define _P_NOWAIT P_NOWAIT
#endif
#include "libgimpbase/gimpbase.h"
#include "libgimpbase/gimpprotocol.h"
#include "libgimpbase/gimpwire.h"
@ -323,7 +316,7 @@ plug_in_unref (PlugIn *plug_in)
static void
plug_in_prep_for_exec (gpointer data)
{
#if !defined(G_OS_WIN32) && !defined (G_WITH_CYGWIN) && !defined(__EMX__)
#if !defined(G_OS_WIN32) && !defined (G_WITH_CYGWIN)
PlugIn *plug_in = data;
g_io_channel_unref (plug_in->my_read);
@ -363,7 +356,7 @@ plug_in_open (PlugIn *plug_in)
return FALSE;
}
#if defined(G_WITH_CYGWIN) || defined(__EMX__)
#if defined(G_WITH_CYGWIN)
/* Set to binary mode */
setmode (my_read[0], _O_BINARY);
setmode (my_write[0], _O_BINARY);
@ -419,11 +412,6 @@ plug_in_open (PlugIn *plug_in)
stm = g_strdup_printf ("%d", plug_in->gimp->stack_trace_mode);
#ifdef __EMX__
fcntl (my_read[0], F_SETFD, 1);
fcntl (my_write[1], F_SETFD, 1);
#endif
args[0] = plug_in->prog;
args[1] = "-gimp";
args[2] = read_fd;

View File

@ -62,13 +62,6 @@
#endif /* G_OS_WIN32 || G_WITH_CYGWIN */
#ifdef __EMX__
#include <fcntl.h>
#include <process.h>
#define _O_BINARY O_BINARY
#define _P_NOWAIT P_NOWAIT
#endif
#include "libgimpbase/gimpbase.h"
#include "libgimpbase/gimpprotocol.h"
#include "libgimpbase/gimpwire.h"
@ -323,7 +316,7 @@ plug_in_unref (PlugIn *plug_in)
static void
plug_in_prep_for_exec (gpointer data)
{
#if !defined(G_OS_WIN32) && !defined (G_WITH_CYGWIN) && !defined(__EMX__)
#if !defined(G_OS_WIN32) && !defined (G_WITH_CYGWIN)
PlugIn *plug_in = data;
g_io_channel_unref (plug_in->my_read);
@ -363,7 +356,7 @@ plug_in_open (PlugIn *plug_in)
return FALSE;
}
#if defined(G_WITH_CYGWIN) || defined(__EMX__)
#if defined(G_WITH_CYGWIN)
/* Set to binary mode */
setmode (my_read[0], _O_BINARY);
setmode (my_write[0], _O_BINARY);
@ -419,11 +412,6 @@ plug_in_open (PlugIn *plug_in)
stm = g_strdup_printf ("%d", plug_in->gimp->stack_trace_mode);
#ifdef __EMX__
fcntl (my_read[0], F_SETFD, 1);
fcntl (my_write[1], F_SETFD, 1);
#endif
args[0] = plug_in->prog;
args[1] = "-gimp";
args[2] = read_fd;

View File

@ -88,10 +88,6 @@
# define USE_WIN32_SHM 1
#endif
#ifdef __EMX__
# include <fcntl.h>
#endif
#include <libintl.h>
#include <locale.h>
@ -347,10 +343,6 @@ gimp_main (const GimpPlugInInfo *info,
_readchannel = g_io_channel_unix_new (atoi (argv[2]));
_writechannel = g_io_channel_unix_new (atoi (argv[3]));
#ifdef __EMX__
setmode (g_io_channel_unix_get_fd (_readchannel), O_BINARY);
setmode (g_io_channel_unix_get_fd (_writechannel), O_BINARY);
#endif
g_io_channel_set_encoding (_readchannel, NULL, NULL);
g_io_channel_set_encoding (_writechannel, NULL, NULL);

View File

@ -132,16 +132,6 @@ gimp_datafiles_read_directories (const gchar *path_str,
for (list = path; list; list = g_list_next (list))
{
#ifdef __EMX__
/*
* Change drive so opendir works.
*/
if (((gchar *) list->data)[1] == ':')
{
_chdrive (((gchar *) list->data)[0]);
}
#endif
dir = g_dir_open ((gchar *) list->data, 0, NULL);
if (dir)

View File

@ -61,10 +61,6 @@
#define getegid() 0
#endif
#ifdef __EMX__
extern const char *__XOS2RedirRoot (const char *);
#endif
static gchar * gimp_env_get_dir (const gchar *gimp_env_name,
const gchar *env_dir);
@ -128,10 +124,6 @@ gimp_directory (void)
}
else
{
#ifdef __EMX__
gimp_dir = g_strdup (__XOS2RedirRoot (GIMPDIR));
return gimp_dir;
#endif
if (home_dir)
{
gimp_dir = g_build_filename (home_dir, GIMPDIR, NULL);
@ -474,10 +466,6 @@ gimp_path_parse (const gchar *path,
dir = g_string_new (patharray[i]);
}
#ifdef __EMX__
_fnslashify (dir);
#endif
if (check)
exists = g_file_test (dir->str, G_FILE_TEST_IS_DIR);
@ -615,20 +603,13 @@ gimp_env_get_dir (const gchar *gimp_env_name,
if (! g_path_is_absolute (env))
g_error ("%s environment variable should be an absolute path.",
gimp_env_name);
#ifndef __EMX__
return g_strdup (env);
#else
return g_strdup (__XOS2RedirRoot (env));
#endif
}
else
{
#ifndef __EMX__
gchar *retval = g_strdup (env_dir);
gimp_path_runtime_fix (&retval);
return retval;
#else
return g_strdup (__XOS2RedirRoot (env_dir));
#endif
}
}

View File

@ -35,7 +35,9 @@
#define SUBSTS_ALLOC 4
static inline gchar * extract_token (const gchar **str);
static gchar * gimp_config_path_expand_only (const gchar *path,
GError **error);
static inline gchar * extract_token (const gchar **str);
/**
@ -58,6 +60,30 @@ gchar *
gimp_config_path_expand (const gchar *path,
gboolean recode,
GError **error)
{
g_return_val_if_fail (path != NULL, NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
if (recode)
{
gchar *retval;
gchar *expanded = gimp_config_path_expand_only (path, error);
retval = g_filename_from_utf8 (expanded, -1, NULL, NULL, error);
g_free (expanded);
return retval;
}
else
{
return gimp_config_path_expand_only (path, error);
}
}
static gchar *
gimp_config_path_expand_only (const gchar *path,
GError **error)
{
const gchar *p;
const gchar *s;
@ -70,20 +96,7 @@ gimp_config_path_expand (const gchar *path,
gint length = 0;
gint i;
g_return_val_if_fail (path != NULL, NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
if (recode)
{
if (!(filename = g_filename_from_utf8 (path, -1, NULL, NULL, error)))
return NULL;
p = filename;
}
else
{
p = path;
}
p = path;
while (*p)
{
@ -163,11 +176,11 @@ gimp_config_path_expand (const gchar *path,
}
if (n_substs == 0)
return recode ? filename : g_strdup (path);
return g_strdup (path);
expanded = g_new (gchar, length + 1);
p = recode ? filename : path;
p = path;
n = expanded;
while (*p)

View File

@ -366,7 +366,7 @@ valid_module_name (const gchar *filename)
basename = g_path_get_basename (filename);
#if !defined(G_OS_WIN32) && !defined(G_WITH_CYGWIN) && !defined(__EMX__)
#if !defined(G_OS_WIN32) && !defined(G_WITH_CYGWIN)
if (strncmp (basename, "lib", 3))
goto no_module;

View File

@ -43,10 +43,6 @@
#include <string.h>
#include <unistd.h>
#include <errno.h>
#ifdef __EMX__
#include <fcntl.h>
#include <process.h>
#endif
#include <libgimp/gimp.h>
@ -207,46 +203,6 @@ run (const gchar *name,
values[0].data.d_status = status;
}
#ifdef __EMX__
static gint
spawn_bz (gchar *filename,
gchar *tmpname,
gchar *parms,
gint *pid)
{
FILE *f;
gint tfd;
if (!(f = fopen (filename,"wb")))
{
g_message ("fopen() failed: %s", g_strerror (errno));
return -1;
}
/* save fileno(stdout) */
tfd = dup (fileno (stdout));
/* make stdout for this process be the output file */
if (dup2 (fileno (f), fileno (stdout)) == -1)
{
g_message ("dup2() failed: %s", g_strerror (errno));
close (tfd);
return -1;
}
fcntl (tfd, F_SETFD, FD_CLOEXEC);
*pid = spawnlp (P_NOWAIT, "bzip2", "bzip2", parms, tmpname, NULL);
fclose (f);
/* restore fileno(stdout) */
dup2 (tfd, fileno (stdout));
close (tfd);
if (*pid == -1)
{
g_message ("spawn() failed: %s", g_strerror (errno));
return -1;
}
return 0;
}
#endif
static GimpPDBStatusType
save_image (const gchar *filename,
gint32 image_ID,
@ -280,7 +236,6 @@ save_image (const gchar *filename,
return GIMP_PDB_EXECUTION_ERROR;
}
#ifndef __EMX__
/* fork off a bzip2 process */
if ((pid = fork ()) < 0)
{
@ -308,13 +263,6 @@ save_image (const gchar *filename,
_exit (127);
}
else
#else /* __EMX__ */
if (spawn_bz (filename, tmpname, "-cf", &pid) == -1)
{
g_free (tmpname);
return GIMP_PDB_EXECUTION_ERROR;
}
#endif
{
wpid = waitpid (pid, &process_status, 0);
@ -356,7 +304,6 @@ load_image (const gchar *filename,
/* find a temp name */
tmpname = gimp_temp_name (ext + 1);
#ifndef __EMX__
/* fork off a bzip2 and wait for it */
if ((pid = fork ()) < 0)
{
@ -386,14 +333,6 @@ load_image (const gchar *filename,
_exit (127);
}
else /* parent process */
#else /* __EMX__ */
if (spawn_bz (tmpname, filename,"-cfd", &pid) == -1)
{
g_free (tmpname);
*status = GIMP_PDB_EXECUTION_ERROR;
return -1;
}
#endif
{
wpid = waitpid (pid, &process_status, 0);

View File

@ -74,11 +74,6 @@
#endif
#include <errno.h>
#ifdef __EMX__
#include <fcntl.h>
#include <process.h>
#endif
#include <libgimp/gimp.h>
#ifdef G_OS_WIN32
@ -256,46 +251,6 @@ run (const gchar *name,
values[0].data.d_status = status;
}
#ifdef __EMX__
static gint
spawn_gzip (gchar *filename,
gchar *tmpname,
gchar *parms,
gint *pid)
{
FILE *f;
gint tfd;
if (!(f = fopen (filename,"w")))
{
g_message ("fopen() failed: %s", g_strerror (errno));
return -1;
}
/* save fileno(stdout) */
tfd = dup (fileno (stdout));
/* make stdout for this process be the output file */
if (dup2 (fileno (f), fileno (stdout)) == -1)
{
g_message ("dup2() failed: %s", g_strerror (errno));
close (tfd);
return -1;
}
fcntl (tfd, F_SETFD, FD_CLOEXEC);
*pid = spawnlp (P_NOWAIT, "gzip", "gzip", parms, tmpname, NULL);
fclose (f);
/* restore fileno(stdout) */
dup2 (tfd, fileno (stdout));
close (tfd);
if (*pid == -1)
{
g_message ("spawnlp() failed: %s", g_strerror (errno));
return -1;
}
return 0;
}
#endif
static GimpPDBStatusType
save_image (const gchar *filename,
gint32 image_ID,
@ -338,14 +293,6 @@ save_image (const gchar *filename,
}
#ifndef G_OS_WIN32
#ifdef __EMX__
if (spawn_gzip (filename, tmpname, "-cfn", &pid) == -1)
{
g_free (tmpname);
return GIMP_PDB_EXECUTION_ERROR;
}
sleep (2); /* silly wait */
#else /* UNIX */
/* fork off a gzip process */
if ((pid = fork ()) < 0)
{
@ -386,7 +333,6 @@ save_image (const gchar *filename,
return 0;
}
}
#endif
#else /* G_OS_WIN32 */
in = fopen (tmpname, "rb");
out = fopen (filename, "wb");
@ -452,14 +398,6 @@ load_image (const gchar *filename,
tmpname = gimp_temp_name (ext + 1);
#ifndef G_OS_WIN32
#ifdef __EMX__
if (spawn_gzip (tmpname, filename, "-cfd", &pid) == -1)
{
g_free (tmpname);
*status = GIMP_PDB_EXECUTION_ERROR;
return -1;
}
#else /* UNIX */
/* fork off a g(un)zip and wait for it */
if ((pid = fork ()) < 0)
{
@ -505,7 +443,6 @@ load_image (const gchar *filename,
return -1;
}
}
#endif
#else
in = fopen (filename, "rb");
out = fopen (tmpname, "wb");

View File

@ -74,11 +74,6 @@
#endif
#include <errno.h>
#ifdef __EMX__
#include <fcntl.h>
#include <process.h>
#endif
#include <libgimp/gimp.h>
#ifdef G_OS_WIN32
@ -256,46 +251,6 @@ run (const gchar *name,
values[0].data.d_status = status;
}
#ifdef __EMX__
static gint
spawn_gzip (gchar *filename,
gchar *tmpname,
gchar *parms,
gint *pid)
{
FILE *f;
gint tfd;
if (!(f = fopen (filename,"w")))
{
g_message ("fopen() failed: %s", g_strerror (errno));
return -1;
}
/* save fileno(stdout) */
tfd = dup (fileno (stdout));
/* make stdout for this process be the output file */
if (dup2 (fileno (f), fileno (stdout)) == -1)
{
g_message ("dup2() failed: %s", g_strerror (errno));
close (tfd);
return -1;
}
fcntl (tfd, F_SETFD, FD_CLOEXEC);
*pid = spawnlp (P_NOWAIT, "gzip", "gzip", parms, tmpname, NULL);
fclose (f);
/* restore fileno(stdout) */
dup2 (tfd, fileno (stdout));
close (tfd);
if (*pid == -1)
{
g_message ("spawnlp() failed: %s", g_strerror (errno));
return -1;
}
return 0;
}
#endif
static GimpPDBStatusType
save_image (const gchar *filename,
gint32 image_ID,
@ -338,14 +293,6 @@ save_image (const gchar *filename,
}
#ifndef G_OS_WIN32
#ifdef __EMX__
if (spawn_gzip (filename, tmpname, "-cfn", &pid) == -1)
{
g_free (tmpname);
return GIMP_PDB_EXECUTION_ERROR;
}
sleep (2); /* silly wait */
#else /* UNIX */
/* fork off a gzip process */
if ((pid = fork ()) < 0)
{
@ -386,7 +333,6 @@ save_image (const gchar *filename,
return 0;
}
}
#endif
#else /* G_OS_WIN32 */
in = fopen (tmpname, "rb");
out = fopen (filename, "wb");
@ -452,14 +398,6 @@ load_image (const gchar *filename,
tmpname = gimp_temp_name (ext + 1);
#ifndef G_OS_WIN32
#ifdef __EMX__
if (spawn_gzip (tmpname, filename, "-cfd", &pid) == -1)
{
g_free (tmpname);
*status = GIMP_PDB_EXECUTION_ERROR;
return -1;
}
#else /* UNIX */
/* fork off a g(un)zip and wait for it */
if ((pid = fork ()) < 0)
{
@ -505,7 +443,6 @@ load_image (const gchar *filename,
return -1;
}
}
#endif
#else
in = fopen (filename, "rb");
out = fopen (tmpname, "wb");

View File

@ -115,10 +115,6 @@
#include <string.h>
#include <unistd.h>
#include <errno.h>
#ifdef __EMX__
#include <fcntl.h>
#include <process.h>
#endif
#include <gtk/gtk.h>
@ -329,11 +325,8 @@ save_image (const gchar *filename,
strcat (mailcmdline, mail_info.receipt);
/* create a pipe to sendmail */
#ifndef __EMX__
mailpipe = popen (mailcmdline, "w");
#else
mailpipe = popen (mailcmdline, "wb");
#endif
create_headers (mailpipe);
/* This is necessary to make the comments and headers work correctly. Not real sure why */
@ -352,7 +345,6 @@ save_image (const gchar *filename,
if (mail_info.encapsulation == ENCAPSULATION_UUENCODE)
{
#ifndef __EMX__
/* fork off a uuencode process */
if ((pid = fork ()) < 0)
{
@ -377,29 +369,6 @@ save_image (const gchar *filename,
_exit (127);
}
else
#else /* __EMX__ */
int tfd;
/* save fileno(stdout) */
tfd = dup (fileno (stdout));
if (dup2 (fileno (mailpipe), fileno (stdout)) == -1)
{
g_message ("dup2() failed: %s", g_strerror (errno));
close (tfd);
g_free (tmpname);
return GIMP_PDB_EXECUTION_ERROR;
}
fcntl (tfd, F_SETFD, FD_CLOEXEC);
pid = spawnlp (P_NOWAIT, UUENCODE, UUENCODE, tmpname, filename, NULL);
/* restore fileno(stdout) */
dup2 (tfd, fileno (stdout));
close (tfd);
if (pid == -1)
{
g_message ("spawn failed: %s", g_strerror (errno));
g_free (tmpname);
return GIMP_PDB_EXECUTION_ERROR;
}
#endif
{
wpid = waitpid (pid, &process_status, 0);

View File

@ -1390,11 +1390,7 @@ ps_open (const gchar *filename,
#ifndef USE_REAL_OUTPUTFILE
/* Start the command and use a pipe for reading the PNM-file. */
#ifndef __EMX__
fd_popen = popen (cmd, "r");
#else
fd_popen = popen (cmd, "rb");
#endif
#else
/* If someone does not like the pipe (or it does not work), just start */
/* ghostscript with a real outputfile. When ghostscript has finished, */
@ -1474,7 +1470,7 @@ read_pnmraw_type (FILE *ifp,
for (;;)
{
if (thrd == EOF) return (-1);
#if defined (__EMX__) || defined (WIN32)
#if defined (WIN32)
if (thrd == '\r') thrd = getc (ifp);
#endif
if ((thrd == '\n') && (frst == 'P') && (scnd >= '1') && (scnd <= '6'))

View File

@ -1390,11 +1390,7 @@ ps_open (const gchar *filename,
#ifndef USE_REAL_OUTPUTFILE
/* Start the command and use a pipe for reading the PNM-file. */
#ifndef __EMX__
fd_popen = popen (cmd, "r");
#else
fd_popen = popen (cmd, "rb");
#endif
#else
/* If someone does not like the pipe (or it does not work), just start */
/* ghostscript with a real outputfile. When ghostscript has finished, */
@ -1474,7 +1470,7 @@ read_pnmraw_type (FILE *ifp,
for (;;)
{
if (thrd == EOF) return (-1);
#if defined (__EMX__) || defined (WIN32)
#if defined (WIN32)
if (thrd == '\r') thrd = getc (ifp);
#endif
if ((thrd == '\n') && (frst == 'P') && (scnd >= '1') && (scnd <= '6'))

View File

@ -28,10 +28,6 @@
#include <unistd.h>
#include <errno.h>
#ifdef __EMX__
#include <process.h>
#endif
#include <libgimp/gimp.h>
#include "libgimp/stdplugins-intl.h"
@ -157,7 +153,6 @@ load_image (const gchar *filename,
tmpname = gimp_temp_name (ext + 1);
#ifndef __EMX__
if (pipe (p) != 0)
{
g_message ("pipe() failed: %s", g_strerror (errno));
@ -406,33 +401,6 @@ read_connect:
}
}
}
#else /* __EMX__ */
{
pid = spawnlp (P_NOWAIT,
"wget",
"wget", "-T", TIMEOUT, filename, "-O", tmpname, NULL);
if (pid == -1)
{
g_message ("spawn failed: %s", g_strerror (errno));
g_free (tmpname);
*status = GIMP_PDB_EXECUTION_ERROR;
return -1;
}
wpid = waitpid (pid, &process_status, 0);
if ((wpid < 0)
|| !WIFEXITED (process_status)
|| (WEXITSTATUS (process_status) != 0))
{
g_message ("wget exited abnormally on URL\n'%s'", filename);
g_free (tmpname);
*status = GIMP_PDB_EXECUTION_ERROR;
return -1;
}
}
#endif
image_ID = gimp_file_load (GIMP_RUN_INTERACTIVE, tmpname, tmpname);

View File

@ -587,20 +587,12 @@ gfig_update_stat_labels (void)
gint slen;
gchar *hm = (gchar *) g_get_home_dir ();
gchar *dfn = g_strdup (current_obj->filename);
#ifdef __EMX__
if (hm)
hm = _fnslashify (hm);
#endif
#ifndef __EMX__
if (hm != NULL && !strncmp (dfn, hm, strlen (hm)-1))
#else
if (hm != NULL && !strnicmp (dfn, hm, strlen (hm)-1))
#endif
{
strcpy (dfn, "~");
strcat (dfn, &dfn[strlen (hm)]);
}
{
strcpy (dfn, "~");
strcat (dfn, &dfn[strlen (hm)]);
}
if ((slen = strlen (dfn)) > 40)
{
strncpy (str, dfn, 19);

View File

@ -40,10 +40,6 @@
/* defines */
#ifdef __EMX__
#define chdir _chdir2
#endif
#define GIMP_HELP_EXT_NAME "extension_gimp_help_browser"
#define GIMP_HELP_TEMP_EXT_NAME "extension_gimp_help_browser_temp"

View File

@ -27,11 +27,6 @@
#include <sys/types.h>
#include <signal.h>
#include <sys/wait.h>
#ifdef __EMX__
#define INCL_DOSDEVICES
#define INCL_DOSERRORS
#include <os2.h>
#endif
#include <unistd.h>
#include <stdio.h>
@ -173,25 +168,6 @@ query (void)
args, NULL);
}
#ifdef __EMX__
static char *
get_tmp_filename()
{
char *tmp_path, *s, filename[80];
tmp_path = getenv("TMP");
if (tmp_path == NULL)
tmp_path = "";
sprintf(filename, "gimp_print_tmp.%d", getpid());
s = tmp_path = g_strconcat(tmp_path, "\\", filename, NULL);
if (!s)
return NULL;
for ( ; *s; s++)
if (*s == '/') *s = '\\';
return tmp_path;
}
#endif
/*
* 'usr1_handler()' - Make a note when we receive SIGUSR1.
@ -234,9 +210,6 @@ run (const gchar *name,
FILE *prn = NULL; /* Print file/command */
gint ncolors; /* Number of colors in colormap */
GimpParam values[1]; /* Return values */
#ifdef __EMX__
gchar *tmpfile; /* temp filename */
#endif
gint32 drawable_ID; /* drawable ID */
GimpExportReturn export = GIMP_EXPORT_CANCEL; /* return value of gimp_export_image() */
gint ppid = getpid (); /* PID of plugin */
@ -427,8 +400,7 @@ run (const gchar *name,
*/
if (plist_current > 0)
#ifndef __EMX__
{
{
/*
* The following IPC code is only necessary because the GIMP kills
* plugins with SIGKILL if its "Cancel" button is pressed; this
@ -498,10 +470,6 @@ run (const gchar *name,
}
}
}
#else
/* OS/2 PRINT command doesn't support print from stdin, use temp file */
prn = (tmpfile = get_tmp_filename ()) ? fopen (tmpfile, "w") : NULL;
#endif
else
prn = fopen (stp_get_output_to(vars), "wb");
@ -538,24 +506,11 @@ run (const gchar *name,
values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
if (plist_current > 0)
#ifndef __EMX__
{
fclose (prn);
kill (cpid, SIGUSR1);
waitpid (cpid, &dummy, 0);
}
#else
{ /* PRINT temp file */
gchar *s;
fclose (prn);
s = g_strconcat (stp_get_output_to (vars), tmpfile, NULL);
if (system(s) != 0)
values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
g_free (s);
remove (tmpfile);
g_free (tmpfile);
}
#endif
else
fclose (prn);
print_finished = 1;
@ -815,15 +770,7 @@ printrc_load (void)
filename = gimp_personal_rc_file ("printrc");
#ifdef __EMX__
_fnslashify(filename);
#endif
#ifndef __EMX__
if ((fp = fopen(filename, "r")) != NULL)
#else
if ((fp = fopen(filename, "rt")) != NULL)
#endif
{
/*
* File exists - read the contents and update the printer list...
@ -1065,15 +1012,7 @@ printrc_save (void)
filename = gimp_personal_rc_file ("printrc");
#ifdef __EMX__
_fnslashify(filename);
#endif
#ifndef __EMX__
if ((fp = fopen(filename, "w")) != NULL)
#else
if ((fp = fopen(filename, "wt")) != NULL)
#endif
{
/*
* Write the contents of the printer list...
@ -1159,9 +1098,7 @@ get_system_printers (void)
char line[255]; /* Line from status command */
char *ptr; /* Pointer into line */
char name[128]; /* Printer name from status command */
#ifdef __EMX__
BYTE pnum;
#endif
static const char *lpcs[] = /* Possible locations of LPC... */
{
"/etc"
@ -1283,21 +1220,6 @@ get_system_printers (void)
}
}
#ifdef __EMX__
if (DosDevConfig(&pnum, DEVINFO_PRINTER) == NO_ERROR)
{
for (i = 1; i <= pnum; i++)
{
check_plist(plist_count + 1);
initialize_printer(&plist[plist_count]);
sprintf(plist[plist_count].name, "LPT%d:", i);
sprintf(plist[plist_count].v.output_to, "PRINT /D:LPT%d /B ", i);
strcpy(plist[plist_count].v.driver, "ps2");
plist_count ++;
}
}
#endif
if (plist_count > 2)
qsort(plist + 1, plist_count - 1, sizeof(gp_plist_t),
(int (*)(const void *, const void *))compare_printers);

View File

@ -673,10 +673,6 @@ script_fu_load_script (const GimpDatafileData *file_data,
gchar *command;
gchar *qf = g_strescape (file_data->filename, NULL);
#ifdef __EMX__
_fnslashify (qf);
#endif
command = g_strdup_printf ("(load \"%s\")", qf);
g_free (qf);

View File

@ -673,10 +673,6 @@ script_fu_load_script (const GimpDatafileData *file_data,
gchar *command;
gchar *qf = g_strescape (file_data->filename, NULL);
#ifdef __EMX__
_fnslashify (qf);
#endif
command = g_strdup_printf ("(load \"%s\")", qf);
g_free (qf);

View File

@ -28,10 +28,6 @@
#include <unistd.h>
#include <errno.h>
#ifdef __EMX__
#include <process.h>
#endif
#include <libgimp/gimp.h>
#include "libgimp/stdplugins-intl.h"
@ -157,7 +153,6 @@ load_image (const gchar *filename,
tmpname = gimp_temp_name (ext + 1);
#ifndef __EMX__
if (pipe (p) != 0)
{
g_message ("pipe() failed: %s", g_strerror (errno));
@ -406,33 +401,6 @@ read_connect:
}
}
}
#else /* __EMX__ */
{
pid = spawnlp (P_NOWAIT,
"wget",
"wget", "-T", TIMEOUT, filename, "-O", tmpname, NULL);
if (pid == -1)
{
g_message ("spawn failed: %s", g_strerror (errno));
g_free (tmpname);
*status = GIMP_PDB_EXECUTION_ERROR;
return -1;
}
wpid = waitpid (pid, &process_status, 0);
if ((wpid < 0)
|| !WIFEXITED (process_status)
|| (WEXITSTATUS (process_status) != 0))
{
g_message ("wget exited abnormally on URL\n'%s'", filename);
g_free (tmpname);
*status = GIMP_PDB_EXECUTION_ERROR;
return -1;
}
}
#endif
image_ID = gimp_file_load (GIMP_RUN_INTERACTIVE, tmpname, tmpname);

View File

@ -28,10 +28,6 @@
#include <unistd.h>
#include <errno.h>
#ifdef __EMX__
#include <process.h>
#endif
#include <libgimp/gimp.h>
#include "libgimp/stdplugins-intl.h"
@ -157,7 +153,6 @@ load_image (const gchar *filename,
tmpname = gimp_temp_name (ext + 1);
#ifndef __EMX__
if (pipe (p) != 0)
{
g_message ("pipe() failed: %s", g_strerror (errno));
@ -406,33 +401,6 @@ read_connect:
}
}
}
#else /* __EMX__ */
{
pid = spawnlp (P_NOWAIT,
"wget",
"wget", "-T", TIMEOUT, filename, "-O", tmpname, NULL);
if (pid == -1)
{
g_message ("spawn failed: %s", g_strerror (errno));
g_free (tmpname);
*status = GIMP_PDB_EXECUTION_ERROR;
return -1;
}
wpid = waitpid (pid, &process_status, 0);
if ((wpid < 0)
|| !WIFEXITED (process_status)
|| (WEXITSTATUS (process_status) != 0))
{
g_message ("wget exited abnormally on URL\n'%s'", filename);
g_free (tmpname);
*status = GIMP_PDB_EXECUTION_ERROR;
return -1;
}
}
#endif
image_ID = gimp_file_load (GIMP_RUN_INTERACTIVE, tmpname, tmpname);

View File

@ -1507,8 +1507,6 @@ $extra{app}->{code} = <<'CODE';
#define FINITE(x) isfinite(x)
#elif defined (G_OS_WIN32)
#define FINITE(x) _finite(x)
#elif defined (__EMX__)
#define FINITE(x) isfinite(x)
#else
#error "no FINITE() implementation available?!"
#endif