diff -ru3 -N /home/src/gnomecvs/glib/ChangeLog ./ChangeLog
--- /home/src/gnomecvs/glib/ChangeLog	Thu Oct  8 10:54:11 1998
+++ ./ChangeLog	Thu Oct 15 13:37:21 1998
@@ -1,3 +1,108 @@
+1998-10-15: Tor Lillqvist <tml@iki.fi>
+
+	* README.win32 glib.def glib.wlk gmodule.def gmodule.wlk:
+	* glibconfig.h.win32 gmodule/gmoduleconf.h.win32:
+	New files for the Windows port. The .def files list exported
+	symbols for the Microsoft linker. The .wlk files contain
+	directives for the Watcom linker (not supported).
+
+	* configure.in:
+	Added checks for some platform-dependent headers: pwd.h sys/param.h
+	sys/select.h sys/time.h sys/times.h unistd.h, and functions:
+	lstat rint.
+
+	* gerror.c: 
+	Conditionalized inclusion of system-dependent headers. Changes
+	for Windows: no gdb to do a stack trace. Just call abort().
+
+	* glib.h:
+	Changes for Windows:
+
+	Added macros G_DIR_SEPARATOR, G_DIR_SEPARATOR_S for
+	platform-dependent file name syntax elements. Added macros
+	G_SEARCHPATH_SEPARATOR, G_SEARCHPATH_SEPARATOR_S for
+	platform-dependent search path syntax conventions.
+
+	Added pragmas for Microsoft C to make it more pedantic.
+
+	Marked GLib's global variables for export from DLL.
+
+	Added the function g_strquote that escapes backslashes.
+
+	Added functions g_path_is_absolute and g_path_skip_root to
+	handle platform-dependent file name syntax.
+
+	Added the function g_getenv that expands environment variables
+	that contain references to other environment variables, as is
+	typical on Windows NT.
+
+	Added a table with dummy references to the static functions
+	defined in glib.h to cut down on the warnings from Watcom C.
+	  
+	Added the GIOChannel structure which is used to encapsulate the
+	IPC mechanism used by the GIMP's plug-ins, and possibly other
+	things later. On Unix a GIOChannel encapsulates just a file
+	descriptor. On Windows it contains a file handle from pipe() and a
+	few other things related to the implementation of gdk_input_add
+	and GIMP plug-in communication. Subject to change.
+
+	Removed duplicate declarations of the version variables.
+
+	For the Watcom compiler, declare own implementations of
+	Unix-like I/O functions. This is a bit obsolete, as we
+	don't support building with Watcom now.
+
+	For the Microsoft compiler, declare own implementation of
+	ftruncate and the <dirent.h> functions.
+
+	* gmem.c:
+	Define a symbolic name  for the profiling table size.
+
+	* gmessages.c:
+	Conditionalized inclusion of unistd.h. On Windows, output using
+	stdio to stdout.
+
+	* gmodule/gmodule-win32.c:
+	New file.
+
+	* gmodule/gmodule.c gmodule/gmodule.h:
+	Added the Windows implementation.
+
+	* gmodule/libgplugin_a.c gmodule/libgplugin_b.c:
+	Added LibMain for LCC-Win32.
+
+	* gmodule/testgmodule.c:
+	Handle Windows dll names.
+
+	* gscanner.c:
+	Conditionalized inclusion of unistd.h. Added changes for
+	Microsoft C. Added CR to the skipped character set. 
+	
+	* gstrfuncs.c:
+	Added the function g_strquote, which quotes the backslash
+	character. Needed especially when printing Windows filenames.
+
+	* gtimer.c:
+	Conditionalized inclusion of unistd.h and sys/time.h. Added
+	implementations for Windows.
+
+	* gutils.c:
+	Conditionalized inclusion of platform-dependent headers. Use
+	the platform-independent file name syntax macros.
+	Conditionalize code on platform-dependent features. Added the
+	functions g_path_is_absolute g_path_skip_root and g_getenv.
+	Added the GIOChannel-related functions. Added
+	compiler-dependent Unix compatibility functions for Windows.
+
+	* makefile.lcc makefile.msc makefile.watcom:
+	New files. Compiler-specific makefiles for LCC-Win32,
+	Microsoft C and Watcom C. Of these, only Microsoft C is
+	actually supported currently.
+	
+	* testglib.c:
+	Added pathname check cases for Windows. Added workaround for
+	bug in the Microsoft runtime library. Improved some tests a bit.
+	
 Thu Oct  8 06:47:27 1998  Tim Janik  <timj@gtk.org>
 
 	* glib.h:
