Some more debugging output. (g_io_channel_win32_poll): Remove unused vars.

2000-10-16  Tor Lillqvist  <tml@iki.fi>

	* giowin32.c (reader_thread): Some more debugging output.
	(g_io_channel_win32_poll): Remove unused vars.

	* gfileutils.c: Changes for Win32, with no unistd.h and no
	S_ISLNK().

	* gspawn-win32.c: Implementation of the g_spwan_* functions for
	Win32. Due to the general non-Unixness of Win32, much of the
	functionality that is relatively clean to implement on Unix, is
	hard to do on Win32. We must use a separate helper program to
	change directory, close extra file descriptors, redirect the std
	ones, as needed, and only then start the child process. No child
	process pid can be returned, unfortunately. Or if we used
	CreateProcess directly, it probably could. (Now we use the spawnv*
	functions from msvcrt.)

	* glib.def: Add new entry points.

	* glib.def
	* giowin32.c: Remove g_io_channel_win32_wait_for_condition(),
	g_io_channel_win32_poll() subsumes it.

	* gbacktrace.h: G_BREAKPOINT for MSVC (on the ix86).

	* gwin32.c (g_win32_getlocale): Use "sp" for
	LANG_CROATIAN+SUBLANG_SERBIAN_LATIN.

	* makefile.{mingw,msc}.in (glib_OBJECTS): Add new files.
	Add gspawn-win32-helper.exe rule.

	* tests/makefile.{mingw,msc}.in (TESTS): Add shell-test and
	spawn-test.

	* tests/spawn-test.c: (run_tests): On Win32, don't try to run
	/bin/sh, but ipconfig (no special significance in choosing that,
	just a program that outputs something to stdout).
This commit is contained in:
Tor Lillqvist 2000-10-16 18:54:29 +00:00 committed by Tor Lillqvist
parent a626a650e5
commit fb4de1c50d
27 changed files with 2818 additions and 44 deletions

View File

@ -1,3 +1,42 @@
2000-10-16 Tor Lillqvist <tml@iki.fi>
* giowin32.c (reader_thread): Some more debugging output.
(g_io_channel_win32_poll): Remove unused vars.
* gfileutils.c: Changes for Win32, with no unistd.h and no
S_ISLNK().
* gspawn-win32.c: Implementation of the g_spwan_* functions for
Win32. Due to the general non-Unixness of Win32, much of the
functionality that is relatively clean to implement on Unix, is
hard to do on Win32. We must use a separate helper program to
change directory, close extra file descriptors, redirect the std
ones, as needed, and only then start the child process. No child
process pid can be returned, unfortunately. Or if we used
CreateProcess directly, it probably could. (Now we use the spawnv*
functions from msvcrt.)
* glib.def: Add new entry points.
* glib.def
* giowin32.c: Remove g_io_channel_win32_wait_for_condition(),
g_io_channel_win32_poll() subsumes it.
* gbacktrace.h: G_BREAKPOINT for MSVC (on the ix86).
* gwin32.c (g_win32_getlocale): Use "sp" for
LANG_CROATIAN+SUBLANG_SERBIAN_LATIN.
* makefile.{mingw,msc}.in (glib_OBJECTS): Add new files.
Add gspawn-win32-helper.exe rule.
* tests/makefile.{mingw,msc}.in (TESTS): Add shell-test and
spawn-test.
* tests/spawn-test.c: (run_tests): On Win32, don't try to run
/bin/sh, but ipconfig (no special significance in choosing that,
just a program that outputs something to stdout).
2000-10-15 Raja R Harinath <harinath@cs.umn.edu>
Remove need for acconfig.h, and misc. cleanups.

View File

