Commit f477518c authored by Tor Lillqvist's avatar Tor Lillqvist

Merge in current Win32 version. Almost no Unix code touched.

	* README.win32: More text.

	* config.h.win32 glibconfig.h.win32: Update to match the
	corresponding generated files on Unix.

	* makefile.msc: Update with new source files, and gthread
 	library. Use the compiler flag -MD instead of using -D_DLL and
	"/nodefaultlib:libc msvcrt.lib" in the link phase.

	* glib.def: Include new functions, drop removed ones.

	* glib.h: Add comments about main loop and polling on Win32. (In
	general, it's only for the GIMP's use.) Add Win32 IO Channel
	functions. Remove the obsoleted old IO Channel stuff (which was
	in #if 0 already).

	* giowin32.c: New file.

	* gmain.c: Include config.h, conditionalize <sys/time.h>
 	inclusion.  Add g_poll implementation for Win32 (only for the
 	GIMP's needs for now, it's hard or even impossible to be as clean
 	and generic as on Unix). Implement g_get_current_time on Win32. If
 	threads aren't supported, don't try to wake up main thread's
 	loop. On Win32, use a semaphore and not a pipe to wake up the main
 	loop.

	* gmessages.c: On Win32, allocate a console window if the standard
	output handle is invalid before writing to stdout, and reopen stdout
	to that console window.

	* giochannel.c: Conditionalize unistd.h inclusion. Some indentation
	cleanup.

	* gstrfuncs.c: Include <signal.h>.

	* gutils.c: On Win32, also check the HOMEDRIVE and HOMEPATH
	environment variables.

	* gmodule-dl.c gmodule-dld.c: In
 	_g_module_build_path, don't add the "lib" prefix and
 	".so" or ".sl" suffix if already there.

	* gmodule-win32.c: Likewise for the ".dll" suffix.

	* gthread-posix.c: Conditionalize <sys/time.h> inclusion.
parent 883776f0
1999-01-16 Tor Lillqvist <tml@iki.fi>
* Merge in current Win32 version:
* README.win32: More text.
* config.h.win32 glibconfig.h.win32: Update to match the
corresponding generated files on Unix.
* makefile.msc: Update with new source files, and gthread
library. Use the compiler flag -MD instead of using -D_DLL and
/nodefaultlib:libc msvcrt.lib in the link phase.
* glib.def: Update to include new functions, drop removed ones.
* glib.h: Add comments about main loop and polling on Win32. (In
general, it's only for the GIMP's use.) Add Win32 IO Channel
functions. Remove the obsoleted old IO Channel stuff (which was
in #if 0 already).
* giowin32.c: New file.
* gmain.c: Include config.h, conditionalize <sys/time.h>
inclusion. Add g_poll implementation for Win32 (only for the
GIMP's needs for now, it's hard or even impossible to be as clean
and generic as on Unix). Implement g_get_current_time on Win32. If
threads aren't supported, don't try to wake up main thread's
loop. On Win32, use a semaphore and not a pipe to wake up the main
loop.
* gmessages.c: On Win32, allocate a console window if the standard
output handle is invalid before writing to stdout, and reopen stdout
to that console window.
* giochannel.c: Conditionalize unistd.h inclusion. Some indentation
cleanup.
* gstrfuncs.c: Include <signal.h>.
* gutils.c: On Win32, also check the HOMEDRIVE and HOMEPATH
environment variables.
Sun Jan 17 01:06:38 1999 Timur Bakeyev <mc@bat.ru>
* configure.in: Add support for FreeBSD 2.2.x macro _THREAD_SAFE.
......
1999-01-16 Tor Lillqvist <tml@iki.fi>
* Merge in current Win32 version:
* README.win32: More text.
* config.h.win32 glibconfig.h.win32: Update to match the
corresponding generated files on Unix.
* makefile.msc: Update with new source files, and gthread
library. Use the compiler flag -MD instead of using -D_DLL and
/nodefaultlib:libc msvcrt.lib in the link phase.
* glib.def: Update to include new functions, drop removed ones.
* glib.h: Add comments about main loop and polling on Win32. (In
general, it's only for the GIMP's use.) Add Win32 IO Channel
functions. Remove the obsoleted old IO Channel stuff (which was
in #if 0 already).
* giowin32.c: New file.
* gmain.c: Include config.h, conditionalize <sys/time.h>
inclusion. Add g_poll implementation for Win32 (only for the
GIMP's needs for now, it's hard or even impossible to be as clean
and generic as on Unix). Implement g_get_current_time on Win32. If
threads aren't supported, don't try to wake up main thread's
loop. On Win32, use a semaphore and not a pipe to wake up the main
loop.
* gmessages.c: On Win32, allocate a console window if the standard
output handle is invalid before writing to stdout, and reopen stdout
to that console window.
* giochannel.c: Conditionalize unistd.h inclusion. Some indentation
cleanup.
* gstrfuncs.c: Include <signal.h>.
* gutils.c: On Win32, also check the HOMEDRIVE and HOMEPATH
environment variables.
Sun Jan 17 01:06:38 1999 Timur Bakeyev <mc@bat.ru>
* configure.in: Add support for FreeBSD 2.2.x macro _THREAD_SAFE.
......
1999-01-16 Tor Lillqvist <tml@iki.fi>
* Merge in current Win32 version:
* README.win32: More text.
* config.h.win32 glibconfig.h.win32: Update to match the
corresponding generated files on Unix.
* makefile.msc: Update with new source files, and gthread
library. Use the compiler flag -MD instead of using -D_DLL and
/nodefaultlib:libc msvcrt.lib in the link phase.
* glib.def: Update to include new functions, drop removed ones.
* glib.h: Add comments about main loop and polling on Win32. (In
general, it's only for the GIMP's use.) Add Win32 IO Channel
functions. Remove the obsoleted old IO Channel stuff (which was
in #if 0 already).
* giowin32.c: New file.
* gmain.c: Include config.h, conditionalize <sys/time.h>
inclusion. Add g_poll implementation for Win32 (only for the
GIMP's needs for now, it's hard or even impossible to be as clean
and generic as on Unix). Implement g_get_current_time on Win32. If
threads aren't supported, don't try to wake up main thread's
loop. On Win32, use a semaphore and not a pipe to wake up the main
loop.
* gmessages.c: On Win32, allocate a console window if the standard
output handle is invalid before writing to stdout, and reopen stdout
to that console window.
* giochannel.c: Conditionalize unistd.h inclusion. Some indentation
cleanup.
* gstrfuncs.c: Include <signal.h>.
* gutils.c: On Win32, also check the HOMEDRIVE and HOMEPATH
environment variables.
Sun Jan 17 01:06:38 1999 Timur Bakeyev <mc@bat.ru>
* configure.in: Add support for FreeBSD 2.2.x macro _THREAD_SAFE.
......
1999-01-16 Tor Lillqvist <tml@iki.fi>
* Merge in current Win32 version:
* README.win32: More text.
* config.h.win32 glibconfig.h.win32: Update to match the
corresponding generated files on Unix.
* makefile.msc: Update with new source files, and gthread
library. Use the compiler flag -MD instead of using -D_DLL and
/nodefaultlib:libc msvcrt.lib in the link phase.
* glib.def: Update to include new functions, drop removed ones.
* glib.h: Add comments about main loop and polling on Win32. (In
general, it's only for the GIMP's use.) Add Win32 IO Channel
functions. Remove the obsoleted old IO Channel stuff (which was
in #if 0 already).
* giowin32.c: New file.
* gmain.c: Include config.h, conditionalize <sys/time.h>
inclusion. Add g_poll implementation for Win32 (only for the
GIMP's needs for now, it's hard or even impossible to be as clean
and generic as on Unix). Implement g_get_current_time on Win32. If
threads aren't supported, don't try to wake up main thread's
loop. On Win32, use a semaphore and not a pipe to wake up the main
loop.
* gmessages.c: On Win32, allocate a console window if the standard
output handle is invalid before writing to stdout, and reopen stdout
to that console window.
* giochannel.c: Conditionalize unistd.h inclusion. Some indentation
cleanup.
* gstrfuncs.c: Include <signal.h>.
* gutils.c: On Win32, also check the HOMEDRIVE and HOMEPATH
environment variables.
Sun Jan 17 01:06:38 1999 Timur Bakeyev <mc@bat.ru>
* configure.in: Add support for FreeBSD 2.2.x macro _THREAD_SAFE.
......
1999-01-16 Tor Lillqvist <tml@iki.fi>
* Merge in current Win32 version:
* README.win32: More text.
* config.h.win32 glibconfig.h.win32: Update to match the
corresponding generated files on Unix.
* makefile.msc: Update with new source files, and gthread
library. Use the compiler flag -MD instead of using -D_DLL and
/nodefaultlib:libc msvcrt.lib in the link phase.
* glib.def: Update to include new functions, drop removed ones.
* glib.h: Add comments about main loop and polling on Win32. (In
general, it's only for the GIMP's use.) Add Win32 IO Channel
functions. Remove the obsoleted old IO Channel stuff (which was
in #if 0 already).
* giowin32.c: New file.
* gmain.c: Include config.h, conditionalize <sys/time.h>
inclusion. Add g_poll implementation for Win32 (only for the
GIMP's needs for now, it's hard or even impossible to be as clean
and generic as on Unix). Implement g_get_current_time on Win32. If
threads aren't supported, don't try to wake up main thread's
loop. On Win32, use a semaphore and not a pipe to wake up the main
loop.
* gmessages.c: On Win32, allocate a console window if the standard
output handle is invalid before writing to stdout, and reopen stdout
to that console window.
* giochannel.c: Conditionalize unistd.h inclusion. Some indentation
cleanup.
* gstrfuncs.c: Include <signal.h>.
* gutils.c: On Win32, also check the HOMEDRIVE and HOMEPATH
environment variables.
Sun Jan 17 01:06:38 1999 Timur Bakeyev <mc@bat.ru>
* configure.in: Add support for FreeBSD 2.2.x macro _THREAD_SAFE.
......
1999-01-16 Tor Lillqvist <tml@iki.fi>
* Merge in current Win32 version:
* README.win32: More text.
* config.h.win32 glibconfig.h.win32: Update to match the
corresponding generated files on Unix.
* makefile.msc: Update with new source files, and gthread
library. Use the compiler flag -MD instead of using -D_DLL and
/nodefaultlib:libc msvcrt.lib in the link phase.
* glib.def: Update to include new functions, drop removed ones.
* glib.h: Add comments about main loop and polling on Win32. (In
general, it's only for the GIMP's use.) Add Win32 IO Channel
functions. Remove the obsoleted old IO Channel stuff (which was
in #if 0 already).
* giowin32.c: New file.
* gmain.c: Include config.h, conditionalize <sys/time.h>
inclusion. Add g_poll implementation for Win32 (only for the
GIMP's needs for now, it's hard or even impossible to be as clean
and generic as on Unix). Implement g_get_current_time on Win32. If
threads aren't supported, don't try to wake up main thread's
loop. On Win32, use a semaphore and not a pipe to wake up the main
loop.
* gmessages.c: On Win32, allocate a console window if the standard
output handle is invalid before writing to stdout, and reopen stdout
to that console window.
* giochannel.c: Conditionalize unistd.h inclusion. Some indentation
cleanup.
* gstrfuncs.c: Include <signal.h>.
* gutils.c: On Win32, also check the HOMEDRIVE and HOMEPATH
environment variables.
Sun Jan 17 01:06:38 1999 Timur Bakeyev <mc@bat.ru>
* configure.in: Add support for FreeBSD 2.2.x macro _THREAD_SAFE.
......
1999-01-16 Tor Lillqvist <tml@iki.fi>
* Merge in current Win32 version:
* README.win32: More text.
* config.h.win32 glibconfig.h.win32: Update to match the
corresponding generated files on Unix.
* makefile.msc: Update with new source files, and gthread
library. Use the compiler flag -MD instead of using -D_DLL and
/nodefaultlib:libc msvcrt.lib in the link phase.
* glib.def: Update to include new functions, drop removed ones.
* glib.h: Add comments about main loop and polling on Win32. (In
general, it's only for the GIMP's use.) Add Win32 IO Channel
functions. Remove the obsoleted old IO Channel stuff (which was
in #if 0 already).
* giowin32.c: New file.
* gmain.c: Include config.h, conditionalize <sys/time.h>
inclusion. Add g_poll implementation for Win32 (only for the
GIMP's needs for now, it's hard or even impossible to be as clean
and generic as on Unix). Implement g_get_current_time on Win32. If
threads aren't supported, don't try to wake up main thread's
loop. On Win32, use a semaphore and not a pipe to wake up the main
loop.
* gmessages.c: On Win32, allocate a console window if the standard
output handle is invalid before writing to stdout, and reopen stdout
to that console window.
* giochannel.c: Conditionalize unistd.h inclusion. Some indentation
cleanup.
* gstrfuncs.c: Include <signal.h>.
* gutils.c: On Win32, also check the HOMEDRIVE and HOMEPATH
environment variables.
Sun Jan 17 01:06:38 1999 Timur Bakeyev <mc@bat.ru>
* configure.in: Add support for FreeBSD 2.2.x macro _THREAD_SAFE.
......
1999-01-16 Tor Lillqvist <tml@iki.fi>
* Merge in current Win32 version:
* README.win32: More text.
* config.h.win32 glibconfig.h.win32: Update to match the
corresponding generated files on Unix.
* makefile.msc: Update with new source files, and gthread
library. Use the compiler flag -MD instead of using -D_DLL and
/nodefaultlib:libc msvcrt.lib in the link phase.
* glib.def: Update to include new functions, drop removed ones.
* glib.h: Add comments about main loop and polling on Win32. (In
general, it's only for the GIMP's use.) Add Win32 IO Channel
functions. Remove the obsoleted old IO Channel stuff (which was
in #if 0 already).
* giowin32.c: New file.
* gmain.c: Include config.h, conditionalize <sys/time.h>
inclusion. Add g_poll implementation for Win32 (only for the
GIMP's needs for now, it's hard or even impossible to be as clean
and generic as on Unix). Implement g_get_current_time on Win32. If
threads aren't supported, don't try to wake up main thread's
loop. On Win32, use a semaphore and not a pipe to wake up the main
loop.
* gmessages.c: On Win32, allocate a console window if the standard
output handle is invalid before writing to stdout, and reopen stdout
to that console window.
* giochannel.c: Conditionalize unistd.h inclusion. Some indentation
cleanup.
* gstrfuncs.c: Include <signal.h>.
* gutils.c: On Win32, also check the HOMEDRIVE and HOMEPATH
environment variables.
Sun Jan 17 01:06:38 1999 Timur Bakeyev <mc@bat.ru>
* configure.in: Add support for FreeBSD 2.2.x macro _THREAD_SAFE.
......
For more information about the Windows port, see
http://www.iki.fi/tml/gimp/win32/ .
For more information about the port or GLib, GTk+ and the GIMP to
native Windows, see http://www.iki.fi/tml/gimp/win32/ . ("Native"
means that we use the Win32 API only, and not any POSIX emulation
layer except that provided by the Microsoft runtime C library, and the
pthreads emulation library from Cygnus.)
As for now, only Microsoft C is really supported. Before compiling,
check the BIN definition in makefile.msc. Compile with `nmake -f
makefile.msc`. Install with `nmake -f makefile.msc install`. Gnu-Win32
with egcs and maybe LCC-Win32 support will be added later.
As for now, only the Microsoft compiler and tools are really
supported. Before compiling, check the BIN definition in
makefile.msc. Compile with `nmake -f makefile.msc`. Install with
`nmake -f makefile.msc install`. Cygwin (without cygwin runtime,
i.e. "mingw32") and maybe LCC-Win32 support will be added later. Note
that when using the cygwin compiler and other tools *with* the cygwin
runtime the normal Unix configuration method should work.
The thread support uses the pthreads package from Cygnus, which isn't
ready yet, and thus really should not be relied upon.
......@@ -23,13 +23,17 @@
/* #undef ENABLE_MEM_PROFILE */
#define G_COMPILED_WITH_DEBUGGING "minimum"
/* #undef HAVE_BROKEN_WCTYPE */
/* #undef HAVE_DOPRNT */
#define HAVE_FLOAT_H 1
#define HAVE_LIMITS_H 1
/* #undef HAVE_LOCALTIME_R */
/* #undef HAVE_LONG_DOUBLE */
/* #undef HAVE_POLL */
/* #undef HAVE_PWD_H */
/* #undef HAVE_SYS_PARAM_H */
/* #undef HAVE_SYS_POLL_H */
/* #undef HAVE_SYS_SELECT_H */
/* #undef HAVE_SYS_TIME_H */
/* #undef HAVE_SYS_TIMES_H */
......@@ -52,10 +56,13 @@
#define GLIB_MAJOR_VERSION 1
#define GLIB_MINOR_VERSION 1
#define GLIB_MICRO_VERSION 4
#define GLIB_MICRO_VERSION 12
#define GLIB_INTERFACE_AGE 0
#define GLIB_BINARY_AGE 0
#define G_THREAD_SOURCE "gthread-posix.c"
#define G_THREADS_IMPL_POSIX
/* The number of bytes in a char. */
#define SIZEOF_CHAR 1
......
......@@ -24,8 +24,12 @@
* MT safe
*/
#include "config.h"
#include "glib.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
void
g_io_channel_init (GIOChannel *channel)
......@@ -94,7 +98,7 @@ g_io_channel_close (GIOChannel *channel)
}
guint
g_io_add_watch_full (GIOChannel *channel,
g_io_add_watch_full (GIOChannel *channel,
gint priority,
GIOCondition condition,
GIOFunc func,
......@@ -108,7 +112,7 @@ g_io_add_watch_full (GIOChannel *channel,
}
guint
g_io_add_watch (GIOChannel *channel,
g_io_add_watch (GIOChannel *channel,
GIOCondition condition,
GIOFunc func,
gpointer user_data)
......
This diff is collapsed.
EXPORTS
g_array_append_vals
g_array_free
g_array_insert_vals
g_array_new
g_array_prepend_vals
g_array_remove_index
......@@ -42,11 +43,55 @@ EXPORTS
g_dataset_id_get_data
g_dataset_id_remove_no_notify
g_dataset_id_set_data_full
g_date_add_days
g_date_add_months
g_date_add_years
g_date_clear
g_date_compare
g_date_day
g_date_day_of_year
g_date_days_in_month
g_date_free
g_date_is_first_of_month
g_date_is_last_of_month
g_date_is_leap_year
g_date_julian
g_date_julian
g_date_monday_week_of_year
g_date_monday_weeks_in_year
g_date_new
g_date_new_dmy
g_date_new_julian
g_date_month
g_date_set_day
g_date_set_dmy
g_date_set_julian
g_date_set_month
g_date_set_parse
g_date_set_time
g_date_set_year
g_date_strftime
g_date_subtract_days
g_date_subtract_months
g_date_subtract_years
g_date_sunday_week_of_year
g_date_sunday_weeks_in_year
g_date_to_struct_tm
g_date_valid
g_date_valid_day
g_date_valid_dmy
g_date_valid_julian
g_date_valid_month
g_date_valid_weekday
g_date_valid_year
g_date_weekday
g_date_year
g_direct_equal
g_direct_hash
g_dirname
g_free
g_get_current_dir
g_get_current_time
g_get_home_dir
g_get_prgname
g_get_real_name
......@@ -81,22 +126,38 @@ EXPORTS
g_hook_list_invoke
g_hook_list_invoke_check
g_hook_list_marshal
g_hook_list_marshal_check
g_hook_list_clear
g_hook_next_valid
g_hook_prepend
g_hook_ref
g_hook_unref
g_idle_add
g_idle_add_full
g_int_equal
g_int_hash
g_iochannel_new
g_iochannel_free
g_iochannel_close_and_free
g_iochannel_wakeup_peer
g_io_add_watch
g_io_add_watch_full
g_io_channel_close
g_io_channel_init
g_io_channel_read
g_io_channel_ref
g_io_channel_seek
g_io_channel_unix_get_fd
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_new_pipe
g_io_channel_win32_new_pipe_with_wakeups
g_io_channel_win32_new_stream_socket
g_io_channel_win32_pipe_readable
g_io_channel_win32_pipe_request_wakeups
g_io_channel_write
g_list_alloc
g_list_allocator_free
g_list_allocator_new
g_list_append
g_list_concat
g_list_copy
g_list_find
g_list_find_custom
g_list_first
......@@ -115,7 +176,6 @@ EXPORTS
g_list_remove
g_list_remove_link
g_list_reverse
g_list_set_allocator
g_list_sort
g_log
g_log_default_handler
......@@ -124,6 +184,16 @@ EXPORTS
g_log_set_fatal_mask
g_log_set_handler
g_logv
g_main_add_poll
g_main_destroy
g_main_is_running
g_main_iteration
g_main_new
g_main_pending
g_main_remove_poll
g_main_quit
g_main_run
g_main_set_poll_func
g_malloc
g_malloc0
g_mem_check
......@@ -136,8 +206,11 @@ EXPORTS
g_mem_chunk_new
g_mem_chunk_print
g_mem_chunk_reset
g_mem_init
g_mem_profile
g_memdup
g_messages_init
g_mutex_init
g_node_child_index
g_node_child_position
g_node_children_foreach
......@@ -166,6 +239,7 @@ EXPORTS
g_parse_debug_string
g_path_is_absolute
g_path_skip_root
g_pipe_readable_msg
g_print
g_printerr
g_printf_string_upper_bound
......@@ -224,6 +298,7 @@ EXPORTS
g_slist_alloc
g_slist_append
g_slist_concat
g_slist_copy
g_slist_find
g_slist_find_custom
g_slist_foreach
......@@ -241,9 +316,15 @@ EXPORTS
g_slist_remove
g_slist_remove_link
g_slist_reverse
g_slist_set_allocator
g_slist_sort
g_snprintf
g_source_add
g_source_remove
g_source_remove_by_source_data
g_source_remove_by_user_data
g_static_mutex_get_mutex_impl
g_static_private_get
g_static_private_set
g_str_equal
g_str_hash
g_strcasecmp
......@@ -284,6 +365,8 @@ EXPORTS
g_strsplit
g_strtod
g_strup
g_timeout_add
g_timeout_add_full
g_timer_destroy
g_timer_elapsed
g_timer_new
......
......@@ -2447,7 +2447,26 @@ guint g_idle_add_full (gint priority,
/* GPollFD
*
* Unix-specific IO and main loop calls
* System-specific IO and main loop calls
*
* On Win32, the fd in a GPollFD should be Win32 HANDLE (*not* a file
* descriptor as provided by the C runtime) that can be used by
* MsgWaitForMultipleObjects. This does *not* include file handles
* from CreateFile, SOCKETs, nor pipe handles. (But you can use
* WSAEventSelect to signal events when a SOCKET is readable).
*
* On Win32, fd can also be the special value G_WIN32_MSG_HANDLE to
* indicate polling for messages. These message queue GPollFDs should
* be added with the g_main_poll_win32_msg_add function.
*
* But note that G_WIN32_MSG_HANDLE GPollFDs should not be used by GDK
* (GTK) programs, as GDK itself wants to read messages and convert them
* to GDK events.
*
* So, unless you really know what you are doing, it's best not to try
* to use the main loop polling stuff for your own needs on
* Win32. It's really only written for the GIMP's needs so
* far.
*/
typedef struct _GPollFD GPollFD;
......@@ -2466,45 +2485,77 @@ void g_main_add_poll (GPollFD *fd,
void g_main_remove_poll (GPollFD *fd);
void g_main_set_poll_func (GPollFunc func);
/* On Unix, IO channels created with this function for any file
* descriptor or socket.
*
* On Win32, use this only for plain files opened with the MSVCRT (the
* Microsoft run-time C library) _open(), including file descriptors
* 0, 1 and 2 (corresponding to stdin, stdout and stderr).
* Actually, don't do even that, this code isn't done yet.
*
* The term file descriptor as used in the context of Win32 refers to
* the emulated Unix-like file descriptors MSVCRT provides.
*/
GIOChannel* g_io_channel_unix_new (int fd);
gint g_io_channel_unix_get_fd (GIOChannel *channel);
#ifdef NATIVE_WIN32
GUTILS_C_VAR guint g_pipe_readable_msg;
/* old IO Channels */
#if 0
/* IO Channels.
* These are used for plug-in communication in the GIMP, for instance.
* On Unix, it's simply an encapsulated file descriptor (a pipe).
* On Windows, it's a handle to an anonymouos pipe, *and* (in the case
* of the writable end) a thread id to post a message to when you have written
* stuff.
#define G_WIN32_MSG_HANDLE 19981206
/* This is used to add polling for Windows messages. GDK (GTk+) programs
* should *not* use this. (In fact, I can't think of any program that
* would want to use this, but it's here just for completeness's sake.
*/
struct _GIOChannel
{
gint fd; /* file handle (pseudo such in Win32) */
#ifdef NATIVE_WIN32
guint peer; /* thread to post message to */
guint peer_fd; /* read handle (in the other process) */
guint offset; /* counter of accumulated bytes, to
* be included in the message posted
* so we keep in sync.
*/
guint need_wakeups; /* in output channels whether the reader
* needs wakeups
*/
#endif
};
GIOChannel *g_iochannel_new (gint fd);
void g_iochannel_free (GIOChannel *channel);
void g_iochannel_close_and_free (GIOChannel *channel);
void g_iochannel_wakeup_peer (GIOChannel *channel);
#ifndef NATIVE_WIN32
# define g_iochannel_wakeup_peer(channel) G_STMT_START { } G_STMT_END
#endif
#endif /* old IO Channels */
void g_main_poll_win32_msg_add(gint priority,
GPollFD *fd,
guint hwnd);
/* An IO channel for Windows messages for window handle hwnd. */
GIOChannel *g_io_channel_win32_new_messages (guint hwnd);
/* An IO channel for an anonymous pipe as returned from the MSVCRT
* _pipe(), with no mechanism for the writer to tell the reader when
* there is data in the pipe.
*
* This is not really implemented yet.
*/
GIOChannel *g_io_channel_win32_new_pipe (int fd);
/* An IO channel for a pipe as returned from the MSVCRT _pipe(), with
* Windows user messages used to signal data in the pipe for the
* reader.
*
* fd is the file descriptor. For the write end, peer is the thread id
* of the reader, and peer_fd is his file descriptor for the read end
* of the pipe.
*
* This is used by the GIMP, and works.
*/
GIOChannel *g_io_channel_win32_new_pipe_with_wakeups (int fd,
guint peer,
int peer_fd);
void g_io_channel_win32_pipe_request_wakeups (GIOChannel *channel,
guint peer,
int peer_fd);
void g_io_channel_win32_pipe_readable (int fd,
guint offset);
/* Get the C runtime file descriptor of a channel. */
gint g_io_channel_win32_get_fd (GIOChannel *channel);
/* An IO channel for a SOCK_STREAM winsock socket. The parameter is
* actually a SOCKET.
*/
GIOChannel *g_io_channel_win32_new_stream_socket (int socket);
#endif
/* Windows emulation stubs for common unix functions
/* Windows emulation stubs for common Unix functions
*/
#ifdef NATIVE_WIN32
# define MAXPATHLEN 1024
......
......@@ -24,8 +24,12 @@
* MT safe
*/
#include "config.h"
#include "glib.h"