diff -ru3 -N /home/src/gnomecvs/glib/README.win32 ./README.win32
--- /home/src/gnomecvs/glib/README.win32	Thu Jan  1 02:00:00 1970
+++ ./README.win32	Thu Oct 15 13:55:07 1998
@@ -0,0 +1,8 @@
+For more information about the Windows port, see
+http://www.iki.fi/tml/gimp/win32/ .
+
+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` The files
+for Watcom are outdated, but might be useful if you still want to try
+to use Watcom. LCC-Win32 support will be added later.
diff -ru3 -N /home/src/gnomecvs/glib/acconfig.h ./acconfig.h
--- /home/src/gnomecvs/glib/acconfig.h	Wed Sep  9 10:55:54 1998
+++ ./acconfig.h	Thu Oct 15 13:18:29 1998
@@ -43,9 +43,15 @@
 #undef HAVE_FLOAT_H
 #undef HAVE_LIMITS_H
 #undef HAVE_LONG_DOUBLE
+#undef HAVE_PWD_H
+#undef HAVE_RINT
+#undef HAVE_SYS_PARAM_H
 #undef HAVE_SYS_SELECT_H
+#undef HAVE_SYS_TIME_H
+#undef HAVE_SYS_TIMES_H
 #undef HAVE_STRERROR
 #undef HAVE_STRSIGNAL
+#undef HAVE_UNISTD_H
 #undef HAVE_VSNPRINTF
 #undef HAVE_VALUES_H
 #undef HAVE_VPRINTF
@@ -73,6 +79,9 @@
 #undef GLIB_MICRO_VERSION
 #undef GLIB_INTERFACE_AGE
 #undef GLIB_BINARY_AGE
+
+#undef WIN32
+#undef NATIVE_WIN32
 
 /* #undef PACKAGE */
 /* #undef VERSION */
diff -ru3 -N /home/src/gnomecvs/glib/configure.in ./configure.in
--- /home/src/gnomecvs/glib/configure.in	Fri Sep 25 12:46:44 1998
+++ ./configure.in	Thu Oct 15 13:11:52 1998
@@ -217,10 +217,17 @@
 dnl header file checks
 AC_CHECK_HEADERS(float.h, AC_DEFINE(HAVE_FLOAT_H))
 AC_CHECK_HEADERS(limits.h, AC_DEFINE(HAVE_LIMITS_H))
+AC_CHECK_HEADERS(pwd.h, AC_DEFINE(HAVE_PWD_H))
+AC_CHECK_HEADERS(sys/param.h, AC_DEFINE(HAVE_SYS_PARAM_H))
+AC_CHECK_HEADERS(sys/select.h, AC_DEFINE(HAVE_SYS_SELECT_H))
+AC_CHECK_HEADERS(sys/time.h, AC_DEFINE(HAVE_SYS_TIME_H))
+AC_CHECK_HEADERS(sys/times.h, AC_DEFINE(HAVE_SYS_TIMES_H))
+AC_CHECK_HEADERS(unistd.h, AC_DEFINE(HAVE_UNISTD_H))
 AC_CHECK_HEADERS(values.h, AC_DEFINE(HAVE_VALUES_H))
 
-# Check for strerror, strsignal, memmove, vsnprintf, and strcasecmp functions
-AC_CHECK_FUNCS(strerror strsignal memmove vsnprintf strcasecmp)
+# Check for some functions
+AC_CHECK_FUNCS(lstat strerror strsignal memmove vsnprintf strcasecmp)
+AC_CHECK_LIB(m,rint,AC_DEFINE(HAVE_RINT),)
 
 # Check for sys_errlist
 AC_MSG_CHECKING(for sys_errlist)
diff -ru3 -N /home/src/gnomecvs/glib/gerror.c ./gerror.c
--- /home/src/gnomecvs/glib/gerror.c	Wed Sep  9 10:55:55 1998
+++ ./gerror.c	Mon Oct 12 20:27:06 1998
@@ -20,13 +20,19 @@
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include "glib.h"
+#ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
+#endif
+#ifdef HAVE_SYS_TIMES_H
 #include <sys/times.h>
+#endif
 #include <sys/types.h>
 
 #include <time.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-#include "glib.h"
+#endif
 
 #ifdef HAVE_SYS_SELECT_H
 #include <sys/select.h>
@@ -36,6 +42,9 @@
 #include <string.h> /* for bzero on BSD systems */
 #endif
 
+#ifdef _MSC_VER
+#include <process.h>		/* For _getpid() */
+#endif
 
 #ifndef NO_FD_SET
 #  define SELECT_MASK fd_set
@@ -115,6 +124,7 @@
 void
 g_on_error_stack_trace (const gchar *prg_name)
 {
+#ifndef NATIVE_WIN32
   pid_t pid;
   gchar buf[16];
   gchar *args[4] = { "gdb", NULL, NULL, NULL };
@@ -142,6 +152,9 @@
   while (glib_on_error_halt)
     ;
   glib_on_error_halt = TRUE;
+#else
+  abort ();
+#endif
 }
 
 static gboolean stack_trace_done = FALSE;
@@ -155,6 +168,7 @@
 static void
 stack_trace (char **args)
 {
+#ifndef NATIVE_WIN32
   pid_t pid;
   int in_fd[2];
   int out_fd[2];
@@ -249,4 +263,7 @@
   close (out_fd[0]);
   close (out_fd[1]);
   _exit (0);
+#else
+  abort ();
+#endif
 }
diff -ru3 -N /home/src/gnomecvs/glib/glib.def ./glib.def
--- /home/src/gnomecvs/glib/glib.def	Thu Jan  1 02:00:00 1970
+++ ./glib.def	Thu Oct 15 01:29:52 1998
@@ -0,0 +1,302 @@
+EXPORTS
+	g_array_append_vals
+	g_array_free
+	g_array_new
+	g_array_prepend_vals
+	g_array_set_size
+	g_atexit
+	g_basename
+	g_bit_nth_lsf
+	g_bit_nth_msf
+	g_bit_storage
+	g_blow_chunks
+	g_byte_array_append
+	g_byte_array_free
+	g_byte_array_new
+	g_byte_array_prepend
+	g_byte_array_set_size
+	g_cache_destroy
+	g_cache_insert
+	g_cache_key_foreach
+	g_cache_new
+	g_cache_remove
+	g_cache_value_foreach
+	g_closedir
+	g_completion_add_items
+	g_completion_clear_items
+	g_completion_complete
+	g_completion_free
+	g_completion_new
+	g_completion_remove_items
+	g_datalist_clear
+	g_datalist_foreach
+	g_datalist_id_get_data
+	g_datalist_id_remove_no_notify
+	g_datalist_id_set_data_full
+	g_datalist_init
+	g_dataset_destroy
+	g_dataset_foreach
+	g_dataset_id_get_data
+	g_dataset_id_remove_no_notify
+	g_dataset_id_set_data_full
+	g_direct_equal
+	g_direct_hash
+	g_dirname
+	g_free
+	g_ftruncate
+	g_get_current_dir
+	g_get_home_dir
+	g_get_prgname
+	g_get_real_name
+	g_get_tmp_dir
+	g_get_user_name
+	g_getenv
+	g_hash_table_destroy
+	g_hash_table_foreach
+	g_hash_table_foreach_remove
+	g_hash_table_freeze
+	g_hash_table_insert
+	g_hash_table_lookup
+	g_hash_table_lookup_extended
+	g_hash_table_new
+	g_hash_table_remove
+	g_hash_table_size
+	g_hash_table_thaw
+	g_hook_alloc
+	g_hook_compare_ids
+	g_hook_destroy
+	g_hook_destroy_link
+	g_hook_find
+	g_hook_find_data
+	g_hook_find_func
+	g_hook_find_func_data
+	g_hook_first_valid
+	g_hook_free
+	g_hook_get
+	g_hook_insert_before
+	g_hook_insert_sorted
+	g_hook_list_init
+	g_hook_list_invoke
+	g_hook_list_invoke_check
+	g_hook_list_marshal
+	g_hook_list_clear
+	g_hook_next_valid
+	g_hook_prepend
+	g_hook_ref
+	g_hook_unref
+	g_int_equal
+	g_int_hash
+	g_iochannel_new
+	g_iochannel_free
+	g_iochannel_close_and_free
+	g_iochannel_wakeup_peer
+	g_list_alloc
+	g_list_allocator_free
+	g_list_allocator_new
+	g_list_append
+	g_list_concat
+	g_list_find
+	g_list_find_custom
+	g_list_first
+	g_list_foreach
+	g_list_free
+	g_list_free_1
+	g_list_index
+	g_list_insert
+	g_list_insert_sorted
+	g_list_last
+	g_list_length
+	g_list_nth
+	g_list_nth_data
+	g_list_position
+	g_list_prepend
+	g_list_remove
+	g_list_remove_link
+	g_list_reverse
+	g_list_set_allocator
+	g_log
+	g_log_default_handler
+	g_log_remove_handler
+	g_log_set_always_fatal
+	g_log_set_fatal_mask
+	g_log_set_handler
+	g_logv
+	g_malloc
+	g_malloc0
+	g_mem_check
+	g_mem_chunk_alloc
+	g_mem_chunk_alloc0
+	g_mem_chunk_clean
+	g_mem_chunk_destroy
+	g_mem_chunk_free
+	g_mem_chunk_info
+	g_mem_chunk_new
+	g_mem_chunk_print
+	g_mem_chunk_reset
+	g_mem_profile
+	g_memdup
+	g_node_child_index
+	g_node_child_position
+	g_node_children_foreach
+	g_node_depth
+	g_node_destroy
+	g_node_find
+	g_node_find_child
+	g_node_first_sibling
+	g_node_get_root
+	g_node_insert
+	g_node_insert_before
+	g_node_is_ancestor
+	g_node_last_child
+	g_node_last_sibling
+	g_node_max_height
+	g_node_n_children
+	g_node_n_nodes
+	g_node_new
+	g_node_nth_child
+	g_node_prepend
+	g_node_reverse_children
+	g_node_traverse
+	g_node_unlink
+	g_on_error_query
+	g_on_error_stack_trace
+	g_opendir
+	g_parse_debug_string
+	g_path_is_absolute
+	g_path_skip_root
+	g_print
+	g_printerr
+	g_printf_string_upper_bound
+	g_ptr_array_add
+	g_ptr_array_free
+	g_ptr_array_new
+	g_ptr_array_remove
+	g_ptr_array_remove_index
+	g_ptr_array_set_size
+	g_quark_from_static_string
+	g_quark_from_string
+	g_quark_to_string
+	g_quark_try_string
+	g_readdir
+	g_realloc
+	g_relation_count
+	g_relation_delete
+	g_relation_destroy
+	g_relation_exists
+	g_relation_index
+	g_relation_insert
+	g_relation_new
+	g_relation_print
+	g_relation_select
+	g_rewinddir
+	g_scanner_cur_line
+	g_scanner_cur_position
+	g_scanner_cur_token
+	g_scanner_cur_value
+	g_scanner_destroy
+	g_scanner_eof
+	g_scanner_error
+	g_scanner_freeze_symbol_table
+	g_scanner_get_next_token
+	g_scanner_input_file
+	g_scanner_input_text
+	g_scanner_lookup_symbol
+	g_scanner_new
+	g_scanner_peek_next_token
+	g_scanner_scope_add_symbol
+	g_scanner_scope_foreach_symbol
+	g_scanner_scope_lookup_symbol
+	g_scanner_scope_remove_symbol
+	g_scanner_set_scope
+	g_scanner_stat_mode
+	g_scanner_thaw_symbol_table
+	g_scanner_unexp_token
+	g_scanner_warn
+	g_set_error_handler
+	g_set_message_handler
+	g_set_prgname
+	g_set_print_handler
+	g_set_printerr_handler
+	g_set_warning_handler
+	g_slist_alloc
+	g_slist_append
+	g_slist_concat
+	g_slist_find
+	g_slist_find_custom
+	g_slist_foreach
+	g_slist_free
+	g_slist_free_1
+	g_slist_index
+	g_slist_insert
+	g_slist_insert_sorted
+	g_slist_last
+	g_slist_length
+	g_slist_nth
+	g_slist_nth_data
+	g_slist_position
+	g_slist_prepend
+	g_slist_remove
+	g_slist_remove_link
+	g_slist_reverse
+	g_slist_set_allocator
+	g_snprintf
+	g_str_equal
+	g_str_hash
+	g_strcasecmp
+	g_strconcat
+	g_strdelimit
+	g_strdown
+	g_strdup
+	g_strdup_printf
+	g_strdup_vprintf
+	g_strerror
+	g_string_append
+	g_string_append_c
+	g_string_assign
+	g_string_chunk_free
+	g_string_chunk_insert
+	g_string_chunk_insert_const
+	g_string_chunk_new
+	g_string_down
+	g_string_erase
+	g_string_free
+	g_string_insert
+	g_string_insert_c
+	g_string_new
+	g_string_prepend
+	g_string_prepend_c
+	g_string_sized_new
+	g_string_sprintf
+	g_string_sprintfa
+	g_string_truncate
+	g_string_up
+	g_strndup
+	g_strnfill
+	g_strquote
+	g_strreverse
+	g_strsignal
+	g_strtod
+	g_strup
+	g_timer_destroy
+	g_timer_elapsed
+	g_timer_new
+	g_timer_reset
+	g_timer_start
+	g_timer_stop
+	g_tree_destroy
+	g_tree_height
+	g_tree_insert
+	g_tree_lookup
+	g_tree_new
+	g_tree_nnodes
+	g_tree_remove
+	g_tree_search
+	g_tree_traverse
+	g_tuples_destroy
+	g_tuples_index
+	g_vsnprintf
+	glib_binary_age
+	glib_interface_age
+	glib_major_version
+	glib_micro_version
+	glib_minor_version
diff -ru3 -N /home/src/gnomecvs/glib/glib.h ./glib.h
--- /home/src/gnomecvs/glib/glib.h	Thu Oct  8 10:54:11 1998
+++ ./glib.h	Thu Oct 15 11:29:12 1998
@@ -34,6 +34,52 @@
 #endif
 
 
+#ifdef NATIVE_WIN32
+
+/* On native Win32, directory separator is the backslash, and search path
+ * separator is the semicolon.
+ */
+#define G_DIR_SEPARATOR '\\'
+#define G_DIR_SEPARATOR_S "\\"
+#define G_SEARCHPATH_SEPARATOR ';'
+#define G_SEARCHPATH_SEPARATOR_S ";"
+
+#else  /* !NATIVE_WIN32 */
+
+/* Unix */
+
+#define G_DIR_SEPARATOR '/'
+#define G_DIR_SEPARATOR_S "/"
+#define G_SEARCHPATH_SEPARATOR ':'
+#define G_SEARCHPATH_SEPARATOR_S ":"
+
+#endif /* !NATIVE_WIN32 */
+
+#ifdef _MSC_VER
+/* Make MSVC more pedantic, this is a recommended pragma list
+   from _Win32_Programming_ by Rector and Newcomer.  */
+#pragma warning(error:4002)
+#pragma warning(error:4003)
+#pragma warning(1:4010)
+#pragma warning(error:4013)
+#pragma warning(1:4016)
+#pragma warning(error:4020)
+#pragma warning(error:4021)
+#pragma warning(error:4027)
+#pragma warning(error:4029)
+#pragma warning(error:4033)
+#pragma warning(error:4035)
+#pragma warning(error:4045)
+#pragma warning(error:4047)
+#pragma warning(error:4049)
+#pragma warning(error:4053)
+#pragma warning(error:4071)
+#pragma warning(disable:4101)
+#pragma warning(error:4150)
+
+#pragma warning(disable:4244)	/* No possible loss of data warnings, please */
+#endif /* _MSC_VER */
+
 /* glib provides definitions for the extrema of many
  *  of the standard types. These are:
  * G_MINFLOAT
@@ -552,12 +598,21 @@
 
 /* Glib version.
  */
-extern const guint glib_major_version;
-extern const guint glib_minor_version;
-extern const guint glib_micro_version;
-extern const guint glib_interface_age;
-extern const guint glib_binary_age;
+#ifdef NATIVE_WIN32
+#ifdef COMPILING_GLIB
+#define GUTILS_C_VAR __declspec(dllexport)
+#else
+#define GUTILS_C_VAR __declspec(dllimport)
+#endif
+#else
+#define GUTILS_C_VAR extern
+#endif
 
+GUTILS_C_VAR const guint glib_major_version;
+GUTILS_C_VAR const guint glib_minor_version;
+GUTILS_C_VAR const guint glib_micro_version;
+GUTILS_C_VAR const guint glib_interface_age;
+GUTILS_C_VAR const guint glib_binary_age;
 
 /* Forward declarations of glib types.
  */
@@ -586,7 +641,7 @@
 typedef struct _GTree		GTree;
 typedef struct _GTuples		GTuples;
 typedef union  _GTokenValue	GTokenValue;
-
+typedef struct _GIOChannel	GIOChannel;
 
 typedef enum
 {
@@ -1124,7 +1179,7 @@
 
 /* Logging mechanism
  */
-extern const gchar			*g_log_domain_glib;
+extern	        const gchar		*g_log_domain_glib;
 guint		g_log_set_handler	(const gchar	*log_domain,
 					 GLogLevelFlags	 log_levels,
 					 GLogFunc	 log_func,
@@ -1314,6 +1369,7 @@
 void	 g_strreverse		(gchar	     *string);
 gpointer g_memdup		(gconstpointer mem,
 				 guint	       byte_size);
+gchar *  g_strquote		(gchar	     *string);
 
 /* calculate a string size, guarranteed to fit format + args.
  */
@@ -1345,10 +1401,15 @@
 				 gchar const *format,
 				 va_list      args);
 gchar*	g_basename		(const gchar *file_name);
+/* Check if a file name is an absolute path */
+gboolean g_path_is_absolute	(const gchar *file_name);
+/* In case of absolute paths, skip the root part */
+gchar*  g_path_skip_root	(gchar       *file_name);
 
 /* strings are newly allocated with g_malloc() */
 gchar*	g_dirname		(const gchar *file_name);
 gchar*	g_get_current_dir	(void);
+gchar*  g_getenv		(const gchar *variable);
 
 /* We make the assumption that if memmove isn't available, then
  * bcopy will do the job. This isn't safe everywhere. (bcopy can't
@@ -1430,6 +1491,30 @@
 }
 #endif	/* G_CAN_INLINE */
 
+#if defined (__WATCOMC__)
+/* Prevent some compilers from warning about these functions if unused... */
+
+static void inlines_reference_dummy_func (void);
+
+static void (*inlines_reference_dummy_array[])() = {
+#ifndef __GNUC__
+  (void (*)()) g_error,
+  (void (*)()) g_message,
+  (void (*)()) g_warning,
+#endif
+  (void (*)()) g_bit_nth_lsf,
+  (void (*)()) g_bit_nth_msf,
+  (void (*)()) g_bit_storage,
+  (void (*)()) inlines_reference_dummy_func
+};
+
+static void
+inlines_reference_dummy_func (void)
+{
+  (inlines_reference_dummy_array[0]) ();
+}
+
+#endif
 
 /* String Chunks
  */
@@ -1922,11 +2007,167 @@
 
 guint	   g_spaced_primes_closest (guint num);
 
-/* Glib version.
- */
-extern const guint glib_major_version;
-extern const guint glib_minor_version;
-extern const guint glib_micro_version;
+
+/* 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.
+ */
+struct _GIOChannel
+{
+  int 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 peer_offset;		/* in input channels where the writer's
+				 * offset is, so we don't try to read too much
+				 */
+#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
+
+#ifndef HAVE_RINT
+#define rint(x) (floor (x + 0.5)) /* ??? */
+#endif
+
+#ifdef NATIVE_WIN32
+
+#define MAXPATHLEN 1024
+
+#ifdef __WATCOMC__
+
+/* We have our own POSIX-style open/read/write/lseek/close emulation
+ * routines.  We use them with Watcom which also has them, but
+ * they don't work if used both in the main program and in a DLL. (At
+ * least with Watcom C32 10.6, where the C library is static, dunno if it
+ * is a DLL in current versions.)
+ *
+ * The "file descriptors" used by these routines are simply Win32
+ * HANDLEs cast as ints (essentially of random value), and certainly
+ * not smallish ints as typically in (required by?) POSIX.  Hopefully
+ * that doesn't matter.
+ */
+
+#define O_RDONLY	0x0000
+#define O_WRONLY	0x0001
+#define O_RDWR		0x0002
+#define O_APPEND	0x0010
+#define O_CREAT 	0x0020
+#define O_TRUNC		0x0040
+#define O_EXCL		0x0400
+
+#define SEEK_SET	0
+#define SEEK_CUR	1
+#define SEEK_END	2
+
+typedef guint mode_t;
+typedef glong off_t;
+typedef int ssize_t;
+
+#define getpid g_getpid
+int g_getpid (void);
+
+#define open g_open
+#define creat g_creat
+#define read g_read
+#define write g_write
+#define lseek g_lseek
+#define ftruncate g_ftruncate
+#define close g_close
+
+int g_open      (const char *path,
+		 int         flags,
+		 ...);
+int g_creat     (const char *path,
+		 mode_t      mode);
+ssize_t g_read  (int   fd,
+		 char *buf,
+		 int   buflen);
+ssize_t g_write (int         fd,
+		 const char *buf,
+		 int         buflen);
+off_t g_lseek   (int fd,
+		 off_t offset,
+		 int whence);
+int   g_ftruncate (int     fd,
+		   ssize_t new_size);
+
+int g_close     (int fd);
+
+
+#define popen g_popen
+#define pclose g_pclose
+
+/* g_popen and g_pclose actually don't work */
+void *g_popen   (const char *command,
+		 const char *mode);
+
+int g_pclose	(void *fp);
+
+#endif /* __WATCOMC__ */
+
+#if defined (_MSC_VER)
+
+typedef int pid_t;
+
+#define getpid _getpid
+#define access _access
+#define open _open
+#define read _read
+#define write _write
+#define lseek _lseek
+#define close _close
+#define pipe(phandles) _pipe(phandles,4096,_O_BINARY)
+#define popen _popen
+#define pclose _pclose
+#define fdopen _fdopen
+
+/* MSC doesn't have ftrunctate, we have it */
+#define ftruncate(fd, size) g_ftruncate (fd, size)
+extern int g_ftruncate (int f, unsigned int size);
+
+/* MSC needs our own opendir/readdir/closedir emulation routines */
+
+#define NAME_MAX 255
+
+typedef struct {
+  char *dir_name;
+  void *lpFindFileData;
+  guint hFindFile;
+  gboolean just_opened;
+} DIR;
+
+struct dirent {
+  char d_name[NAME_MAX+1];
+};
+
+#define opendir g_opendir
+#define readdir g_readdir
+#define rewinddir g_rewinddir
+#define closedir g_closedir
+
+DIR	       *opendir	  (const char *dirname);
+struct  dirent *readdir	  (DIR *dir);
+void		rewinddir (DIR *dir);
+int		closedir  (DIR *dir);
+
+#endif /* _MSC_VER */
+
+#endif /* NATIVE_WIN32 */
 
 #ifdef __cplusplus
 }
diff -ru3 -N /home/src/gnomecvs/glib/glib.wlk ./glib.wlk
--- /home/src/gnomecvs/glib/glib.wlk	Thu Jan  1 02:00:00 1970
+++ ./glib.wlk	Sun Oct  4 00:21:36 1998
@@ -0,0 +1,294 @@
+SYS nt_dll
+NAM glib_1_1
+FIL garray.obj,gcache.obj,gcompletion.obj,gdataset.obj,gerror.obj,ghash.obj,ghook.obj,glist.obj,gmem.obj,gmessages.obj,gnode.obj,gprimes.obj,grel.obj,gscanner.obj,gslist.obj,gstrfuncs.obj,gstring.obj,gtimer.obj,gtree.obj,gutils.obj
+EXP g_array_append_vals_
+EXP g_array_free_
+EXP g_array_new_
+EXP g_array_prepend_vals_
+EXP g_array_set_size_
+EXP g_atexit_
+EXP g_basename_
+EXP g_bit_nth_lsf_
+EXP g_bit_nth_msf_
+EXP g_bit_storage_
+EXP g_blow_chunks_
+EXP g_byte_array_append_
+EXP g_byte_array_free_
+EXP g_byte_array_new_
+EXP g_byte_array_prepend_
+EXP g_byte_array_set_size_
+EXP g_cache_destroy_
+EXP g_cache_insert_
+EXP g_cache_key_foreach_
+EXP g_cache_new_
+EXP g_cache_remove_
+EXP g_cache_value_foreach_
+EXP g_completion_add_items_
+EXP g_completion_clear_items_
+EXP g_completion_complete_
+EXP g_completion_free_
+EXP g_completion_new_
+EXP g_completion_remove_items_
+EXP g_datalist_clear_
+EXP g_datalist_foreach_
+EXP g_datalist_id_get_data_
+EXP g_datalist_id_set_data_full_
+EXP g_datalist_id_set_destroy_
+EXP g_datalist_init_
+EXP g_dataset_destroy_
+EXP g_dataset_foreach_
+EXP g_dataset_id_get_data_
+EXP g_dataset_id_set_data_full_
+EXP g_dataset_id_set_destroy_
+EXP g_direct_equal_
+EXP g_direct_hash_
+EXP g_dirname_
+EXP g_free_
+EXP g_get_current_dir_
+EXP g_get_home_dir_
+EXP g_get_prgname_
+EXP g_get_real_name_
+EXP g_get_tmp_dir_
+EXP g_get_user_name_
+EXP g_getpid_
+EXP g_hash_table_destroy_
+EXP g_hash_table_foreach_
+EXP g_hash_table_foreach_remove_
+EXP g_hash_table_freeze_
+EXP g_hash_table_insert_
+EXP g_hash_table_lookup_
+EXP g_hash_table_lookup_extended_
+EXP g_hash_table_new_
+EXP g_hash_table_remove_
+EXP g_hash_table_size_
+EXP g_hash_table_thaw_
+EXP g_hook_alloc_
+EXP g_hook_compare_ids_
+EXP g_hook_destroy_
+EXP g_hook_destroy_link_
+EXP g_hook_find_
+EXP g_hook_find_data_
+EXP g_hook_find_func_
+EXP g_hook_find_func_data_
+EXP g_hook_first_valid_
+EXP g_hook_free_
+EXP g_hook_get_
+EXP g_hook_insert_before_
+EXP g_hook_insert_sorted_
+EXP g_hook_list_init_
+EXP g_hook_list_invoke_
+EXP g_hook_list_invoke_check_
+EXP g_hook_list_marshal_
+EXP g_hook_list_clear_
+EXP g_hook_next_valid_
+EXP g_hook_prepend_
+EXP g_hook_ref_
+EXP g_hook_unref_
+EXP g_int_equal_
+EXP g_int_hash_
+EXP g_iochannel_new_
+EXP g_iochannel_free_
+EXP g_iochannel_close_and_free_
+EXP g_list_alloc_
+EXP g_list_allocator_free_
+EXP g_list_allocator_new_
+EXP g_list_append_
+EXP g_list_concat_
+EXP g_list_find_
+EXP g_list_find_custom_
+EXP g_list_first_
+EXP g_list_foreach_
+EXP g_list_free_
+EXP g_list_free_1_
+EXP g_list_index_
+EXP g_list_insert_
+EXP g_list_insert_sorted_
+EXP g_list_last_
+EXP g_list_length_
+EXP g_list_nth_
+EXP g_list_nth_data_
+EXP g_list_position_
+EXP g_list_prepend_
+EXP g_list_remove_
+EXP g_list_remove_link_
+EXP g_list_reverse_
+EXP g_list_set_allocator_
+EXP g_log_
+EXP g_log_default_handler_
+EXP g_log_remove_handler_
+EXP g_log_set_always_fatal_
+EXP g_log_set_fatal_mask_
+EXP g_log_set_handler_
+EXP g_logv_
+EXP g_malloc_
+EXP g_malloc0_
+EXP g_mem_check_
+EXP g_mem_chunk_alloc_
+EXP g_mem_chunk_alloc0_
+EXP g_mem_chunk_clean_
+EXP g_mem_chunk_destroy_
+EXP g_mem_chunk_free_
+EXP g_mem_chunk_info_
+EXP g_mem_chunk_new_
+EXP g_mem_chunk_print_
+EXP g_mem_chunk_reset_
+EXP g_mem_profile_
+EXP g_memdup_
+EXP g_node_child_index_
+EXP g_node_child_position_
+EXP g_node_children_foreach_
+EXP g_node_depth_
+EXP g_node_destroy_
+EXP g_node_find_
+EXP g_node_find_child_
+EXP g_node_first_sibling_
+EXP g_node_get_root_
+EXP g_node_insert_
+EXP g_node_insert_before_
+EXP g_node_is_ancestor_
+EXP g_node_last_child_
+EXP g_node_last_sibling_
+EXP g_node_max_height_
+EXP g_node_n_children_
+EXP g_node_n_nodes_
+EXP g_node_new_
+EXP g_node_nth_child_
+EXP g_node_prepend_
+EXP g_node_reverse_children_
+EXP g_node_traverse_
+EXP g_node_unlink_
+EXP g_on_error_query_
+EXP g_on_error_stack_trace_
+EXP g_parse_debug_string_
+EXP g_path_is_absolute_
+EXP g_pclose_
+EXP g_popen_
+EXP g_print_
+EXP g_printerr_
+EXP g_printf_string_upper_bound_
+EXP g_ptr_array_add_
+EXP g_ptr_array_free_
+EXP g_ptr_array_new_
+EXP g_ptr_array_remove_
+EXP g_ptr_array_remove_index_
+EXP g_ptr_array_set_size_
+EXP g_quark_from_static_string_
+EXP g_quark_from_string_
+EXP g_quark_to_string_
+EXP g_quark_try_string_
+EXP g_realloc_
+EXP g_relation_count_
+EXP g_relation_delete_
+EXP g_relation_destroy_
+EXP g_relation_exists_
+EXP g_relation_index_
+EXP g_relation_insert_
+EXP g_relation_new_
+EXP g_relation_print_
+EXP g_relation_select_
+EXP g_scanner_cur_line_
+EXP g_scanner_cur_position_
+EXP g_scanner_cur_token_
+EXP g_scanner_cur_value_
+EXP g_scanner_destroy_
+EXP g_scanner_eof_
+EXP g_scanner_error_
+EXP g_scanner_freeze_symbol_table_
+EXP g_scanner_get_next_token_
+EXP g_scanner_input_file_
+EXP g_scanner_input_text_
+EXP g_scanner_lookup_symbol_
+EXP g_scanner_new_
+EXP g_scanner_peek_next_token_
+EXP g_scanner_scope_add_symbol_
+EXP g_scanner_scope_foreach_symbol_
+EXP g_scanner_scope_lookup_symbol_
+EXP g_scanner_scope_remove_symbol_
+EXP g_scanner_set_scope_
+EXP g_scanner_stat_mode_
+EXP g_scanner_thaw_symbol_table_
+EXP g_scanner_unexp_token_
+EXP g_scanner_warn_
+EXP g_set_error_handler_
+EXP g_set_message_handler_
+EXP g_set_prgname_
+EXP g_set_print_handler_
+EXP g_set_printerr_handler_
+EXP g_set_warning_handler_
+EXP g_slist_alloc_
+EXP g_slist_append_
+EXP g_slist_concat_
+EXP g_slist_find_
+EXP g_slist_find_custom_
+EXP g_slist_foreach_
+EXP g_slist_free_
+EXP g_slist_free_1_
+EXP g_slist_index_
+EXP g_slist_insert_
+EXP g_slist_insert_sorted_
+EXP g_slist_last_
+EXP g_slist_length_
+EXP g_slist_nth_
+EXP g_slist_nth_data_
+EXP g_slist_position_
+EXP g_slist_prepend_
+EXP g_slist_remove_
+EXP g_slist_remove_link_
+EXP g_slist_reverse_
+EXP g_slist_set_allocator_
+EXP g_snprintf_
+EXP g_str_equal_
+EXP g_str_hash_
+EXP g_strcasecmp_
+EXP g_strconcat_
+EXP g_strdelimit_
+EXP g_strdown_
+EXP g_strdup_
+EXP g_strdup_printf_
+EXP g_strdup_vprintf_
+EXP g_strerror_
+EXP g_string_append_
+EXP g_string_append_c_
+EXP g_string_assign_
+EXP g_string_chunk_free_
+EXP g_string_chunk_insert_
+EXP g_string_chunk_insert_const_
+EXP g_string_chunk_new_
+EXP g_string_down_
+EXP g_string_erase_
+EXP g_string_free_
+EXP g_string_insert_
+EXP g_string_insert_c_
+EXP g_string_new_
+EXP g_string_prepend_
+EXP g_string_prepend_c_
+EXP g_string_sized_new_
+EXP g_string_sprintf_
+EXP g_string_sprintfa_
+EXP g_string_truncate_
+EXP g_string_up_
+EXP g_strndup_
+EXP g_strnfill_
+EXP g_strquote_
+EXP g_strreverse_
+EXP g_strsignal_
+EXP g_strtod_
+EXP g_strup_
+EXP g_timer_destroy_
+EXP g_timer_elapsed_
+EXP g_timer_new_
+EXP g_timer_reset_
+EXP g_timer_start_
+EXP g_timer_stop_
+EXP g_tree_destroy_
+EXP g_tree_height_
+EXP g_tree_insert_
+EXP g_tree_lookup_
+EXP g_tree_new_
+EXP g_tree_nnodes_
+EXP g_tree_remove_
+EXP g_tree_search_
+EXP g_tree_traverse_
+EXP g_tuples_destroy_
+EXP g_tuples_index_
+EXP g_vsnprintf_
diff -ru3 -N /home/src/gnomecvs/glib/glibconfig.h.in ./glibconfig.h.in
--- /home/src/gnomecvs/glib/glibconfig.h.in	Wed Sep  9 10:55:56 1998
+++ ./glibconfig.h.in	Thu Oct 15 13:18:45 1998
@@ -21,9 +21,14 @@
 #undef HAVE_FLOAT_H
 #undef HAVE_LIMITS_H
 #undef HAVE_LONG_DOUBLE
+#undef HAVE_PWD_H
+#undef HAVE_SYS_PARAM_H
 #undef HAVE_SYS_SELECT_H
+#undef HAVE_SYS_TIME_H
+#undef HAVE_SYS_TIMES_H
 #undef HAVE_STRERROR
 #undef HAVE_STRSIGNAL
+#undef HAVE_UNISTD_H
 #undef HAVE_VSNPRINTF
 #undef HAVE_VALUES_H
 #undef HAVE_VPRINTF
@@ -67,12 +72,18 @@
 /* Define if you have the atexit function.  */
 #undef HAVE_ATEXIT
 
+/* Define if you have the lstat function.  */
+#undef HAVE_LSTAT
+
 /* Define if you have the memmove function.  */
 #undef HAVE_MEMMOVE
 
 /* Define if you have the on_exit function.  */
 #undef HAVE_ON_EXIT
 
+/* Define if you have the rint function.  */
+#undef HAVE_RINT
+
 /* Define if you have the strcasecmp function.  */
 #undef HAVE_STRCASECMP
 
@@ -93,3 +104,9 @@
 
 /* Define if you have the <values.h> header file.  */
 #undef HAVE_VALUES_H
+
+/* Define if this is Win32, possibly using the GNU-Win32 emulation layer. */
+#undef WIN32
+
+/* Define if this is Win32 without GNU-Win32.  */
+#undef NATIVE_WIN32 1
diff -ru3 -N /home/src/gnomecvs/glib/glibconfig.h.win32 ./glibconfig.h.win32
--- /home/src/gnomecvs/glib/glibconfig.h.win32	Thu Jan  1 02:00:00 1970
+++ ./glibconfig.h.win32	Thu Oct 15 12:59:26 1998
@@ -0,0 +1,130 @@
+/* glibconfig.h.win32. Handcrafted for MSVC and Watcom.  */
+
+#if !(defined(_MSC_VER) || defined(__WATCOMC__) || defined(__LCC__))
+#error Unrecognized Win32 compiler, edit glibconfig.h by hand
+#endif
+
+/* Define to empty if the keyword does not work.  */
+/* #undef const */
+
+/* Define if you don't have vprintf but do have _doprnt.  */
+/* #undef HAVE_DOPRNT */
+
+/* Define if you have the vprintf function.  */
+#define HAVE_VPRINTF 1
+
+/* Define as __inline if that's what the C compiler calls it.  */
+#if defined (_MSC_VER)
+#define G_HAVE___INLINE
+#endif
+
+/* Define if you have the ANSI C header files.  */
+#define STDC_HEADERS 1
+
+/* #undef ENABLE_MEM_CHECK */
+/* #undef ENABLE_MEM_PROFILE */
+
+/* #undef G_COMPILED_WITH_DEBUGGING */
+/* #undef HAVE_BROKEN_WCTYPE */
+/* #undef HAVE_DOPRNT */
+/* #undef HAVE_LONG_DOUBLE */
+/* #undef HAVE_PWD_H */
+/* #undef HAVE_SYS_PARAM_H */
+/* #undef HAVE_SYS_SELECT_H */
+/* #undef HAVE_SYS_TIME_H */
+/* #undef HAVE_SYS_TIMES_H */
+#ifdef __WATCOMC__
+#define HAVE_UNISTD_H 1
+#else
+/* #undef HAVE_UNISTD_H */
+#endif
+/* #undef HAVE_VSNPRINTF */
+#define HAVE_VPRINTF 1
+#ifdef _MSC_VER
+#define HAVE_WCHAR_H 1
+#define HAVE_WCTYPE_H 1
+#else
+#undef HAVE_WCHAR_H
+#undef HAVE_WCTYPE_H
+#endif
+
+/* #undef NO_FD_SET */
+/* #undef NO_SYS_ERRLIST */
+#define NO_SYS_SIGLIST 1
+
+#ifdef __WATCOMC__
+#define G_VA_COPY(ap1, ap2) (*(ap1)) = (*(ap2))
+#endif
+
+#define GLIB_MAJOR_VERSION 1
+#define GLIB_MINOR_VERSION 1
+#define GLIB_MICRO_VERSION 4
+#define GLIB_INTERFACE_AGE 0
+#define GLIB_BINARY_AGE 0
+
+/* The number of bytes in a char.  */
+#define SIZEOF_CHAR 1
+
+/* The number of bytes in a int.  */
+#define SIZEOF_INT 4
+
+/* The number of bytes in a long.  */
+#define SIZEOF_LONG 4
+
+/* The number of bytes in a long long.  */
+/* #undef SIZEOF_LONG_LONG */
+
+/* The number of bytes in a short.  */
+#define SIZEOF_SHORT 2
+
+/* The number of bytes in a void *.  */
+#define SIZEOF_VOID_P 4
+
+/* Define if you have the atexit function.  */
+#define HAVE_ATEXIT 1
+
+/* Define if you have the lstat function.  */
+/* #undef HAVE_LSTAT */
+
+/* Define if you have the memmove function.  */
+#define HAVE_MEMMOVE 1
+
+/* Define if you have the on_exit function.  */
+/* #undef HAVE_ON_EXIT */
+
+/* Define if you have the rint function.  */
+/* #undef HAVE_RINT */
+
+/* Define if you have the strcasecmp function.  */
+/* #undef HAVE_STRCASECMP */
+
+/* Define if you have the strerror function.  */
+#define HAVE_STRERROR 1
+
+/* Define if you have the strsignal function.  */
+/* #undef HAVE_STRSIGNAL */
+
+/* Define if you have the vsnprintf function.  */
+/* #undef HAVE_VSNPRINTF */
+
+/* Define if you have the getpid function.  */
+/* #undef HAVE_GETPID */
+
+/* Define if you have the <float.h> header file.  */
+#ifdef _MSC_VER
+#define HAVE_FLOAT_H 1
+#else
+/* #undef HAVE_FLOAT_H */
+#endif
+
+/* Define if you have the <limits.h> header file.  */
+#define HAVE_LIMITS_H 1
+
+/* Define if you have the <values.h> header file.  */
+/* #undef HAVE_VALUES_H */
+
+/* Define if this is Win32, possibly using the GNU-Win32 emulation layer. */
+#define WIN32 1
+
+/* Define if this is Win32 without GNU-Win32.  */
+#define NATIVE_WIN32 1
diff -ru3 -N /home/src/gnomecvs/glib/gmem.c ./gmem.c
--- /home/src/gnomecvs/glib/gmem.c	Tue Oct  6 21:31:24 1998
+++ ./gmem.c	Wed Oct  7 01:53:04 1998
@@ -23,6 +23,7 @@
 /* #define ENABLE_MEM_PROFILE */
 /* #define ENABLE_MEM_PROFILE_EXCLUDES_MEM_CHUNKS */
 /* #define ENABLE_MEM_CHECK */
+#define MEM_PROFILE_TABLE_SIZE 8192
 
 /*
  * This library can check for some attempts to do illegal things to
@@ -114,7 +115,7 @@
 static GRealMemChunk *mem_chunks = NULL;
 
 #ifdef ENABLE_MEM_PROFILE
-static gulong allocations[4096] = { 0 };
+static gulong allocations[MEM_PROFILE_TABLE_SIZE] = { 0 };
 static gulong allocated_mem = 0;
 static gulong freed_mem = 0;
 static gint allocating_for_mem_chunk = 0;
@@ -127,17 +128,17 @@
 g_malloc (gulong size)
 {
   gpointer p;
-  
+
   
 #if defined(ENABLE_MEM_PROFILE) || defined(ENABLE_MEM_CHECK)
   gulong *t;
 #endif /* ENABLE_MEM_PROFILE || ENABLE_MEM_CHECK */
   
-  
+
   if (size == 0)
     return NULL;
   
-  
+
 #if defined(ENABLE_MEM_PROFILE) || defined(ENABLE_MEM_CHECK)
   size += SIZEOF_LONG;
 #endif /* ENABLE_MEM_PROFILE || ENABLE_MEM_CHECK */
@@ -171,10 +172,10 @@
 #  ifdef ENABLE_MEM_PROFILE_EXCLUDES_MEM_CHUNKS
   if(!allocating_for_mem_chunk) {
 #  endif
-    if (size <= 4095)
+    if (size <= MEM_PROFILE_TABLE_SIZE - 1)
       allocations[size-1] += 1;
     else
-      allocations[4095] += 1;
+      allocations[MEM_PROFILE_TABLE_SIZE-1] += 1;
     allocated_mem += size;
 #  ifdef ENABLE_MEM_PROFILE_EXCLUDES_MEM_CHUNKS
   }
@@ -182,7 +183,7 @@
 #endif /* ENABLE_MEM_PROFILE */
 #endif /* ENABLE_MEM_PROFILE || ENABLE_MEM_CHECK */
   
-  
+
   return p;
 }
 
@@ -201,7 +202,7 @@
     return NULL;
   
   
-#if defined (ENABLE_MEM_PROFILE) || defined (ENABLE_MEM_CHECK)
+#if defined(ENABLE_MEM_PROFILE) || defined (ENABLE_MEM_CHECK)
   size += SIZEOF_LONG;
 #endif /* ENABLE_MEM_PROFILE || ENABLE_MEM_CHECK */
   
@@ -234,10 +235,10 @@
 #    ifdef ENABLE_MEM_PROFILE_EXCLUDES_MEM_CHUNKS
   if(!allocating_for_mem_chunk) {
 #    endif
-    if (size <= 4095)
+    if (size <= (MEM_PROFILE_TABLE_SIZE-1))
       allocations[size-1] += 1;
     else
-      allocations[4095] += 1;
+      allocations[MEM_PROFILE_TABLE_SIZE-1] += 1;
     allocated_mem += size;
 #    ifdef ENABLE_MEM_PROFILE_EXCLUDES_MEM_CHUNKS
   }
@@ -318,10 +319,10 @@
 #ifdef ENABLE_MEM_PROFILE_EXCLUDES_MEM_CHUNKS
   if(!allocating_for_mem_chunk) {
 #endif
-    if (size <= 4095)
+    if (size <= (MEM_PROFILE_TABLE_SIZE-1))
       allocations[size-1] += 1;
     else
-      allocations[4095] += 1;
+      allocations[MEM_PROFILE_TABLE_SIZE-1] += 1;
     allocated_mem += size;
 #ifdef ENABLE_MEM_PROFILE_EXCLUDES_MEM_CHUNKS
   }
@@ -375,14 +376,15 @@
 #ifdef ENABLE_MEM_PROFILE
   gint i;
   
-  for (i = 0; i < 4095; i++)
+  for (i = 0; i < (MEM_PROFILE_TABLE_SIZE-1); i++)
     if (allocations[i] > 0)
       g_log (g_log_domain_glib, G_LOG_LEVEL_INFO,
 	     "%lu allocations of %d bytes\n", allocations[i], i + 1);
   
-  if (allocations[4095] > 0)
+  if (allocations[MEM_PROFILE_TABLE_SIZE-1] > 0)
     g_log (g_log_domain_glib, G_LOG_LEVEL_INFO,
-	   "%lu allocations of greater than 4095 bytes\n", allocations[4095]);
+	   "%lu allocations of greater than %d bytes\n",
+	   allocations[MEM_PROFILE_TABLE_SIZE-1], MEM_PROFILE_TABLE_SIZE-1);
   g_log (g_log_domain_glib, G_LOG_LEVEL_INFO, "%lu bytes allocated\n", allocated_mem);
   g_log (g_log_domain_glib, G_LOG_LEVEL_INFO, "%lu bytes freed\n", freed_mem);
   g_log (g_log_domain_glib, G_LOG_LEVEL_INFO, "%lu bytes in use\n", allocated_mem - freed_mem);
diff -ru3 -N /home/src/gnomecvs/glib/gmessages.c ./gmessages.c
--- /home/src/gnomecvs/glib/gmessages.c	Wed Sep  9 10:55:56 1998
+++ ./gmessages.c	Thu Oct 15 12:26:15 1998
@@ -20,8 +20,25 @@
 #include <stdarg.h>
 #include <stdio.h>
 #include <string.h>
-#include <unistd.h>
 #include "glib.h"
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef NATIVE_WIN32
+
+#include <windows.h>
+
+#undef write
+
+static int
+write (FILE *fd, const char *buf, int len)
+{
+  fwrite (buf, len, 1, fd);
+  return len;
+}
+
+#endif
 
 
 /* --- structures --- */
@@ -334,7 +351,11 @@
 		       const gchar    *message,
 		       gpointer	       unused_data)
 {
+#ifdef NATIVE_WIN32
+  FILE *fd;
+#else
   gint fd;
+#endif
   gboolean in_recursion;
   gboolean is_fatal;
   
@@ -345,7 +366,13 @@
   if (!message)
     message = "g_log_default_handler(): (NULL) message";
   
+#ifdef NATIVE_WIN32
+  /* Use just stdout as stderr is hard to get redirected from the
+     DOS prompt. */
+  fd = stdout;
+#else
   fd = (log_level >= G_LOG_LEVEL_MESSAGE) ? 1 : 2;
+#endif
   
   switch (log_level)
     {
diff -ru3 -N /home/src/gnomecvs/glib/gmodule/gmodule-win32.c ./gmodule/gmodule-win32.c
--- /home/src/gnomecvs/glib/gmodule/gmodule-win32.c	Thu Jan  1 02:00:00 1970
+++ ./gmodule/gmodule-win32.c	Thu Oct 15 13:29:20 1998
@@ -0,0 +1,92 @@
+/* GMODULE - GLIB wrapper code for dynamic module loading
+ * Copyright (C) 1998 Tim Janik
+ * Copyright (C) 1998 Tor Lillqvist
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+#include <stdio.h>
+#include <windows.h>
+
+/* --- functions --- */
+static gpointer
+_g_module_open (const gchar    *file_name,
+		gboolean	bind_lazy)
+{
+  HINSTANCE handle;
+  
+  handle = LoadLibrary (file_name);
+  if (!handle)
+    {
+      char error[100];
+      sprintf (error, "Error code %d", GetLastError ());
+      g_module_set_error (error);
+    }
+  
+  return handle;
+}
+
+static gpointer
+_g_module_self (void)
+{
+  HMODULE handle;
+  
+  handle = GetModuleHandle (NULL);
+  if (!handle)
+    {
+      char error[100];
+      sprintf (error, "Error code %d", GetLastError ());
+      g_module_set_error (error);
+    }
+  
+  return handle;
+}
+
+static void
+_g_module_close (gpointer	  handle,
+		 gboolean	  is_unref)
+{
+  if (!FreeLibrary (handle))
+    {
+      char error[100];
+      sprintf (error, "Error code %d", GetLastError ());
+      g_module_set_error (error);
+    }
+}
+
+static gpointer
+_g_module_symbol (gpointer	  handle,
+		  const gchar	 *symbol_name)
+{
+  gpointer p;
+  
+#ifdef __WATCOMC__
+  gchar *s = g_malloc (strlen (symbol_name) + 2);
+  strcpy (s, symbol_name);
+  strcat (s, "_");
+  symbol_name = s;
+#endif
+  p = GetProcAddress (handle, symbol_name);
+  if (!p)
+    {
+      char error[100];
+      sprintf (error, "Error code %d", GetLastError ());
+      g_module_set_error (error);
+    }
+#ifdef __WATCOMC__
+  g_free (s);
+#endif
+  return p;
+}
diff -ru3 -N /home/src/gnomecvs/glib/gmodule/gmodule.c ./gmodule/gmodule.c
--- /home/src/gnomecvs/glib/gmodule/gmodule.c	Mon Sep 21 10:25:39 1998
+++ ./gmodule/gmodule.c	Thu Oct 15 13:29:20 1998
@@ -108,6 +108,8 @@
 #include "gmodule-dl.c"
 #elif	(G_MODULE_IMPL == G_MODULE_IMPL_DLD)
 #include "gmodule-dld.c"
+#elif	(G_MODULE_IMPL == G_MODULE_IMPL_WIN32)
+#include "gmodule-win32.c"
 #else
 #undef	CHECK_ERROR
 #define	CHECK_ERROR(rv)	{ g_module_set_error ("unsupported"); return rv; }
@@ -134,6 +136,18 @@
   return NULL;
 }
 #endif	/* no implementation */
+
+#ifdef __LCC__
+
+int __stdcall 
+LibMain(void *hinstDll,
+	unsigned long dwReason,
+	void *reserved)
+{
+  return(1);
+}
+
+#endif
 
 
 /* --- functions --- */
diff -ru3 -N /home/src/gnomecvs/glib/gmodule/gmodule.h ./gmodule/gmodule.h
--- /home/src/gnomecvs/glib/gmodule/gmodule.h	Mon Sep 21 10:25:39 1998
+++ ./gmodule/gmodule.h	Thu Oct 15 13:46:48 1998
@@ -33,8 +33,11 @@
  * we need autoconf support here to feature Windows dll stubs.
  */
 #define	G_MODULE_IMPORT		extern
+#ifdef NATIVE_WIN32
+#define	G_MODULE_EXPORT		__declspec(dllexport)
+#else
 #define	G_MODULE_EXPORT
-
+#endif
 
 typedef enum
 {
diff -ru3 -N /home/src/gnomecvs/glib/gmodule/gmoduleconf.h.win32 ./gmodule/gmoduleconf.h.win32
--- /home/src/gnomecvs/glib/gmodule/gmoduleconf.h.win32	Thu Jan  1 02:00:00 1970
+++ ./gmodule/gmoduleconf.h.win32	Fri Aug 21 23:27:36 1998
@@ -0,0 +1,46 @@
+/* GMODULE - GLIB wrapper code for dynamic module loading
+ * Copyright (C) 1998 Tim Janik
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+#ifndef __G_MODULE_CONF_H__
+#define __G_MODULE_CONF_H__
+
+
+#ifdef __cplusplus
+extern "C" {
+#pragma }
+#endif /* __cplusplus */
+
+
+#define	G_MODULE_IMPL_NONE	0
+#define	G_MODULE_IMPL_DL	1
+#define	G_MODULE_IMPL_DLD	2
+#define	G_MODULE_IMPL_WIN32	3
+
+#define	G_MODULE_IMPL		G_MODULE_IMPL_WIN32
+#undef	G_MODULE_HAVE_DLERROR
+
+#ifdef __LCC__
+#define G_MODULE_NEED_USCORE
+#endif
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+
+#endif /* __G_MODULE_CONF_H__ */
diff -ru3 -N /home/src/gnomecvs/glib/gmodule/libgplugin_a.c ./gmodule/libgplugin_a.c
--- /home/src/gnomecvs/glib/gmodule/libgplugin_a.c	Wed Sep  9 10:55:58 1998
+++ ./gmodule/libgplugin_a.c	Sun Oct  4 00:24:46 1998
@@ -17,6 +17,18 @@
  * Boston, MA 02111-1307, USA.
  */
 #include	<gmodule.h>
+#include	<stdlib.h>
+
+#ifdef __LCC__
+
+int __stdcall 
+LibMain(void *hinstDll,
+	unsigned long dwReason,
+	void *reserved)
+{
+  return(1);
+}
+#endif
 
 G_MODULE_EXPORT void
 gplugin_a_func (void)
diff -ru3 -N /home/src/gnomecvs/glib/gmodule/libgplugin_b.c ./gmodule/libgplugin_b.c
--- /home/src/gnomecvs/glib/gmodule/libgplugin_b.c	Mon Sep 21 10:25:39 1998
+++ ./gmodule/libgplugin_b.c	Thu Oct 15 13:29:20 1998
@@ -18,6 +18,18 @@
  */
 #include        <gmodule.h>
 
+#ifdef __LCC__
+
+int __stdcall 
+LibMain(void *hinstDll,
+	unsigned long dwReason,
+	void *reserved)
+{
+  return(1);
+}
+
+#endif
+
 G_MODULE_EXPORT const gchar*
 g_module_check_init (GModule *module)
 {
diff -ru3 -N /home/src/gnomecvs/glib/gmodule/testgmodule.c ./gmodule/testgmodule.c
--- /home/src/gnomecvs/glib/gmodule/testgmodule.c	Wed Sep  9 10:55:58 1998
+++ ./gmodule/testgmodule.c	Fri Aug 28 09:15:08 1998
@@ -20,7 +20,7 @@
 #include	<gmodule.h>
 
 
-void
+G_MODULE_EXPORT void
 g_clash_func (void)
 {
   g_print ("GModule: Hello global clash\n");
@@ -44,8 +44,13 @@
   string = g_get_current_dir ();
   g_print ("testgmodule (%s):\n", string);
 
+#ifdef WIN32
+  plugin_a = g_strconcat (string, "\\libgplugin_a.dll", NULL);
+  plugin_b = g_strconcat (string, "\\libgplugin_b.dll", NULL);
+#else
   plugin_a = g_strconcat (string, "/.libs/", "libgplugin_a.so", NULL);
   plugin_b = g_strconcat (string, "/.libs/", "libgplugin_b.so", NULL);
+#endif
   g_free (string);
 
   /* module handles
diff -ru3 -N /home/src/gnomecvs/glib/gmodule.def ./gmodule.def
--- /home/src/gnomecvs/glib/gmodule.def	Thu Jan  1 02:00:00 1970
+++ ./gmodule.def	Mon Sep 21 20:46:34 1998
@@ -0,0 +1,9 @@
+EXPORTS
+	g_log_domain_gmodule
+	g_module_close
+	g_module_error
+	g_module_make_resident
+	g_module_name
+	g_module_open
+	g_module_supported
+	g_module_symbol
diff -ru3 -N /home/src/gnomecvs/glib/gmodule.wlk ./gmodule.wlk
--- /home/src/gnomecvs/glib/gmodule.wlk	Thu Jan  1 02:00:00 1970
+++ ./gmodule.wlk	Sun Oct  4 00:22:08 1998
@@ -0,0 +1,11 @@
+SYS nt_dll
+NAM gmodule_1_1
+FIL gmodule.obj
+EXP _g_log_domain_gmodule
+EXP g_module_close_
+EXP g_module_error_
+EXP g_module_make_resident_
+EXP g_module_name_
+EXP g_module_open_
+EXP g_module_supported_
+EXP g_module_symbol_
diff -ru3 -N /home/src/gnomecvs/glib/gscanner.c ./gscanner.c
--- /home/src/gnomecvs/glib/gscanner.c	Fri Sep 25 12:46:44 1998
+++ ./gscanner.c	Thu Oct 15 13:27:39 1998
@@ -25,13 +25,16 @@
 #include	<stdarg.h>
 #include	<string.h>
 #include	<stdio.h>
+#include	"glib.h"
+#ifdef HAVE_UNISTD_H
 #include	<unistd.h>
+#endif
 #include	<errno.h>
 #include	<sys/types.h>	/* needed for sys/stat.h */
 #include	<sys/stat.h>
-#include	"glib.h"
-
-
+#ifdef _MSC_VER
+#include	<io.h>
+#endif
 
 /* --- defines --- */
 #define	to_lower(c)				( \
@@ -61,7 +64,7 @@
 static GScannerConfig g_scanner_config_template =
 {
   (
-   " \t\n"
+   " \t\r\n"
    )			/* cset_skip_characters */,
   (
    G_CSET_a_2_z
@@ -616,7 +619,8 @@
   v.v_int = 0;
   g_return_val_if_fail (scanner != NULL, v);
   
-  return scanner->value;
+  v = scanner->value;
+  return v;
 }
 
 guint
@@ -1064,9 +1068,11 @@
   gint		st_mode;
   
   stat_buf = g_new0 (struct stat, 1);
-  
+#ifdef HAVE_LSTAT  
   lstat (filename, stat_buf);
-  
+#else
+  stat (filename, stat_buf);
+#endif
   st_mode = stat_buf->st_mode;
   
   g_free (stat_buf);
diff -ru3 -N /home/src/gnomecvs/glib/gstrfuncs.c ./gstrfuncs.c
--- /home/src/gnomecvs/glib/gstrfuncs.c	Mon Sep 21 10:25:39 1998
+++ ./gstrfuncs.c	Thu Oct 15 13:27:39 1998
@@ -985,3 +985,32 @@
 	*c = new_delim;
     }
 }
+
+gchar *
+g_strquote (gchar *string)
+{
+  gint backslashes = 0;
+  gchar *p = string;
+  gchar *q;
+  gchar *quoted;
+
+  while (*p != '\000')
+    backslashes += (*p++ == '\\');
+
+  if (backslashes == 0)
+    return g_strdup (string);
+
+  quoted = g_malloc (strlen (string) + backslashes + 1);
+
+  p = string;
+  q = quoted;
+
+  while (*p != '\000')
+    {
+      if (*p == '\\')
+	*q++ = '\\';
+      *q++ = *p++;
+    }
+  *q = '\000';
+  return quoted;
+}
diff -ru3 -N /home/src/gnomecvs/glib/gtimer.c ./gtimer.c
--- /home/src/gnomecvs/glib/gtimer.c	Wed Sep  9 10:55:57 1998
+++ ./gtimer.c	Thu Oct 15 13:52:24 1998
@@ -16,21 +16,32 @@
  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  * Boston, MA 02111-1307, USA.
  */
-#include <sys/time.h>
-#include <unistd.h>
 #include "glib.h"
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifndef NATIVE_WIN32
+#include <sys/time.h>
+#endif
 
+#ifdef NATIVE_WIN32
+#include <windows.h>
+#endif
 
 typedef struct _GRealTimer GRealTimer;
 
 struct _GRealTimer
 {
+#ifdef NATIVE_WIN32
+  DWORD start;
+  DWORD end;
+#else
   struct timeval start;
   struct timeval end;
+#endif
   gint active;
 };
 
-
 GTimer*
 g_timer_new (void)
 {
@@ -39,8 +50,11 @@
   timer = g_new (GRealTimer, 1);
   timer->active = TRUE;
 
+#ifdef NATIVE_WIN32
+  timer->start = GetTickCount ();
+#else
   gettimeofday (&timer->start, NULL);
-
+#endif
   return ((GTimer*) timer);
 }
 
@@ -60,7 +74,11 @@
   g_assert (timer != NULL);
 
   rtimer = (GRealTimer*) timer;
+#ifdef NATIVE_WIN32
+  rtimer->start = GetTickCount ();
+#else
   gettimeofday (&rtimer->start, NULL);
+#endif
   rtimer->active = 1;
 }
 
@@ -72,7 +90,11 @@
   g_assert (timer != NULL);
 
   rtimer = (GRealTimer*) timer;
+#ifdef NATIVE_WIN32
+  rtimer->end = GetTickCount ();
+#else
   gettimeofday (&rtimer->end, NULL);
+#endif
   rtimer->active = 0;
 }
 
@@ -84,7 +106,11 @@
   g_assert (timer != NULL);
 
   rtimer = (GRealTimer*) timer;
+#ifdef NATIVE_WIN32
+   rtimer->start = GetTickCount ();
+#else 
   gettimeofday (&rtimer->start, NULL);
+#endif
 }
 
 gdouble
@@ -92,13 +118,36 @@
 		 gulong *microseconds)
 {
   GRealTimer *rtimer;
+#ifndef NATIVE_WIN32
   struct timeval elapsed;
+#endif
   gdouble total;
 
   g_assert (timer != NULL);
 
   rtimer = (GRealTimer*) timer;
 
+#ifdef NATIVE_WIN32
+  if (rtimer->active)
+    rtimer->end = GetTickCount ();
+  /* Check for wraparound, which happens every 49.7 days.
+   * No, Win95 machines probably are never running for that long,
+   * but NT machines are.
+   */
+  if (rtimer->end < rtimer->start)
+    total = (UINT_MAX - (rtimer->start - rtimer->end)) / 1000.0;
+  else
+    total = (rtimer->end - rtimer->start) / 1000.0;
+  if (microseconds)
+    {
+      if (rtimer->end < rtimer->start)
+	*microseconds =
+	  ((UINT_MAX - (rtimer->start - rtimer->end)) % 1000) * 1000;
+      else
+	*microseconds =
+	  ((rtimer->end - rtimer->start) % 1000) * 1000;
+    }
+#else
   if (rtimer->active)
     gettimeofday (&rtimer->end, NULL);
 
@@ -115,6 +164,6 @@
 
   if (microseconds)
     *microseconds = elapsed.tv_usec;
-
+#endif
   return total;
 }
diff -ru3 -N /home/src/gnomecvs/glib/gutils.c ./gutils.c
--- /home/src/gnomecvs/glib/gutils.c	Wed Sep  9 10:55:57 1998
+++ ./gutils.c	Thu Oct 15 13:32:34 1998
@@ -16,21 +16,54 @@
  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  * Boston, MA 02111-1307, USA.
  */
+#include "glibconfig.h"
+#define GUTILS_C		/* For Watcom C32 10.6 */
+
+/* implement Glib's inline functions
+ */
+#ifdef NATIVE_WIN32xxx
+#define G_INLINE_FUNC __declspec(dllexport)
+#else
+#define	G_INLINE_FUNC extern
+#endif
+#define	G_CAN_INLINE 1
+#include "glib.h"
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 #include <stdarg.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
+#ifdef HAVE_PWD_H
 #include <pwd.h>
+#endif
 #include <sys/types.h>
+#ifdef HAVE_SYS_PARAM_H
 #include <sys/param.h>
+#endif
 
-/* implement Glib's inline functions
- */
-#define	G_INLINE_FUNC extern
-#define	G_CAN_INLINE 1
-#include "glib.h"
+#ifdef NATIVE_WIN32
+#include <windows.h>
+#include <direct.h>
+#include <errno.h>
+#include <ctype.h>
+
+#ifdef _MSC_VER
+#include <io.h>
+#define close _close
+#define getcwd _getcwd
+#endif
+#endif
+
+#ifndef MAXPATHLEN
+#ifdef PATH_MAX
+#define MAXPATHLEN PATH_MAX
+#else
+#define MAXPATHLEN 1024
+#endif
+#endif
 
 const guint glib_major_version = GLIB_MAJOR_VERSION;
 const guint glib_minor_version = GLIB_MINOR_VERSION;
@@ -38,6 +71,17 @@
 const guint glib_interface_age = GLIB_INTERFACE_AGE;
 const guint glib_binary_age = GLIB_BINARY_AGE;
 
+#ifdef __LCC__
+
+int __stdcall 
+LibMain(void *hinstDll,
+	unsigned long dwReason,
+	void *reserved)
+{
+  return(1);
+}
+
+#endif
 
 void
 g_atexit (GVoidFunc func)
@@ -184,13 +228,41 @@
   
   g_return_val_if_fail (file_name != NULL, NULL);
   
-  base = strrchr (file_name, '/');
+  base = strrchr (file_name, G_DIR_SEPARATOR);
   if (base)
     return base + 1;
+#ifdef NATIVE_WIN32
+  if (isalpha(file_name[0]) && file_name[1] == ':')
+    return (gchar *) file_name + 2;
+#endif
   
   return (gchar*) file_name;
 }
 
+gboolean
+g_path_is_absolute (const gchar *file_name)
+{
+  if (file_name[0] == G_DIR_SEPARATOR)
+    return TRUE;
+#ifdef NATIVE_WIN32
+  if (isalpha(file_name[0]) && file_name[1] == ':' && file_name[2] == G_DIR_SEPARATOR)
+    return TRUE;
+#endif
+  return FALSE;
+}
+
+gchar *
+g_path_skip_root (gchar *file_name)
+{
+  if (file_name[0] == G_DIR_SEPARATOR)
+    return file_name + 1;
+#ifdef NATIVE_WIN32
+  if (isalpha(file_name[0]) && file_name[1] == ':' && file_name[2] == G_DIR_SEPARATOR)
+    return file_name + 3;
+#endif
+  return NULL;
+}
+
 gchar*
 g_dirname (const gchar	   *file_name)
 {
@@ -199,10 +271,10 @@
   
   g_return_val_if_fail (file_name != NULL, NULL);
   
-  base = strrchr (file_name, '/');
+  base = strrchr (file_name, G_DIR_SEPARATOR);
   if (!base)
     return g_strdup (".");
-  while (base > file_name && *base == '/')
+  while (base > file_name && *base == G_DIR_SEPARATOR)
     base--;
   len = (guint) 1 + base - file_name;
   
@@ -244,7 +316,7 @@
       /* hm, should we g_error() out here?
        * this can happen if e.g. "./" has mode \0000
        */
-      buffer[0] = '/';
+      buffer[0] = G_DIR_SEPARATOR;
       buffer[1] = 0;
     }
 
@@ -254,6 +326,42 @@
   return dir;
 }
 
+gchar *
+g_getenv (const gchar *variable)
+{
+#ifndef NATIVE_WIN32
+  return getenv (variable);
+#else
+  char *v;
+  int l = 100, k;
+  char *p;
+
+  if ((v = getenv (variable)) == NULL)
+    return NULL;
+
+  /* On Windows NT, it is relatively typical that environment variables
+   * contain references to other environment variables. Handle that by
+   * calling ExpandEnvironmentStrings.
+   */
+
+  v = g_strdup (v);
+  l = 16;
+  do {
+    p = g_malloc (l);
+
+    if ((k = ExpandEnvironmentStrings (v, p, l)) > l)
+      {
+	g_free (p);
+	l *= 2;
+      }
+  } while (k > l);
+
+  g_free (v);
+
+  return p;
+#endif
+}
+
 static	gchar	*g_tmp_dir = NULL;
 static	gchar	*g_user_name = NULL;
 static	gchar	*g_real_name = NULL;
@@ -264,22 +372,29 @@
 {
   if (!g_tmp_dir)
     {
+#ifdef HAVE_PWD_H
       struct passwd *pw;
-      
-      g_tmp_dir = g_strdup (getenv ("TMPDIR"));
+#endif
+      g_tmp_dir = g_strdup (g_getenv ("TMPDIR"));
       if (!g_tmp_dir)
-	g_tmp_dir = g_strdup (getenv ("TMP"));
+	g_tmp_dir = g_strdup (g_getenv ("TMP"));
       if (!g_tmp_dir)
-	g_tmp_dir = g_strdup (getenv ("TEMP"));
+	g_tmp_dir = g_strdup (g_getenv ("TEMP"));
+
       if (!g_tmp_dir)
-	g_tmp_dir = g_strdup ("/tmp");
+#ifndef NATIVE_WIN32
+	g_tmp_dir = g_strdup (G_DIR_SEPARATOR_S "tmp");
+#else
+        g_tmp_dir = g_strdup (".");
+#endif
       
-      g_home_dir = g_strdup (getenv ("HOME"));
+      g_home_dir = g_strdup (g_getenv ("HOME"));
       
+#ifdef HAVE_PWD_H
       setpwent ();
       pw = getpwuid (getuid ());
       endpwent ();
-      
+
       if (pw)
 	{
 	  g_user_name = g_strdup (pw->pw_name);
@@ -287,6 +402,25 @@
 	  if (!g_home_dir)
 	    g_home_dir = g_strdup (pw->pw_dir);
 	}
+#else
+#ifdef NATIVE_WIN32
+      {
+	DWORD nSize = 17;
+	g_user_name = g_malloc (nSize);
+      
+	if (!GetUserName (g_user_name, &nSize))
+	  {
+	    g_free (g_user_name);
+	    g_user_name = g_strdup ("somebody");
+	  }
+	g_real_name = g_strdup ("Unknown");
+      }
+#else
+      g_user_name = g_strdup ("somebody");
+      g_real_name = g_strdup ("Unknown");
+      g_home_dir = NULL;
+#endif
+#endif
     }
 }
 
@@ -366,3 +500,474 @@
 {
   return *(const gint*) v;
 }
+
+GIOChannel *
+g_iochannel_new (gint fd)
+{
+  GIOChannel *channel = g_new (GIOChannel, 1);
+
+  channel->fd = fd;
+
+#ifdef NATIVE_WIN32
+  channel->peer = 0;
+  channel->peer_fd = 0;
+  channel->offset = 0;
+  channel->peer_offset = 0;
+#endif
+
+  return channel;
+}
+
+void
+g_iochannel_free (GIOChannel *channel)
+{
+  g_free (channel);
+}
+
+void
+g_iochannel_close_and_free (GIOChannel *channel)
+{
+  close (channel->fd);
+
+  g_iochannel_free (channel);
+}
+
+#ifdef NATIVE_WIN32
+
+void
+g_iochannel_wakeup_peer (GIOChannel *channel)
+{
+  static guint message = 0;
+  
+  if (message == 0)
+    message = RegisterWindowMessage ("gdk-pipe-readable");
+
+#if 0
+  g_print ("g_iochannel_wakeup_peer: calling PostThreadMessage (%#x, %d, %d, %d)\n",
+	   channel->peer, message, channel->peer_fd, channel->offset);
+#endif
+  PostThreadMessage (channel->peer, message,
+		     channel->peer_fd, channel->offset);
+}
+
+#ifdef __WATCOMC__
+
+pid_t
+g_getpid (void)
+{
+  return GetCurrentProcessId ();
+}
+
+int 
+g_open (const char *path,
+	int         flags,
+	...)
+{
+  HANDLE hfile;
+  DWORD mode;
+  DWORD share_mode;
+  DWORD creation;
+  SECURITY_ATTRIBUTES security_attributes;
+
+  if ((flags & 0x3) == O_RDONLY)
+    mode = GENERIC_READ;
+  else if ((flags & 0x3) == O_WRONLY)
+    mode = GENERIC_WRITE;
+  else
+    mode = GENERIC_READ | GENERIC_WRITE;
+
+  security_attributes.nLength = sizeof (security_attributes);
+  security_attributes.lpSecurityDescriptor = NULL;
+  security_attributes.bInheritHandle = TRUE;
+
+  if (flags & O_CREAT)
+    creation = OPEN_ALWAYS;
+  else
+    creation = OPEN_EXISTING;
+
+  hfile = CreateFile (path, mode, FILE_SHARE_WRITE,
+		      &security_attributes, creation,
+		      FILE_ATTRIBUTE_NORMAL, NULL);
+  if (hfile == INVALID_HANDLE_VALUE)
+    {
+      int error = GetLastError ();
+      switch (error)
+	{
+	case ERROR_FILE_NOT_FOUND:
+	case ERROR_PATH_NOT_FOUND:
+	case ERROR_INVALID_DRIVE:
+	  errno = ENOENT; break;
+	case ERROR_TOO_MANY_OPEN_FILES:
+	  errno = ENFILE; break;
+	case ERROR_ACCESS_DENIED:
+	case ERROR_SHARING_VIOLATION:
+	default:		/* ??? */
+	  errno = EACCES; break;
+	}
+      return -1;
+    }
+  else
+    return (int) hfile;
+}
+
+int g_creat (const char *path,
+	     mode_t      mode)
+{
+  return open (path, O_WRONLY|O_CREAT, mode);
+}
+
+ssize_t 
+g_read (int   fd,
+	char *buf,
+	int   buflen)
+{
+  HANDLE hfile;
+  DWORD nread;
+
+  hfile = (HANDLE) fd;
+
+  if (!ReadFile (hfile, buf, buflen, &nread, NULL))
+    {
+      int error = GetLastError ();
+      switch (error)
+	{
+	case ERROR_INVALID_HANDLE:
+	  errno = EBADF; break;
+	case ERROR_ACCESS_DENIED:
+	  errno = EACCES; break;
+	default:
+	  errno = EIO; break;
+	}
+      return -1;
+    }
+  return nread;
+}
+
+ssize_t
+g_write (int         fd,
+	 const char *buf,
+	 int         buflen)
+{
+  HANDLE hfile;
+  DWORD nwritten;
+
+  hfile = (HANDLE) fd;
+
+  if (!WriteFile (hfile, buf, buflen, &nwritten, NULL))
+    {
+      int error = GetLastError ();
+      switch (error)
+	{
+	case ERROR_INVALID_HANDLE:
+	  errno = EBADF; break;
+	case ERROR_ACCESS_DENIED:
+	  errno = EACCES; break;
+	default:
+	  errno = EIO; break;
+	}
+      return -1;
+    }
+  return nwritten;
+}
+
+off_t
+g_lseek (int fd,
+	 off_t offset,
+	 int whence)
+{
+  HANDLE hfile;
+  DWORD method;
+  DWORD newpos;
+
+  if (whence == SEEK_SET)
+    method = FILE_BEGIN;
+  else if (whence == SEEK_CUR)
+    method = FILE_CURRENT;
+  else
+    method = FILE_END;
+
+  hfile = (HANDLE) fd;
+
+  newpos = SetFilePointer (hfile, offset, NULL, method);
+
+  if (newpos == 0xFFFFFFFF)
+    {
+      errno = EIO;
+      return -1;
+    }
+  return newpos;
+}
+    
+int
+g_ftruncate (int     fd,
+	     ssize_t new_size)
+{
+  HANDLE hfile;
+  DWORD curpos;
+  
+  hfile = (HANDLE) fd;
+  if ((curpos = SetFilePointer (hfile, 0, NULL, FILE_CURRENT)) == 0xFFFFFFFF
+      || SetFilePointer (hfile, new_size, NULL, FILE_BEGIN) == 0xFFFFFFFF
+      || !SetEndOfFile (hfile)
+      || SetFilePointer (hfile, curpos, NULL, FILE_BEGIN) == 0xFFFFFFFF)
+    {
+      int error = GetLastError ();
+      switch (error)
+	{
+	case ERROR_INVALID_HANDLE:
+	  errno = EBADF; break;
+	default:
+	  errno = EIO; break;
+	}
+      return -1;
+    }
+
+  return 0;
+}
+
+int
+g_close (int fd)
+{
+  HANDLE hfile;
+
+  hfile = (HANDLE) fd;
+
+  if (!CloseHandle (hfile))
+    {
+      int error = GetLastError ();
+      switch (error)
+	{
+	case ERROR_INVALID_HANDLE:
+	  errno = EBADF; break;
+	default:
+	  errno = EIO; break;
+	}
+      return -1;
+    }
+  return 0;
+}
+
+static struct _write_pipes {
+  FILE *fp;
+  char *cmd;
+} *write_pipes;
+
+static int n_write_pipes = 0;
+
+void *
+g_popen (const char *command,
+	 const char *mode)
+{
+  char tmp[L_tmpnam];
+  char *cmd;
+
+  tmpnam (tmp);
+  if (mode[0] == 'r')
+    {
+      cmd = g_strdup_printf ("%s >%s", command, tmp);
+      system (cmd);
+      return fopen (tmp, mode);
+    }
+  else
+    {
+      int i;
+      if (n_write_pipes == 0)
+	{
+	  write_pipes = g_new (struct _write_pipes, 10);
+	  n_write_pipes = 10;
+	  for (i = 0; i < n_write_pipes; i++)
+	    write_pipes[i].fp = NULL;
+	}
+      for (i = 0; i < n_write_pipes; i++)
+	if (write_pipes[i].fp == NULL)
+	  {
+	    break;
+	  }
+      if (i == n_write_pipes)
+	{
+	  write_pipes =
+	    g_realloc (write_pipes,
+		       (n_write_pipes + 10) * sizeof (struct _write_pipes));
+	  for (i = n_write_pipes; i < n_write_pipes + 10; i++)
+	    write_pipes[i].fp = NULL;
+	  i = n_write_pipes;
+	  n_write_pipes += 10;
+	}
+
+      write_pipes[i].cmd = g_strdup_printf ("%s <%s", command, tmp);
+      return (write_pipes[i].fp = fopen (tmp, mode));
+    }
+}
+
+int 
+g_pclose (void *fp)
+{
+  if (((FILE *)fp)->_flag & _READ)
+    {
+      return fclose (fp);
+    }
+  else
+    {
+      int i;
+      fclose (fp);
+      
+      for (i = 0; i < n_write_pipes; i++)
+	if (write_pipes[i].fp == fp)
+	  {
+	    write_pipes[i].fp = NULL;
+	    system (write_pipes[i].cmd);
+	    g_free (write_pipes[i].cmd);
+	    return 0;
+	  }
+    }
+  return 0;
+}
+
+#endif
+
+#ifdef _MSC_VER
+
+int
+g_ftruncate (int          fd,
+	     unsigned int size)
+{
+  HANDLE hfile;
+  DWORD curpos;
+  
+  hfile = (HANDLE)_get_osfhandle (fd);
+  if ((curpos = SetFilePointer (hfile, 0, NULL, FILE_CURRENT)) == 0xFFFFFFFF
+      || SetFilePointer (hfile, size, NULL, FILE_BEGIN) == 0xFFFFFFFF
+      || !SetEndOfFile (hfile))
+    {
+      int error = GetLastError ();
+      switch (error)
+	{
+	case ERROR_INVALID_HANDLE:
+	  errno = EBADF; break;
+	default:
+	  errno = EIO; break;
+	}
+      return -1;
+    }
+
+  return 0;
+}
+
+DIR *
+g_opendir (const char *dirname)
+{
+  DIR *result;
+  char *mask;
+  int k;
+
+  result = g_new (DIR, 1);
+  result->lpFindFileData = g_new (WIN32_FIND_DATA, 1);
+  result->dir_name = g_strdup (dirname);
+  
+  k = strlen (result->dir_name);
+  if (result->dir_name[k-1] == '\\')
+    {
+      result->dir_name[k-1] = '\0';
+      k--;
+    }
+  mask = g_strdup_printf ("%s\\*", result->dir_name);
+
+  result->hFindFile =
+    (guint) FindFirstFile (mask,
+			   (LPWIN32_FIND_DATA) result->lpFindFileData);
+  g_free (mask);
+  if (result->hFindFile == (guint) INVALID_HANDLE_VALUE)
+    {
+      int error = GetLastError ();
+
+      g_free (result->dir_name);
+      g_free (result->lpFindFileData);
+      g_free (result);
+      switch (error)
+	{
+	default: errno = EIO; return NULL;
+	}
+    }
+  result->just_opened = TRUE;
+
+  return result;
+}
+
+struct dirent *
+g_readdir (DIR *dir)
+{
+  static struct dirent result;
+
+  if (dir->just_opened)
+    {
+      dir->just_opened = FALSE;
+    }
+  else
+    {
+      if (!FindNextFile ((HANDLE) dir->hFindFile,
+			 (LPWIN32_FIND_DATA) dir->lpFindFileData))
+	{
+	  int error = GetLastError ();
+	  switch (error)
+	    {
+	    case ERROR_NO_MORE_FILES:
+	      return NULL;
+	    default:
+	      errno = EIO; return NULL;
+	    }
+	}
+    }
+  strcpy (result.d_name,
+	  g_basename (((LPWIN32_FIND_DATA) dir->lpFindFileData)->cFileName));
+      
+  return &result;
+}
+
+void
+g_rewinddir (DIR *dir)
+{
+  char *mask;
+
+  if (!FindClose ((HANDLE) dir->hFindFile))
+    g_warning ("FindClose failed\n");
+  mask = g_strdup_printf ("%s\\*", dir->dir_name);
+  dir->hFindFile =
+    (guint) FindFirstFile (mask,
+			   (LPWIN32_FIND_DATA) dir->lpFindFileData);
+  g_free (mask);
+
+  if (dir->hFindFile == (guint) INVALID_HANDLE_VALUE)
+    {
+      int error = GetLastError ();
+      switch (error)
+	{
+	default: errno = EIO; return;
+	}
+    }
+  dir->just_opened = TRUE;
+}  
+
+int
+g_closedir (DIR *dir)
+{
+  if (!FindClose ((HANDLE) dir->hFindFile))
+    {
+      int error = GetLastError ();
+
+      switch (error)
+	{
+	default:
+	  errno = EIO; return -1;
+	}
+    }
+
+  g_free (dir->dir_name);
+  g_free (dir->lpFindFileData);
+  g_free (dir);
+
+  return 0;
+}
+
+#endif /* _MSC_VER */
+
+#endif /* NATIVE_WIN32 */
diff -ru3 -N /home/src/gnomecvs/glib/makefile.lcc ./makefile.lcc
--- /home/src/gnomecvs/glib/makefile.lcc	Thu Jan  1 02:00:00 1970
+++ ./makefile.lcc	Sun Aug 30 11:54:46 1998
@@ -0,0 +1,99 @@
+## Makefile for building glib.dll and gmodule.dll with lcc
+## Use: make -f makefile.lcc
+## Note that testglib crashes when compiled with lcc...
+
+INSTALL = copy/y
+TOUCH = copy/y makefile.lcc
+
+CFLAGS = -I. -O
+CC = lcc
+LD = lcclnk
+
+BIN = C:\bin
+
+all : \
+	glibconfig.h	\
+	glib.dll	\
+	gmodule\gmoduleconf.h \
+	gmodule.dll	\
+	testglib.exe	\
+	testgmodule.exe
+
+install : all
+	$(INSTALL) glib.dll $(BIN)
+	$(INSTALL) gmodule.dll $(BIN)
+	$(TOUCH) install
+
+glib_OBJECTS = \
+	garray.obj	\
+	gcache.obj	\
+	gcompletion.obj	\
+	gdataset.obj	\
+	gerror.obj	\
+	ghash.obj	\
+	glist.obj	\
+	gmem.obj	\
+	gmessages.obj	\
+	gnode.obj	\
+	gprimes.obj	\
+	gslist.obj	\
+	gtimer.obj	\
+	gtree.obj	\
+	grel.obj	\
+	gstring.obj	\
+	gstrfuncs.obj	\
+	gscanner.obj	\
+	gutils.obj
+
+glib.dll : $(glib_OBJECTS)
+	$(LD) -dll -o glib.dll $(glib_OBJECTS)
+	implib glib.dll
+
+glibconfig.h: glibconfig.h.win32
+	copy glibconfig.h.win32 glibconfig.h
+
+.c.obj :
+	$(CC) $(CFLAGS) -DCOMPILING_GLIB -DG_LOG_DOMAIN=g_log_domain_glib $<
+
+gmodule_OBJECTS = \
+	gmodule.obj
+
+gmodule.dll : $(gmodule_OBJECTS)
+	$(LD) -dll -o gmodule.dll $(gmodule_OBJECTS) glib.lib 
+	implib gmodule.dll
+
+gmodule.obj : gmodule\gmodule.c gmodule\gmodule-win32.c 
+	$(CC) $(CFLAGS) -Igmodule -DCOMPILING_GMODULE -DG_LIB_DOMAIN=g_log_domain_gmodule gmodule\gmodule.c
+
+gmodule\gmoduleconf.h: gmodule\gmoduleconf.h.win32
+	copy gmodule\gmoduleconf.h.win32 gmodule\gmoduleconf.h
+
+testglib.exe : glib.dll testglib.obj
+	$(LD) -o testglib.exe testglib.obj glib.lib
+
+testglib.obj : testglib.c
+	$(CC) $(CFLAGS) testglib.c
+
+testgmodule.exe : glib.dll gmodule.dll testgmodule.obj libgplugin_a.dll libgplugin_b.dll
+	$(LD) -o testgmodule.exe testgmodule.obj testgmodule.def glib.lib gmodule.lib
+
+testgmodule.obj : gmodule\testgmodule.c
+	$(CC) $(CFLAGS) -Igmodule gmodule\testgmodule.c
+
+libgplugin_a.dll : libgplugin_a.obj
+	$(LD) -dll -o libgplugin_a.dll libgplugin_a.obj glib.lib gmodule.lib
+
+libgplugin_a.obj : gmodule\libgplugin_a.c
+	$(CC) $(CFLAGS) -Igmodule gmodule\libgplugin_a.c
+
+libgplugin_b.dll : libgplugin_b.obj
+	$(LD) -dll -o libgplugin_b.dll libgplugin_b.obj /link glib.lib gmodule.lib
+
+libgplugin_b.obj : gmodule\libgplugin_b.c
+	$(CC) $(CFLAGS) -Igmodule gmodule\libgplugin_b.c
+
+clean:
+	del *.exe
+	del *.obj
+	del *.dll
+	del *.lib
diff -ru3 -N /home/src/gnomecvs/glib/makefile.msc ./makefile.msc
--- /home/src/gnomecvs/glib/makefile.msc	Thu Jan  1 02:00:00 1970
+++ ./makefile.msc	Thu Oct 15 13:53:29 1998
@@ -0,0 +1,105 @@
+## Makefile for building glib.dll and gmodule.dll with Microsoft C
+## Use: nmake -f makefile.msc
+
+CC = cl -G5 -GF -Ox -W3 -D_DLL -nologo
+LDFLAGS = /link /nodefaultlib:libc msvcrt.lib # /debug:full /debugtype:cv 
+INSTALL = copy
+TOUCH = copy makefile.msc
+
+CFLAGS = -I. 
+
+BIN = C:\bin
+
+all : \
+	glibconfig.h	\
+	glib-1.1.dll	\
+	gmodule\gmoduleconf.h \
+	gmodule-1.1.dll	\
+	testglib.exe	\
+	testgmodule.exe
+
+install : all
+	$(INSTALL) glib-1.1.dll $(BIN)
+	$(INSTALL) gmodule-1.1.dll $(BIN)
+	$(TOUCH) install
+
+glib_OBJECTS = \
+	garray.obj	\
+	gcache.obj	\
+	gcompletion.obj	\
+	gdataset.obj	\
+	gerror.obj	\
+	ghook.obj	\
+	ghash.obj	\
+	glist.obj	\
+	gmem.obj	\
+	gmessages.obj	\
+	gnode.obj	\
+	gprimes.obj	\
+	gslist.obj	\
+	gtimer.obj	\
+	gtree.obj	\
+	grel.obj	\
+	gstring.obj	\
+	gstrfuncs.obj	\
+	gscanner.obj	\
+	gutils.obj
+
+glib-1.1.dll : $(glib_OBJECTS)
+	$(CC) $(CFLAGS) -MD -LD -Feglib-1.1.dll $(glib_OBJECTS) user32.lib advapi32.lib $(LDFLAGS) /def:glib.def
+
+glibconfig.h: glibconfig.h.win32
+	copy glibconfig.h.win32 glibconfig.h
+
+.c.obj :
+	$(CC) $(CFLAGS) -GD -c -DCOMPILING_GLIB -DG_LOG_DOMAIN=g_log_domain_glib $<
+
+gmodule_OBJECTS = \
+	gmodule.obj
+
+gmodule-1.1.dll : $(gmodule_OBJECTS)
+	$(CC) $(CFLAGS) -MD -LD -Fegmodule-1.1.dll $(gmodule_OBJECTS) glib-1.1.lib $(LDFLAGS) /def:gmodule.def
+
+gmodule.obj : gmodule\gmodule.c gmodule\gmodule-win32.c
+	$(CC) $(CFLAGS) -Igmodule -c -DG_LIB_DOMAIN=g_log_domain_gmodule gmodule\gmodule.c
+
+gmodule\gmoduleconf.h: gmodule\gmoduleconf.h.win32
+	copy gmodule\gmoduleconf.h.win32 gmodule\gmoduleconf.h
+
+testglib.exe : glib-1.1.dll testglib.obj
+	$(CC) $(CFLAGS) -MD -Fetestglib.exe testglib.obj glib-1.1.lib $(LDFLAGS) /map
+
+testglib.obj : testglib.c
+	$(CC) -c $(CFLAGS) testglib.c
+
+testgmodule.exe : glib-1.1.dll gmodule-1.1.dll testgmodule.obj libgplugin_a.dll libgplugin_b.dll
+	$(CC) $(CFLAGS) -MD testgmodule.obj glib-1.1.lib gmodule-1.1.lib $(LDFLAGS)
+
+testgmodule.obj : gmodule\testgmodule.c
+	$(CC) $(CFLAGS) -Igmodule -c gmodule\testgmodule.c
+
+libgplugin_a.dll : libgplugin_a.obj
+	$(CC) $(CFLAGS) -MD -LD libgplugin_a.obj glib-1.1.lib gmodule-1.1.lib $(LDFLAGS)
+
+libgplugin_a.obj : gmodule\libgplugin_a.c
+	$(CC) $(CFLAGS) -Igmodule -c gmodule\libgplugin_a.c
+
+libgplugin_b.dll : libgplugin_b.obj
+	$(CC) $(CFLAGS) -MD -LD libgplugin_b.obj glib-1.1.lib gmodule-1.1.lib  $(LDFLAGS)
+
+libgplugin_b.obj : gmodule\libgplugin_b.c
+	$(CC) $(CFLAGS) -Igmodule -c gmodule\libgplugin_b.c
+
+clean:
+	del *.exe
+	del *.obj
+	del *.dll
+	del *.lib
+	del *.err
+	del *.map
+	del *.sym
+	del *.exp
+	del *.lk1
+	del *.mk1
+	del *.pdb
+	del *.ilk
diff -ru3 -N /home/src/gnomecvs/glib/makefile.watcom ./makefile.watcom
--- /home/src/gnomecvs/glib/makefile.watcom	Thu Jan  1 02:00:00 1970
+++ ./makefile.watcom	Sun Oct  4 00:22:40 1998
@@ -0,0 +1,111 @@
+## Makefile for building glib.dll and gmodule.dll with Watcom C32 10.6
+## Use: wmake -u -f makefile.watcom
+
+CC = wcc386 -w4 -d2 -od -of+ -5r -fp5 -zc -bt=nt $(INCLUDES)
+LD = wlink d all
+INSTALL = copy/y
+TOUCH = wtouch
+
+INCLUDES = -iF:\watcom\h;F:\watcom\h\nt
+CFLAGS = -i. 
+
+BIN = C:\bin
+
+all : \
+	glibconfig.h	\
+	glib_1_1.dll	\
+	gmodule\gmoduleconf.h \
+	gmodule_1_1.dll	\
+	testglib.exe	\
+	testgmodule.exe
+	$(TOUCH) all
+
+install : all
+	$(INSTALL) glib_1_1.dll $(BIN)
+	$(INSTALL) gmodule_1_1.dll $(BIN)
+	$(TOUCH) install
+
+glib_OBJECTS = \
+	garray.obj	\
+	gcache.obj	\
+	gcompletion.obj	\
+	gdataset.obj	\
+	gerror.obj	\
+	ghash.obj	\
+	ghook.obj	\
+	glist.obj	\
+	gmem.obj	\
+	gmessages.obj	\
+	gnode.obj	\
+	gprimes.obj	\
+	gslist.obj	\
+	gtimer.obj	\
+	gtree.obj	\
+	grel.obj	\
+	gstring.obj	\
+	gstrfuncs.obj	\
+	gscanner.obj	\
+	gutils.obj
+
+glib_1_1.dll : $(glib_OBJECTS)
+	$(LD) @glib.wlk libr advapi32.lib
+	wlib -n -b glib_1_1.lib +glib_1_1.dll
+
+glibconfig.h: glibconfig.h.win32
+	copy glibconfig.h.win32 glibconfig.h
+
+.c.obj :
+	$(CC) $(CFLAGS) -bd -dCOMPILING_GLIB -dG_LOG_DOMAIN=g_log_domain_glib $<
+
+gmodule_OBJECTS = \
+	gmodule.obj
+
+gmodule_1_1.dll : $(gmodule_OBJECTS)
+	$(LD) @gmodule.wlk libr glib_1_1.lib
+	wlib -n -b gmodule_1_1.lib +gmodule_1_1.dll
+
+gmodule.obj : gmodule\gmodule.c gmodule\gmodule-win32.c
+	$(CC) $(CFLAGS) -bd -igmodule -dG_LIB_DOMAIN=g_log_domain_gmodule gmodule\gmodule.c
+
+gmodule\gmoduleconf.h: gmodule\gmoduleconf.h.win32
+	copy gmodule\gmoduleconf.h.win32 gmodule\gmoduleconf.h
+
+testglib.exe : glib_1_1.dll testglib.obj
+	$(LD)  sys nt file testglib.obj libr glib_1_1.lib
+
+testglib.obj : testglib.c
+	$(CC) $(CFLAGS) testglib.c
+
+testgmodule.exe : glib_1_1.dll gmodule_1_1.dll testgmodule.obj libgplugin_a.dll libgplugin_b.dll
+	$(LD) sys nt name testgmodule file testgmodule.obj libr glib_1_1.lib,gmodule_1_1.lib
+
+testgmodule.obj : gmodule\testgmodule.c
+	$(CC) $(CFLAGS) -igmodule gmodule\testgmodule.c
+
+libgplugin_a.dll : libgplugin_a.obj
+	$(LD) sys nt_dll name libgplugin_a file libgplugin_a.obj libr glib_1_1.lib,gmodule_1_1.lib
+	wlib -n -b libgplugin_a.lib +libgplugin_a.dll
+
+libgplugin_a.obj : gmodule\libgplugin_a.c
+	$(CC) $(CFLAGS) -bd -igmodule gmodule\libgplugin_a.c
+
+libgplugin_b.dll : libgplugin_b.obj
+	$(LD) sys nt_dll name libgplugin_b file libgplugin_b.obj libr glib_1_1.lib,gmodule_1_1.lib
+	wlib -n -b libgplugin_b.lib +libgplugin_b.dll
+
+libgplugin_b.obj : gmodule\libgplugin_b.c
+	$(CC) $(CFLAGS) -bd  -igmodule gmodule\libgplugin_b.c
+
+clean:
+	del *.exe
+	del *.obj
+	del *.dll
+	del *.lib
+	del *.exp
+	del *.err
+	del *.map
+	del *.sym
+	del *.lk1
+	del *.mk1
+	del *.pdb
+	del *.ilk
diff -ru3 -N /home/src/gnomecvs/glib/testglib.c ./testglib.c
--- /home/src/gnomecvs/glib/testglib.c	Mon Sep 21 10:25:39 1998
+++ ./testglib.c	Thu Oct 15 13:27:39 1998
@@ -295,6 +295,7 @@
     gchar *filename;
     gchar *dirname;
   } dirname_checks[] = {
+#ifndef NATIVE_WIN32
     { "/", "/" },
     { "////", "/" },
     { ".////", "." },
@@ -306,6 +307,18 @@
     { "a/b", "a" },
     { "a/b/", "a/b" },
     { "c///", "c" },
+#else
+    { "\\", "\\" },
+    { ".\\\\\\\\", "." },
+    { ".", "." },
+    { "..", "." },
+    { "..\\", ".." },
+    { "..\\\\\\\\", ".." },
+    { "", "." },
+    { "a\\b", "a" },
+    { "a\\b\\", "a\\b" },
+    { "c\\\\\\", "c" },
+#endif
   };
   guint n_dirname_checks = sizeof (dirname_checks) / sizeof (dirname_checks[0]);
 
@@ -625,12 +638,32 @@
   for (i = 0; i < 10000; i++)
     g_string_append_c (string1, 'a'+(i%26));
 
+#if !(defined (_MSC_VER) || defined (__LCC__))
+  /* MSVC and LCC use the same run-time C library, which doesn't like
+     the %10000.10000f format... */
   g_string_sprintf (string2, "%s|%0100d|%s|%s|%0*d|%*.*f|%10000.10000f",
 		    "this pete guy sure is a wuss, like he's the number ",
 		    1,
 		    " wuss.  everyone agrees.\n",
 		    string1->str,
 		    10, 666, 15, 15, 666.666666666, 666.666666666);
+#else
+  g_string_sprintf (string2, "%s|%0100d|%s|%s|%0*d|%*.*f|%100.100f",
+		    "this pete guy sure is a wuss, like he's the number ",
+		    1,
+		    " wuss.  everyone agrees.\n",
+		    string1->str,
+		    10, 666, 15, 15, 666.666666666, 666.666666666);
+#endif
+
+  g_print ("string2 length = %d...\n", string2->len);
+  string2->str[70] = '\0';
+  g_print ("first 70 chars:\n%s\n", string2->str);
+  string2->str[141] = '\0';
+  g_print ("next 70 chars:\n%s\n", string2->str+71);
+  string2->str[212] = '\0';
+  g_print ("and next 70:\n%s\n", string2->str+142);
+  g_print ("last 70 chars:\n%s\n", string2->str+string2->len - 70);
 
   g_print ("ok\n");
 
@@ -648,7 +681,23 @@
 
   g_print ("ok\n");
 
-  g_print ("checking g_strcasecmp...\n");
+  g_print ("checking g_strcasecmp...");
+  g_assert (g_strcasecmp ("FroboZZ", "frobozz") == 0);
+  g_assert (g_strcasecmp ("frobozz", "frobozz") == 0);
+  g_assert (g_strcasecmp ("frobozz", "FROBOZZ") == 0);
+  g_assert (g_strcasecmp ("FROBOZZ", "froboz") != 0);
+  g_assert (g_strcasecmp ("", "") == 0);
+  g_assert (g_strcasecmp ("!#%&/()", "!#%&/()") == 0);
+  g_assert (g_strcasecmp ("a", "b") < 0);
+  g_assert (g_strcasecmp ("a", "B") < 0);
+  g_assert (g_strcasecmp ("A", "b") < 0);
+  g_assert (g_strcasecmp ("A", "B") < 0);
+  g_assert (g_strcasecmp ("b", "a") > 0);
+  g_assert (g_strcasecmp ("b", "A") > 0);
+  g_assert (g_strcasecmp ("B", "a") > 0);
+  g_assert (g_strcasecmp ("B", "A") > 0);
+
+  g_print ("ok\n");
 
   /* g_debug (argv[0]); */
 
@@ -757,7 +806,7 @@
   g_print ("ok\n");
 
   g_printerr ("g_log tests:");
-  g_warning ("harmless warning");
+  g_warning ("harmless warning with parameters: %d %s %#x", 42, "Boo", 12345);
   g_message ("the next warning is a test:");
   string = NULL;
   g_print (string);