@ -1,3 +1,42 @@
2000-10-16 Tor Lillqvist <tml@iki.fi>
* giowin32.c (reader_thread): Some more debugging output.
(g_io_channel_win32_poll): Remove unused vars.
* gfileutils.c: Changes for Win32, with no unistd.h and no
S_ISLNK().
* gspawn-win32.c: Implementation of the g_spwan_* functions for
Win32. Due to the general non-Unixness of Win32, much of the
functionality that is relatively clean to implement on Unix, is
hard to do on Win32. We must use a separate helper program to
change directory, close extra file descriptors, redirect the std
ones, as needed, and only then start the child process. No child
process pid can be returned, unfortunately. Or if we used
CreateProcess directly, it probably could. (Now we use the spawnv*
functions from msvcrt.)
* glib.def: Add new entry points.
* glib.def
* giowin32.c: Remove g_io_channel_win32_wait_for_condition(),
g_io_channel_win32_poll() subsumes it.
* gbacktrace.h: G_BREAKPOINT for MSVC (on the ix86).
* gwin32.c (g_win32_getlocale): Use "sp" for
LANG_CROATIAN+SUBLANG_SERBIAN_LATIN.
* makefile.{mingw,msc}.in (glib_OBJECTS): Add new files.
Add gspawn-win32-helper.exe rule.
* tests/makefile.{mingw,msc}.in (TESTS): Add shell-test and
spawn-test.
* tests/spawn-test.c: (run_tests): On Win32, don't try to run
/bin/sh, but ipconfig (no special significance in choosing that,
just a program that outputs something to stdout).
2000-10-15 Raja R Harinath <harinath@cs.umn.edu>
Remove need for acconfig.h, and misc. cleanups.

View File

@ -1,3 +1,42 @@
2000-10-16 Tor Lillqvist <tml@iki.fi>
* giowin32.c (reader_thread): Some more debugging output.
(g_io_channel_win32_poll): Remove unused vars.
* gfileutils.c: Changes for Win32, with no unistd.h and no
S_ISLNK().
* gspawn-win32.c: Implementation of the g_spwan_* functions for
Win32. Due to the general non-Unixness of Win32, much of the
functionality that is relatively clean to implement on Unix, is
hard to do on Win32. We must use a separate helper program to
change directory, close extra file descriptors, redirect the std
ones, as needed, and only then start the child process. No child
process pid can be returned, unfortunately. Or if we used
CreateProcess directly, it probably could. (Now we use the spawnv*
functions from msvcrt.)
* glib.def: Add new entry points.
* glib.def
* giowin32.c: Remove g_io_channel_win32_wait_for_condition(),
g_io_channel_win32_poll() subsumes it.
* gbacktrace.h: G_BREAKPOINT for MSVC (on the ix86).
* gwin32.c (g_win32_getlocale): Use "sp" for
LANG_CROATIAN+SUBLANG_SERBIAN_LATIN.
* makefile.{mingw,msc}.in (glib_OBJECTS): Add new files.
Add gspawn-win32-helper.exe rule.
* tests/makefile.{mingw,msc}.in (TESTS): Add shell-test and
spawn-test.
* tests/spawn-test.c: (run_tests): On Win32, don't try to run
/bin/sh, but ipconfig (no special significance in choosing that,
just a program that outputs something to stdout).
2000-10-15 Raja R Harinath <harinath@cs.umn.edu>
Remove need for acconfig.h, and misc. cleanups.

View File

@ -1,3 +1,42 @@
2000-10-16 Tor Lillqvist <tml@iki.fi>
* giowin32.c (reader_thread): Some more debugging output.
(g_io_channel_win32_poll): Remove unused vars.
* gfileutils.c: Changes for Win32, with no unistd.h and no
S_ISLNK().
* gspawn-win32.c: Implementation of the g_spwan_* functions for
Win32. Due to the general non-Unixness of Win32, much of the
functionality that is relatively clean to implement on Unix, is
hard to do on Win32. We must use a separate helper program to
change directory, close extra file descriptors, redirect the std
ones, as needed, and only then start the child process. No child
process pid can be returned, unfortunately. Or if we used
CreateProcess directly, it probably could. (Now we use the spawnv*
functions from msvcrt.)
* glib.def: Add new entry points.
* glib.def
* giowin32.c: Remove g_io_channel_win32_wait_for_condition(),
g_io_channel_win32_poll() subsumes it.
* gbacktrace.h: G_BREAKPOINT for MSVC (on the ix86).
* gwin32.c (g_win32_getlocale): Use "sp" for
LANG_CROATIAN+SUBLANG_SERBIAN_LATIN.
* makefile.{mingw,msc}.in (glib_OBJECTS): Add new files.
Add gspawn-win32-helper.exe rule.
* tests/makefile.{mingw,msc}.in (TESTS): Add shell-test and
spawn-test.
* tests/spawn-test.c: (run_tests): On Win32, don't try to run
/bin/sh, but ipconfig (no special significance in choosing that,
just a program that outputs something to stdout).
2000-10-15 Raja R Harinath <harinath@cs.umn.edu>
Remove need for acconfig.h, and misc. cleanups.

View File

@ -1,3 +1,42 @@
2000-10-16 Tor Lillqvist <tml@iki.fi>
* giowin32.c (reader_thread): Some more debugging output.
(g_io_channel_win32_poll): Remove unused vars.
* gfileutils.c: Changes for Win32, with no unistd.h and no
S_ISLNK().
* gspawn-win32.c: Implementation of the g_spwan_* functions for
Win32. Due to the general non-Unixness of Win32, much of the
functionality that is relatively clean to implement on Unix, is
hard to do on Win32. We must use a separate helper program to
change directory, close extra file descriptors, redirect the std
ones, as needed, and only then start the child process. No child
process pid can be returned, unfortunately. Or if we used
CreateProcess directly, it probably could. (Now we use the spawnv*
functions from msvcrt.)
* glib.def: Add new entry points.
* glib.def
* giowin32.c: Remove g_io_channel_win32_wait_for_condition(),
g_io_channel_win32_poll() subsumes it.
* gbacktrace.h: G_BREAKPOINT for MSVC (on the ix86).
* gwin32.c (g_win32_getlocale): Use "sp" for
LANG_CROATIAN+SUBLANG_SERBIAN_LATIN.
* makefile.{mingw,msc}.in (glib_OBJECTS): Add new files.
Add gspawn-win32-helper.exe rule.
* tests/makefile.{mingw,msc}.in (TESTS): Add shell-test and
spawn-test.
* tests/spawn-test.c: (run_tests): On Win32, don't try to run
/bin/sh, but ipconfig (no special significance in choosing that,
just a program that outputs something to stdout).
2000-10-15 Raja R Harinath <harinath@cs.umn.edu>
Remove need for acconfig.h, and misc. cleanups.

View File

@ -1,3 +1,42 @@
2000-10-16 Tor Lillqvist <tml@iki.fi>
* giowin32.c (reader_thread): Some more debugging output.
(g_io_channel_win32_poll): Remove unused vars.
* gfileutils.c: Changes for Win32, with no unistd.h and no
S_ISLNK().
* gspawn-win32.c: Implementation of the g_spwan_* functions for
Win32. Due to the general non-Unixness of Win32, much of the
functionality that is relatively clean to implement on Unix, is
hard to do on Win32. We must use a separate helper program to
change directory, close extra file descriptors, redirect the std
ones, as needed, and only then start the child process. No child
process pid can be returned, unfortunately. Or if we used
CreateProcess directly, it probably could. (Now we use the spawnv*
functions from msvcrt.)
* glib.def: Add new entry points.
* glib.def
* giowin32.c: Remove g_io_channel_win32_wait_for_condition(),
g_io_channel_win32_poll() subsumes it.
* gbacktrace.h: G_BREAKPOINT for MSVC (on the ix86).
* gwin32.c (g_win32_getlocale): Use "sp" for
LANG_CROATIAN+SUBLANG_SERBIAN_LATIN.
* makefile.{mingw,msc}.in (glib_OBJECTS): Add new files.
Add gspawn-win32-helper.exe rule.
* tests/makefile.{mingw,msc}.in (TESTS): Add shell-test and
spawn-test.
* tests/spawn-test.c: (run_tests): On Win32, don't try to run
/bin/sh, but ipconfig (no special significance in choosing that,
just a program that outputs something to stdout).
2000-10-15 Raja R Harinath <harinath@cs.umn.edu>
Remove need for acconfig.h, and misc. cleanups.

View File

@ -1,3 +1,42 @@
2000-10-16 Tor Lillqvist <tml@iki.fi>
* giowin32.c (reader_thread): Some more debugging output.
(g_io_channel_win32_poll): Remove unused vars.
* gfileutils.c: Changes for Win32, with no unistd.h and no
S_ISLNK().
* gspawn-win32.c: Implementation of the g_spwan_* functions for
Win32. Due to the general non-Unixness of Win32, much of the
functionality that is relatively clean to implement on Unix, is
hard to do on Win32. We must use a separate helper program to
change directory, close extra file descriptors, redirect the std
ones, as needed, and only then start the child process. No child
process pid can be returned, unfortunately. Or if we used
CreateProcess directly, it probably could. (Now we use the spawnv*
functions from msvcrt.)
* glib.def: Add new entry points.
* glib.def
* giowin32.c: Remove g_io_channel_win32_wait_for_condition(),
g_io_channel_win32_poll() subsumes it.
* gbacktrace.h: G_BREAKPOINT for MSVC (on the ix86).
* gwin32.c (g_win32_getlocale): Use "sp" for
LANG_CROATIAN+SUBLANG_SERBIAN_LATIN.
* makefile.{mingw,msc}.in (glib_OBJECTS): Add new files.
Add gspawn-win32-helper.exe rule.
* tests/makefile.{mingw,msc}.in (TESTS): Add shell-test and
spawn-test.
* tests/spawn-test.c: (run_tests): On Win32, don't try to run
/bin/sh, but ipconfig (no special significance in choosing that,
just a program that outputs something to stdout).
2000-10-15 Raja R Harinath <harinath@cs.umn.edu>
Remove need for acconfig.h, and misc. cleanups.

View File

@ -1,3 +1,42 @@
2000-10-16 Tor Lillqvist <tml@iki.fi>
* giowin32.c (reader_thread): Some more debugging output.
(g_io_channel_win32_poll): Remove unused vars.
* gfileutils.c: Changes for Win32, with no unistd.h and no
S_ISLNK().
* gspawn-win32.c: Implementation of the g_spwan_* functions for
Win32. Due to the general non-Unixness of Win32, much of the
functionality that is relatively clean to implement on Unix, is
hard to do on Win32. We must use a separate helper program to
change directory, close extra file descriptors, redirect the std
ones, as needed, and only then start the child process. No child
process pid can be returned, unfortunately. Or if we used
CreateProcess directly, it probably could. (Now we use the spawnv*
functions from msvcrt.)
* glib.def: Add new entry points.
* glib.def
* giowin32.c: Remove g_io_channel_win32_wait_for_condition(),
g_io_channel_win32_poll() subsumes it.
* gbacktrace.h: G_BREAKPOINT for MSVC (on the ix86).
* gwin32.c (g_win32_getlocale): Use "sp" for
LANG_CROATIAN+SUBLANG_SERBIAN_LATIN.
* makefile.{mingw,msc}.in (glib_OBJECTS): Add new files.
Add gspawn-win32-helper.exe rule.
* tests/makefile.{mingw,msc}.in (TESTS): Add shell-test and
spawn-test.
* tests/spawn-test.c: (run_tests): On Win32, don't try to run
/bin/sh, but ipconfig (no special significance in choosing that,
just a program that outputs something to stdout).
2000-10-15 Raja R Harinath <harinath@cs.umn.edu>
Remove need for acconfig.h, and misc. cleanups.

View File

@ -48,6 +48,8 @@ void g_on_error_stack_trace (const gchar *prg_name);
*/
#if defined (__i386__) && defined (__GNUC__) && __GNUC__ >= 2
# define G_BREAKPOINT() G_STMT_START{ __asm__ __volatile__ ("int $03"); }G_STMT_END
#elif defined (_MSC_VER) && defined (_M_IX86)
# define G_BREAKPOINT() G_STMT_START{ __asm int 3h }G_STMT_END
#elif defined (__alpha__) && defined (__GNUC__) && __GNUC__ >= 2
# define G_BREAKPOINT() G_STMT_START{ __asm__ __volatile__ ("bpt"); }G_STMT_END
#else /* !__i386__ && !__alpha__ */

View File

@ -18,10 +18,14 @@
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "glib.h"
#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <stdio.h>
#include <string.h>
#include <errno.h>
@ -29,6 +33,9 @@
#include <sys/stat.h>
#include <fcntl.h>
#ifndef S_ISLNK
# define S_ISLNK(x) 0
#endif
#define _(x) x
@ -279,6 +286,8 @@ get_contents_stdio (const gchar *filename,
return TRUE;
}
#ifndef G_OS_WIN32
static gboolean
get_contents_regfile (const gchar *filename,
struct stat *stat_buf,
@ -401,7 +410,8 @@ get_contents_posix (const gchar *filename,
}
}
#ifdef G_OS_WIN32
#else /* G_OS_WIN32 */
static gboolean
get_contents_win32 (const gchar *filename,
gchar **contents,
@ -426,6 +436,7 @@ get_contents_win32 (const gchar *filename,
return get_contents_stdio (filename, f, contents, length, error);
}
#endif
/**
@ -467,4 +478,3 @@ g_file_get_contents (const gchar *filename,
return get_contents_posix (filename, contents, length, error);
#endif
}

View File

@ -201,6 +201,10 @@ reader_thread (void *parameter)
nbytes = MIN ((channel->rdp + BUFFER_SIZE - channel->wrp - 1) % BUFFER_SIZE,
BUFFER_SIZE - channel->wrp);
if (channel->debug)
g_print ("thread %#x: calling reader for %d bytes\n",
channel->thread_id, nbytes);
UNLOCK (channel->mutex);
nbytes = (*channel->reader) (channel->fd, buffer, nbytes);
@ -876,9 +880,7 @@ g_io_channel_win32_poll (GPollFD *fds,
gint n_fds,
gint timeout)
{
int i;
int result;
gboolean debug = FALSE;
g_return_val_if_fail (n_fds >= 0, 0);
@ -907,19 +909,6 @@ g_io_channel_win32_make_pollfd (GIOChannel *channel,
create_reader_thread (win32_channel, sock_reader);
}
gint
g_io_channel_win32_wait_for_condition (GIOChannel *channel,
GIOCondition condition,
gint timeout)
{
GPollFD pollfd;
GIOWin32Channel *win32_channel = (GIOWin32Channel *) channel;
g_io_channel_win32_make_pollfd (channel, condition, &pollfd);
return g_io_channel_win32_poll (&pollfd, 1, timeout);
}
/* This variable and the functions below are present just to be
* binary compatible with old clients... But note that in GIMP, the
* libgimp/gimp.c:gimp_extension_process() function will have to be modified

View File

@ -99,6 +99,7 @@ EXPORTS
g_error_matches
g_error_new
g_error_new_literal
g_file_test
g_filename_from_utf8
g_filename_to_utf8
g_free
@ -162,17 +163,16 @@ EXPORTS
g_io_channel_unix_new
g_io_channel_unref
g_io_channel_win32_get_fd
g_io_channel_win32_new_messages
g_io_channel_win32_make_pollfd
g_io_channel_win32_new_fd
g_io_channel_win32_new_messages
g_io_channel_win32_new_pipe
g_io_channel_win32_new_pipe_with_wakeups
g_io_channel_win32_new_stream_socket
g_io_channel_win32_make_pollfd
g_io_channel_win32_pipe_readable
g_io_channel_win32_pipe_request_wakeups
g_io_channel_win32_poll
g_io_channel_win32_set_debug
g_io_channel_win32_wait_for_condition
g_io_channel_write
g_list_alloc
g_list_append
@ -268,8 +268,8 @@ EXPORTS
g_pipe_readable_msg
g_print
g_printerr
g_propagate_error
g_printf_string_upper_bound
g_propagate_error
g_ptr_array_add
g_ptr_array_free
g_ptr_array_new
@ -350,6 +350,9 @@ EXPORTS
g_set_print_handler
g_set_printerr_handler
g_set_warning_handler
g_shell_parse_argv
g_shell_quote
g_shell_unquote
g_slist_alloc
g_slist_append
g_slist_concat
@ -379,6 +382,12 @@ EXPORTS
g_source_remove_by_source_data
g_source_remove_by_user_data
g_spaced_primes_closest
g_spawn_async
g_spawn_async_with_pipes
g_spawn_command_line_async
g_spawn_command_line_sync
g_spawn_error_quark
g_spawn_sync
g_static_mutex_get_mutex_impl
g_static_private_get
g_static_private_set

View File

@ -48,6 +48,8 @@ void g_on_error_stack_trace (const gchar *prg_name);
*/
#if defined (__i386__) && defined (__GNUC__) && __GNUC__ >= 2
# define G_BREAKPOINT() G_STMT_START{ __asm__ __volatile__ ("int $03"); }G_STMT_END
#elif defined (_MSC_VER) && defined (_M_IX86)
# define G_BREAKPOINT() G_STMT_START{ __asm int 3h }G_STMT_END
#elif defined (__alpha__) && defined (__GNUC__) && __GNUC__ >= 2
# define G_BREAKPOINT() G_STMT_START{ __asm__ __volatile__ ("bpt"); }G_STMT_END
#else /* !__i386__ && !__alpha__ */

View File

@ -18,10 +18,14 @@
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "glib.h"
#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <stdio.h>
#include <string.h>
#include <errno.h>
@ -29,6 +33,9 @@
#include <sys/stat.h>
#include <fcntl.h>
#ifndef S_ISLNK
# define S_ISLNK(x) 0
#endif
#define _(x) x
@ -279,6 +286,8 @@ get_contents_stdio (const gchar *filename,
return TRUE;
}
#ifndef G_OS_WIN32
static gboolean
get_contents_regfile (const gchar *filename,
struct stat *stat_buf,
@ -401,7 +410,8 @@ get_contents_posix (const gchar *filename,
}
}
#ifdef G_OS_WIN32
#else /* G_OS_WIN32 */
static gboolean
get_contents_win32 (const gchar *filename,
gchar **contents,
@ -426,6 +436,7 @@ get_contents_win32 (const gchar *filename,
return get_contents_stdio (filename, f, contents, length, error);
}
#endif
/**
@ -467,4 +478,3 @@ g_file_get_contents (const gchar *filename,
return get_contents_posix (filename, contents, length, error);
#endif
}

View File

@ -201,6 +201,10 @@ reader_thread (void *parameter)
nbytes = MIN ((channel->rdp + BUFFER_SIZE - channel->wrp - 1) % BUFFER_SIZE,
BUFFER_SIZE - channel->wrp);
if (channel->debug)
g_print ("thread %#x: calling reader for %d bytes\n",
channel->thread_id, nbytes);
UNLOCK (channel->mutex);
nbytes = (*channel->reader) (channel->fd, buffer, nbytes);
@ -876,9 +880,7 @@ g_io_channel_win32_poll (GPollFD *fds,
gint n_fds,
gint timeout)
{
int i;
int result;
gboolean debug = FALSE;
g_return_val_if_fail (n_fds >= 0, 0);
@ -907,19 +909,6 @@ g_io_channel_win32_make_pollfd (GIOChannel *channel,
create_reader_thread (win32_channel, sock_reader);
}
gint
g_io_channel_win32_wait_for_condition (GIOChannel *channel,
GIOCondition condition,
gint timeout)
{
GPollFD pollfd;
GIOWin32Channel *win32_channel = (GIOWin32Channel *) channel;
g_io_channel_win32_make_pollfd (channel, condition, &pollfd);
return g_io_channel_win32_poll (&pollfd, 1, timeout);
}
/* This variable and the functions below are present just to be
* binary compatible with old clients... But note that in GIMP, the
* libgimp/gimp.c:gimp_extension_process() function will have to be modified

View File

@ -99,6 +99,7 @@ EXPORTS
g_error_matches
g_error_new
g_error_new_literal
g_file_test
g_filename_from_utf8
g_filename_to_utf8
g_free
@ -162,17 +163,16 @@ EXPORTS
g_io_channel_unix_new
g_io_channel_unref
g_io_channel_win32_get_fd
g_io_channel_win32_new_messages
g_io_channel_win32_make_pollfd
g_io_channel_win32_new_fd
g_io_channel_win32_new_messages
g_io_channel_win32_new_pipe
g_io_channel_win32_new_pipe_with_wakeups
g_io_channel_win32_new_stream_socket
g_io_channel_win32_make_pollfd
g_io_channel_win32_pipe_readable
g_io_channel_win32_pipe_request_wakeups
g_io_channel_win32_poll
g_io_channel_win32_set_debug
g_io_channel_win32_wait_for_condition
g_io_channel_write
g_list_alloc
g_list_append
@ -268,8 +268,8 @@ EXPORTS
g_pipe_readable_msg
g_print
g_printerr
g_propagate_error
g_printf_string_upper_bound
g_propagate_error
g_ptr_array_add
g_ptr_array_free
g_ptr_array_new
@ -350,6 +350,9 @@ EXPORTS
g_set_print_handler
g_set_printerr_handler
g_set_warning_handler
g_shell_parse_argv
g_shell_quote
g_shell_unquote
g_slist_alloc
g_slist_append
g_slist_concat
@ -379,6 +382,12 @@ EXPORTS
g_source_remove_by_source_data
g_source_remove_by_user_data
g_spaced_primes_closest
g_spawn_async
g_spawn_async_with_pipes
g_spawn_command_line_async
g_spawn_command_line_sync
g_spawn_error_quark
g_spawn_sync
g_static_mutex_get_mutex_impl
g_static_private_get
g_static_private_set

1191
glib/gspawn-win32.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -598,7 +598,7 @@ g_win32_getlocale (void)
*/
switch (sub)
{
case SUBLANG_SERBIAN_LATIN: l = "hr"; break;
case SUBLANG_SERBIAN_LATIN: l = "sp"; break;
case SUBLANG_SERBIAN_CYRILLIC: l = "sr"; break;
default: l = "hr"; /* ??? */
}

View File

@ -33,6 +33,7 @@ all : \
config.h \
glibconfig.h \
$(DLLS_TO_BUILD) \
gspawn-win32-helper.exe \
testglib.exe \
testgdate.exe \
testgdateparser.exe
@ -50,6 +51,7 @@ glib_OBJECTS = \
gdataset.o \
gdate.o \
gerror.o \
gfileutils.o \
ghook.o \
ghash.o \
giochannel.o \
@ -62,7 +64,9 @@ glib_OBJECTS = \
gprimes.o \
gqueue.o \
grand.o \
gshell.o \
gslist.o \
gspawn-win32.o \
gthread.o \
gthreadpool.o \
gtimer.o \
@ -92,6 +96,9 @@ makefile.mingw: makefile.mingw.in
glib-$(GLIB_VER).dll : $(glib_OBJECTS) glib.def
./build-dll glib $(GLIB_VER) glib.def $(glib_OBJECTS) $(LIBICONV_LIBS) -luser32 -lwsock32
gspawn-win32-helper.exe : gspawn-win32.c
$(CC) $(CFLAGS) -mwindows -DGSPAWN_HELPER -DG_LOG_DOMAIN=\"gspawn-win32-helper\" -o $@ $< -L . -lglib-$(GLIB_VER)
################ subdirectories
gmodule/gmodule-$(GLIB_VER).dll : glib-$(GLIB_VER).dll

View File

@ -30,6 +30,7 @@ all : \
config.h \
glibconfig.h \
$(DLLS_TO_BUILD) \
gspawn-win32-helper.exe \
testglib.exe \
testgdate.exe \
testgdateparser.exe
@ -46,6 +47,7 @@ glib_OBJECTS = \
gdataset.obj \
gdate.obj \
gerror.obj \
gfileutils.obj \
gconvert.obj \
ghash.obj \
ghook.obj \
@ -61,9 +63,11 @@ glib_OBJECTS = \
grand.obj \
grel.obj \
gscanner.obj \
gshell.obj \
gslist.obj \
gstrfuncs.obj \
gstring.obj \
gspawn-win32.obj \
gthread.obj \
gthreadpool.obj \
gtimer.obj \
@ -89,6 +93,9 @@ makefile.msc: makefile.msc.in
glib-$(GLIB_VER).dll : $(glib_OBJECTS) glib.def
$(CC) $(CFLAGS) -LD -Feglib-$(GLIB_VER).dll $(glib_OBJECTS) $(LIBICONV_LIBS) user32.lib advapi32.lib wsock32.lib $(LDFLAGS) /def:glib.def
gspawn-win32-helper.exe : gspawn-win32.c glib-$(GLIB_VER).dll
$(CC) $(CFLAGS) -Fe$@ -DG_LOG_DOMAIN=\"gspawn-win32-helper\" gspawn-win32.c glib-$(GLIB_VER).lib $(LDFLAGS) /subsystem:windows
################ subdirectories
sub-gmodule :

1191
gspawn-win32.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -598,7 +598,7 @@ g_win32_getlocale (void)
*/
switch (sub)
{
case SUBLANG_SERBIAN_LATIN: l = "hr"; break;
case SUBLANG_SERBIAN_LATIN: l = "sp"; break;
case SUBLANG_SERBIAN_CYRILLIC: l = "sr"; break;
default: l = "hr"; /* ??? */
}

View File

@ -33,6 +33,7 @@ all : \
config.h \
glibconfig.h \
$(DLLS_TO_BUILD) \
gspawn-win32-helper.exe \
testglib.exe \
testgdate.exe \
testgdateparser.exe
@ -50,6 +51,7 @@ glib_OBJECTS = \
gdataset.o \
gdate.o \
gerror.o \
gfileutils.o \
ghook.o \
ghash.o \
giochannel.o \
@ -62,7 +64,9 @@ glib_OBJECTS = \
gprimes.o \
gqueue.o \
grand.o \
gshell.o \
gslist.o \
gspawn-win32.o \
gthread.o \
gthreadpool.o \
gtimer.o \
@ -92,6 +96,9 @@ makefile.mingw: makefile.mingw.in
glib-$(GLIB_VER).dll : $(glib_OBJECTS) glib.def
./build-dll glib $(GLIB_VER) glib.def $(glib_OBJECTS) $(LIBICONV_LIBS) -luser32 -lwsock32
gspawn-win32-helper.exe : gspawn-win32.c
$(CC) $(CFLAGS) -mwindows -DGSPAWN_HELPER -DG_LOG_DOMAIN=\"gspawn-win32-helper\" -o $@ $< -L . -lglib-$(GLIB_VER)
################ subdirectories
gmodule/gmodule-$(GLIB_VER).dll : glib-$(GLIB_VER).dll

View File

@ -30,6 +30,7 @@ all : \
config.h \
glibconfig.h \
$(DLLS_TO_BUILD) \
gspawn-win32-helper.exe \
testglib.exe \
testgdate.exe \
testgdateparser.exe
@ -46,6 +47,7 @@ glib_OBJECTS = \
gdataset.obj \
gdate.obj \
gerror.obj \
gfileutils.obj \
gconvert.obj \
ghash.obj \
ghook.obj \
@ -61,9 +63,11 @@ glib_OBJECTS = \
grand.obj \
grel.obj \
gscanner.obj \
gshell.obj \
gslist.obj \
gstrfuncs.obj \
gstring.obj \
gspawn-win32.obj \
gthread.obj \
gthreadpool.obj \
gtimer.obj \
@ -89,6 +93,9 @@ makefile.msc: makefile.msc.in
glib-$(GLIB_VER).dll : $(glib_OBJECTS) glib.def
$(CC) $(CFLAGS) -LD -Feglib-$(GLIB_VER).dll $(glib_OBJECTS) $(LIBICONV_LIBS) user32.lib advapi32.lib wsock32.lib $(LDFLAGS) /def:glib.def
gspawn-win32-helper.exe : gspawn-win32.c glib-$(GLIB_VER).dll
$(CC) $(CFLAGS) -Fe$@ -DG_LOG_DOMAIN=\"gspawn-win32-helper\" gspawn-win32.c glib-$(GLIB_VER).lib $(LDFLAGS) /subsystem:windows
################ subdirectories
sub-gmodule :

View File

@ -25,7 +25,9 @@ TESTS = \
queue-test.exe \
rand-test.exe \
relation-test.exe\
shell-test.exe \
slist-test.exe \
spawn-test.exe \
strfunc-test.exe\
string-test.exe \
thread-test.exe \

View File

@ -26,7 +26,9 @@ TESTS = \
queue-test.exe \
rand-test.exe \
relation-test.exe\
shell-test.exe \
slist-test.exe \
spawn-test.exe \
# strfunc-test doesn't compile with MSVC
# strfunc-test.exe\
string-test.exe \

View File

@ -60,6 +60,7 @@ run_tests (void)
printf ("Errors after this are not supposed to happen:\n");
err = NULL;
#ifdef G_OS_UNIX
if (!g_spawn_command_line_sync ("/bin/sh -c 'echo hello'",
&output, NULL, NULL,
&err))
@ -82,6 +83,33 @@ run_tests (void)
g_free (output);
}
#else
#ifdef G_OS_WIN32
if (!g_spawn_command_line_sync ("ipconfig /all",
&output, NULL, NULL,
&err))
{
fprintf (stderr, "Error: %s\n", err->message);
g_error_free (err);
exit (1);
}
else
{
g_assert (output != NULL);
if (strstr (output, "IP Configuration") == 0)
{
printf ("output was '%s', should have contained 'IP Configuration'\n",
output);
exit (1);
}
g_free (output);
}
#endif
#endif
}
int