Commit Graph

152 Commits

Author SHA1 Message Date
Owen Taylor
42a23950f5 Jun 29 13:36:39 2001 Owen Taylor <otaylor@redhat.com>
* glib/gstring.[ch] (g_string_set_size): Add function to
        allow setting the length of a string greater than the
        current length (for buffering usage)

        * glib/gstring.[ch]: Expose string->allocated_len, since
        that is useful when using GString simply as a buffer.
        (Renamed from string->alloc)

        * glib/giochannel.[ch] glib/giounix.c glib/giowin32.c:
        Major patch from Hidetoshi Tajima and Ron Steinke
        reworking GIOChannel to have:

         - Buffering
         - Sane and useful error reporting
         - Streaming encoding conversion with iconv
         - Convenience functions to read by lines or
           an entire file.

        Also fix remaining 64 bit cleanliness issues.

        * tests/iochannel-test.c tests/Makefile.am: Test case
        for IO channel streaming conversion. Still needs
        some fixing up.
2001-06-30 15:22:13 +00:00
Owen Taylor
2fd6b001fb Move glib library into a subdirectory, make all GLib include files include
Tue Jun 26 11:43:46 2001  Owen Taylor  <otaylor@redhat.com>

	* configure.in Makefile.am *.[ch] glib/*.[ch] glib/Makefile.am:
	Move glib library into a subdirectory, make all GLib include
	files include as <glib/glist.h>

	* tests/testglib.c tests/testgdate.c tests/testgdateparser.c
	  tests/timeloop.c tests/timeloop-basic.c: Move all tests into
	the tests/ subdirectory.
2001-06-26 16:01:21 +00:00
Owen Taylor
f5c28ce4ab Changes for 64-bit cleanliness, loosely based on patch from Mark Murnane.
Wed Jun 20 12:00:54 2001  Owen Taylor  <otaylor@redhat.com>

        Changes for 64-bit cleanliness, loosely based on patch
	from Mark Murnane.

	* gconvert.c (g_convert/g_convert_with_fallback): Remove
	workarounds for since-fixed GNU libc bugs. Minor
	doc fix.

	* gconvert.[ch]: Change gint to gsize/gssize as
	appropriate.

	* gconvert.c (g_locale/filename_to/from_utf8): Fix incorrect
	computation of bytes_read / bytes_written.

	* gfileutils.[ch] (g_file_get_contents): Make length
	out parameter 'gsize *len'.

	* ghook.c (g_hook_compare_ids): Don't compare a
	and b as 'a - b'.

	* gmacros.h (GSIZE_TO_POINTER): Add GPOINTER_TO_SIZE,
	GSIZE_TO_POINTER.

	* gmain.c (g_timeout_prepare): Rewrite to avoid
	overflows. (Fixes bug when system clock skews
	backwards more than 24 days.)

	* gmarkup.[ch]: Make lengths passed to callbacks
	gsize, length for g_markup_parse-context_parse(),
	g_markup_escape_text() gssize.

	* gmessages.[ch] (g_printf_string_upper_bound): Change
	return value to gsize.

	* gmessages.c (printf_string_upper_bound): Remove
	a ridiculous use of 'inline' on a 300 line function.

	* gstring.[ch]: Represent size of string as a gsize,
	not gint. Make parameters to functions take gsize,
	or gssize where -1 is allowed.

	* gstring.c (g_string_erase): Make
	g_string_erase (string, pos, -1) a synonym for
	g_string_truncate for consistency with other G*
	APIs.

	* gstrfuncs.[ch]: Make all functions taking a string
	length, take a gsize, or gssize if -1 is allowed.
	(g_strstr_len, g_strrstr_len). Also fix some boundary
	conditions in g_str[r]str[_len].

	* gutf8.c tests/unicode-encoding.c: Make parameters that
	are byte lengths gsize, gssize as appropriate. Make
	character offsets, other counts, glong.

	* gasyncqueue.c gcompletion.c
          timeloop.c timeloop-basic.c gutils.c gspawn.c.
	Small 64 bit cleanliness fixups.

	* glist.c (g_list_sort2, g_list_sort_real): Fix functions
	that should have been static.

	* gdate.c (g_date_fill_parse_tokens): Fix extra
	declaration that was shadowing another.

	* tests/module-test.c: Include string.h

Mon Jun 18 15:43:29 2001  Owen Taylor  <otaylor@redhat.com>

	* gutf8.c (g_get_charset): Make argument
	G_CONST_RETURN char **.
2001-06-23 13:55:09 +00:00
Alex Larsson
106fb627f1 Added new functions g_strstr_len, g_strrstr and g_strrstr_len
2001-06-08  Alex Larsson  <alexl@redhat.com>

	* gstrfuncs.[ch]:
	Added new functions g_strstr_len, g_strrstr and g_strrstr_len

	* tests/strfunc-test.c:
	Add some tests for the new functions.

	* gunicode.h:
	* gutf8.c:
	Add length argument to g_utf8_strchr and g_utf8_strrchr.
2001-06-08 23:14:03 +00:00
Sebastian Wilhelmi
08e47ea9f4 Fix to stupid bug in g_random_boolean, also both functions now return 1 or
2001-05-31  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* grand.h (g_random_boolean, g_rand_boolean): Fix to stupid bug in
	g_random_boolean, also both functions now return 1 or 0 instead of
	1<<15 or 0.
2001-05-31 08:12:35 +00:00
Sebastian Wilhelmi
b8ece629f1 Add test case for the g_qsort_with_data func. It works. This fixes bug
2001-05-29  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* tests/Makefile.am, tests/qsort-test.c: Add test case for the
	g_qsort_with_data func. It works. This fixes bug #52605.
2001-05-29 14:55:39 +00:00
Sebastian Wilhelmi
68e002beed Now that we check for a C++ compiler in configure.in anyway, I added a
2001-05-29  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* tests/Makefile.am, tests/cxx-test.C: Now that we check for a C++
	compiler in configure.in anyway, I added a test, that the GLib
	headers can be inclued into a C++ program. This fixes bug #52605.
2001-05-29 14:17:23 +00:00
CEST 2001 Paolo Molaro
477106292a back out change by mitch@convergence.de and apply patch in bug id #52067
Thu May 24 21:24:16 CEST 2001 Paolo Molaro <lupus@ximian.com>

	* gmarkup.c: back out change by mitch@convergence.de and apply patch in
	bug id #52067 that fixes the same problem in a more complete manner.
	This fixes also a segfault for a malformed XML file and adds a new
	test case.
2001-05-24 19:30:40 +00:00
Sebastian Wilhelmi
227d18bc46 Renamed g_thread_create to g_thread_create_full and added macro
2001-05-18  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* gthread.c, gthread.h: Renamed g_thread_create to
	g_thread_create_full and added macro g_thread_create, which omits
	'stack_size', 'bound' and 'priority' parameters. Also removed
	'bound' from GThread struct.

	* gthreadpool.h, gthreadpool.c: Adapted GThreadPool to the above
	changes. GThreadPool lost the 'priority' and 'bound'
	members. g_thread_pool_new the 'stack_size', 'bound' and
	'priority' parameters.

	* tests/mainloop-test.c, tests/thread-test.c,
	tests/threadpool-test.c: Adapted to the above changes.
2001-05-18 08:44:57 +00:00
Sebastian Wilhelmi
cd00d6e2cc Moved func and arg members from GRealThread to GThread, such that they can
2001-05-08  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* gmain.c, gthread.c, gthread.h: Moved func and arg members from
	GRealThread to GThread, such that they can be accessed by the
	user.

	* gthread.c, gthread.h: Due to popular demand (Tim being the
	populus here ;-) threads now have a 'return value', which is
	returned by g_thread_join and is either the return of the topmost
	thread function or the value given to g_thread_exit.

	* gthreadpool.c, tests/mainloop-test.c, tests/thread-test.c:
	Adapted to the above change.
2001-05-08 08:23:18 +00:00
Dan Winship
655d467602 Add a check for the Darwin dynamic linker. Use AC_TRY_LINK when checking
* configure.in: Add a check for the Darwin dynamic linker. Use
        AC_TRY_LINK when checking for "nonposix getpwuid_r" so it notices
        "no getpwuid_r" correctly.

        * testglib.c (main): Make template[] bigger to prevent an overrun.
        Remove an unused variable. Initialize error to NULL.

        * tests/gio-test.c (main): Add a cast to prevent a warning when
        size_t is a long.

        * tests/type-test.c (main): Add an #ifdef to prevent a warning
        when G_HAVE_GINT64 is defined and G_GINT64_FORMAT isn't.
2001-04-20 17:08:57 +00:00
Owen Taylor
c530e1e1dd Define _GNU_SOURCE for stpcpy
Tue Apr 17 10:43:36 2001  Owen Taylor  <otaylor@redhat.com>

	* gstrfuncs.c: Define _GNU_SOURCE for stpcpy

	* tests/mainloop-test.c (main): Wait for all threads
	to start before beginning tests.
2001-04-17 14:48:11 +00:00
Owen Taylor
c13277dc75 Exit with an error message that you should use pkg-config instead.
Tue Apr  3 12:38:16 2001  Owen Taylor  <otaylor@redhat.com>

	* glib-config-2.0.in: Exit with an error message that you
	should use pkg-config instead.

	* configure.in (PACKAGE): Require pkg-config.

	* tests/Makefile.am (EXTRA_DIST): Add utf8.txt.

	* configure.in (GLIB_MICRO_VERSION): Up MICRO to 3,
	leave interface/binary at 0.
2001-04-03 18:27:59 +00:00
Tor Lillqvist
5eef94c8b7 Add module-test rules.
2001-03-29  Tor Lillqvist  <tml@iki.fi>

	* tests/makefile.msc.in: Add module-test rules.
2001-03-29 20:05:58 +00:00
Tor Lillqvist
93fce34a18 Updates. Add module-test rules.
2001-03-29  Tor Lillqvist  <tml@iki.fi>

	* glib.def: Updates.
	* tests/makefile.mingw.in: Add module-test rules.

2001-03-29  Tor Lillqvist  <tml@iki.fi>

	* gobject.def: Updates.
2001-03-29 19:52:45 +00:00
Owen Taylor
df2f429cff -DG_DISABLE_DEPRECATED
Mon Mar 26 14:14:53 2001  Owen Taylor  <otaylor@redhat.com>

	* Makefile.am (INCLUDES): -DG_DISABLE_DEPRECATED

	* gmain.h timeloop.c: Surround the cruftiest stuff with
	#ifndef G_DISABLE_DEPRECATED.

	* gcompat.h gdate.h: Move compat defines back to
	gdate.h, surround with #ifndef G_DISABLE_DEPRECATED.
	Remove gcompat.h.
2001-03-26 19:23:17 +00:00
Tor Lillqvist
3b2f870fdf Don't need this after all. 2001-03-18 19:55:57 +00:00
Tor Lillqvist
b772d30925 Adding but will remove immediatly; no way to cancel a cvs add? 2001-03-18 19:55:11 +00:00
Tor Lillqvist
3bae8165cf Add braces to silence gcc -Wall.
2001-03-18  Tor Lillqvist  <tml@iki.fi>

	* gspawn-win32.c (SETUP_DEBUG): Add braces to silence gcc -Wall.

	* gspawn-win32-helper.c (write_no_error): Remove unused function.

	* tests/makefile.mingw.in (module-test.exe): Add rules for
	building module-test.

2001-03-18  Tor Lillqvist  <tml@iki.fi>

	* gobject.def: Correct some renamed functions.
2001-03-18 19:54:01 +00:00
Owen Taylor
1d5b01bb52 Reorder headers to make FreeBSD happy.
Sat Mar 17 19:54:51 2001  Owen Taylor  <otaylor@redhat.com>

        * timeloop.c: Reorder headers to make FreeBSD happy.
2001-03-18 00:55:10 +00:00
Tor Lillqvist
096ba91bdc Link with the libgmodule la only on Win32.
2001-03-12  Tor Lillqvist  <tml@iki.fi>

	* tests/Makefile.am (libmoduletestplugin_b_la_LIBADD,
	libmoduletestplugin_b_la_LIBADD): Link with the libgmodule la only
	on Win32.

2001-03-12  Tor Lillqvist  <tml@iki.fi>

	* Makefile.am (libgplugin_a_la_LIBADD, libgplugin_b_la_LIBADD):
	Link with the libgmodule la only on Win32.
2001-03-12 06:09:05 +00:00
Tor Lillqvist
8f69a82ccb Use the _LIBADD dependencies on libglib only on Win32.
2001-03-10  Tor Lillqvist  <tml@iki.fi>

	* */Makefile.am: Use the _LIBADD dependencies on libglib only on
	Win32.

	* gobject/gobject.def: Add a couple of missing entries.
2001-03-10 20:03:53 +00:00
Tor Lillqvist
2f928d6457 Link with libglib, libgthread and libgmodule as appropriate. Use
2001-02-21  Tor Lillqvist  <tml@iki.fi>

	* tests/Makefile.am: Link with libglib, libgthread
	and libgmodule as appropriate. Use -no-undefined.
2001-03-09 21:43:36 +00:00
Tor Lillqvist
754d8ddad8 Cygwin support contributed by Stefan Ondrejicka <ondrej@idata.sk>.
2001-02-21  Tor Lillqvist  <tml@iki.fi>

	Cygwin support contributed by Stefan Ondrejicka
	<ondrej@idata.sk>. Hopefully I got it all in while simultaneously
	adding support for auto*/libtool for mingw.

	* Makefile.am: Changes for auto* support on Cygwin and Win32. Do
	still distribute the hand-written makefiles and *.win32.in files,
	though. Use GIO, GSPAWN and PLATFORMDEP macros set by configure.
	Use -no-undefined. Pass -export-symbols glib.def to libtool.

	* configure.in: Define G_PLATFORM_WIN32 on both pure Win32 (mingw)
	and Cygwin. Add AC_CYGWIN, AC_EXEEXT and AC_LIBTOOL_WIN32_DLL
	calls for Cygwin and mingw support.  Check for %I64u guint64
	format (in MS C library). Set G_MODULE_IMPL on mingw and
	Cygwin. Use ac_object and ac_exeext.  Set GIO, GSPAWN, PLATFORMDEP
	and G_LIBS_EXTRA. Compile timeloop only on Unix. Define OS_WIN32
	automake conditional on Win32.

	* glib.h: Include gwin32.h also on Cygwin.

	* gfileutils.c (get_contents_posix): Use O_BINARY (defined as 0 on
	Unix) for Cygwin's sake.

	* gtimer.c (GETTIME): Reduce #ifdefs, use a macro GETTIME().

	* gconvert.c
	* gthread.c
	* gutf8.c
	* gutils.c: For code needed both on Cygwin and native Win32,
	test for G_PLATFORM_WIN32.

	* gmarkup.h: Use G_BEGIN_DECLS and G_END_DECLS.

	* gtypes.h: Refine GLIB_VAR definition. Also check for DLL_EXPORT
	in case compiling a static library on Win32 or Cygwin.

	* gwin32.c: No <direct.h> on Cygwin. No need for ftruncate() or
	dirent emulation on Cygwin.
	(get_package_directory_from_module) Convert return value from
	GetModuleFileName() to POSIX path on Cygwin.

	* tests/Makefile.am (progs_LDADD): Link with libglib, libgthread
	and libgmodule as appropriate. Use -no-undefined.

	* gbacktrace.c: Move #ifdefs around a bit on Win32.

	* gshell.c (unquote_string_inplace): Make static.

	* testglib.c: Make some vars static. Add Cygwin path tests.
2001-03-09 21:31:21 +00:00
Tor Lillqvist
00988d0d76 Implement on Win32. Append the executable file name suffixes from PATHEXT
2001-03-01  Tor Lillqvist  <tml@iki.fi>

	* gutils.c(g_find_program_in_path): Implement on Win32. Append the
	executable file name suffixes from PATHEXT in turn while
	looking	for the program.
	(g_find_program_in_path): If the program we are looking for is a
	relative path in a subdirectory, don't do any path search.
2001-03-01 10:25:12 +00:00
Tor Lillqvist
b6ba941b50 Remove test for initial double backslash (UNC path), this will of course
2001-03-01  Tor Lillqvist  <tml@iki.fi>

	* gutils.c (g_path_is_absolute): (Win32) Remove test for initial
	double backslash (UNC path), this will of course be matched by the
	test for an initial G_DIR_SEPARATOR right up front. Silly me.
	(g_find_program_in_path): Implement on Win32.
	(g_get_any_init): (Win32) Also look for the USERPROFILE env var
	indicating the home directory equivalent.

	* testglib.c (main): Test g_find_program_in_path() on Win32 by
	looking for more.com and regedit.exe.

	* glib.def: Add g_find_program_in_path.
2001-03-01 09:34:45 +00:00
Tor Lillqvist
cd89e4cca6 Match also UNC paths on Win32.
2001-02-21  Tor Lillqvist  <tml@iki.fi>

	* gutils.c (g_path_is_absolute): Match also UNC paths on Win32.

	* gthread.h: Include gtypes.h to be sure to get GLIB_VAR
	definition, remove definition from here.

	* gunicode.h: Remove duplicate GLIB_VAR definition from here, too.

	* gutils.c: (Win32) Use USERPROFILE as home dir if present. On
	Win2k, HOMEDRIVE and HOMEPATH aren't reliable.

	* Makefile.am (INCLUDES): Add -DGLIB_COMPILATION.

	* makefile.mingw.in: Remove install target, Windows isn't Unix.

	* testgdate.c
	* testgdateparser.c
	* testglib.c: Undefine GLIB_COMPILATION.

	* glib.def: Updates.

	* .cvsignore
	* */.cvsignore: Ignore also .obj, .dll, .lib and .exe files.
2001-02-21 12:41:28 +00:00
Havoc Pennington
1c391cc698 include string.h
2001-02-17  Havoc Pennington  <hp@pobox.com>

	* gthread.c: include string.h

        Applied patch from Soeren Sandmann:

	* testglib.c: const fixes

	* gwin32.h: format cleanups

	* gutils.c (g_atexit): constify a variable
	(g_find_program_in_path): constification
	(g_basename): G_CONST_RETURN
	(g_path_skip_root): G_CONST_RETURN
	(g_getenv): G_CONST_RETURN
	(g_get_user_name): G_CONST_RETURN
	(g_get_real_name): G_CONST_RETURN
	(g_get_home_dir): G_CONST_RETURN
	(g_get_tmp_dir): G_CONST_RETURN
	(g_get_prgname): G_CONST_RETURN
	(_glib_gettext): G_CONST_RETURN

	* gunicode.h: formatting cleanups

	* gstrfuncs.c (g_strerror): G_CONST_RETURN
	(g_strsignal): G_CONST_RETURN

	* gspawn.c (g_execute): const on variables

	* gmessages.c (printf_string_upper_bound): fix const on a variable

	* gmem.c (g_mem_chunk_new): make the "name" arg const
	(struct _GRealMemChunk): make the "name" field const

	* gfileutils.c (g_file_open_tmp): store const return in a const
	gchar* variable

	* gdataset.c (g_quark_to_string): G_CONST_RETURN

2001-02-17  Havoc Pennington  <hp@pobox.com>

        Applied patch from Soeren Sandmann:

	* gvaluetypes.c (g_value_get_string): G_CONST_RETURN

	* gtype.c (g_type_name): G_CONST_RETURN

	* gsignal.c (g_signal_name): G_CONST_RETURN

	* gobject-query.c (main): const fix

2001-02-17  Havoc Pennington  <hp@pobox.com>

        Applied patch from Soeren Sandmann:

	* gmodule.c (g_module_error): G_CONST_RETURN
	(g_module_name): G_CONST_RETURN
2001-02-17 23:30:48 +00:00
Sebastian Wilhelmi
41e2001d85 Added functions g_static_rec_mutex_init, g_static_rec_mutex_free,
2001-02-13  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* gthread.c, gthread.h: Added functions g_static_rec_mutex_init,
	g_static_rec_mutex_free, g_static_private_init,
	g_static_private_free, g_static_rw_lock_init to allow the usage of
	all those types dynamically. (g_static_rw_lock_free already
	existed). Aditionally freed static_private indeces are reused
	now. Untill now the array would just grow if you would use more
	and more static_private. That required adding a slist of all
	running threads, which could potentially be of good use later. It
	is not exported however. Renamed a LOCK and small indentation
	fixes.

	* tests/thread-test.c: Test the new static_private index freing
	and reusing feature.
2001-02-13 15:57:44 +00:00
Sebastian Wilhelmi
4e740a1c98 .cvsignore updates
.cvsignore updates
2001-02-06 09:24:20 +00:00
Tor Lillqvist
b6fef45d5a Change order of libs, put progs_LDADD last. Needed for cygwin, says
2001-02-04  Tor Lillqvist  <tml@iki.fi>

	* tests/Makefile.am (thread_LDADD): Change order of libs,
	put progs_LDADD last. Needed for cygwin, says jbdoll@kepri.re.kr.

2001-02-04  Tor Lillqvist  <tml@iki.fi>

	* Makefile.am (progs_LDADD): Change order of libs to libgobject
	first, then libglib. Needed for cygwin, says jbdoll@kepri.re.kr.
2001-02-03 22:32:10 +00:00
Tor Lillqvist
388454cc3b makefile.mingw.in Protect the rule to rebuild makefile.mingw if
2001-01-25  Tor Lillqvist  <tml@iki.fi>

	* makefile.mingw.in
	* */makefile.mingw.in: Protect the rule to rebuild makefile.mingw
	if makefile.mingw.in has changed with a check if said .in file
	exists. (This rule is mainly a convenience for yours truly.)
2001-01-25 22:08:11 +00:00
Tor Lillqvist
8a0df0a71c Socket support rewritten. It was utterly broken, and untested in fact. We
2001-01-25  Tor Lillqvist  <tml@iki.fi>

	* giowin32.c: Socket support rewritten. It was utterly broken, and
	untested in fact. We still do use a thread for each socket being
	watched, but instead of blocking in recv() (which of course was
	plain stupid for sockets being liste()ed on), we block in
	select(). The read method for sockets calls recv(). It is now
	possible for the application to call accept(), recv() or send() in
	the callback, just like on Unix. Tested with code kindly provided
	by Andrew Lanoix.

	Rename g_io_channel_win32_new_stream_socket() to
	g_io_channel_win32_new_socket() as it isn't restricted to stream
	sockets.

	* gmain.c (g_poll): Related changes in the Win32 version of
	g_poll(). When polling for messages, always do a PeekMessage()
	first. We used to miss messages if several were posted between
	calls to g_poll().

	* giochannel.h: Improve Win32-related comments.

	* gutf8.c: (Win32) Include <stdio.h> for sprintf.

	* tests/gio-test.c: (Win32) Add tests for polling for Windows
	messages.

	* tests/makefile.mingw.in: Remove superfluous compilation command
	line.
2001-01-25 21:16:46 +00:00
Tor Lillqvist
69dbd6eb03 Add doc comments. (g_win32_get_package_installation_directory): Add one
2001-01-17  Tor Lillqvist  <tml@iki.fi>

	* gwin32.c (g_win32_getlocale, g_win32_error_message): Add doc
	comments.
	(g_win32_get_package_installation_directory): Add one parameter,
	the name of a DLL in the package. Add possibility to use that to
	deduce the installation directory if not entered into the
	Registry. Make the return value dynamically allocated.
	(g_win32_get_package_installation_subdirectory): New convenience
	function.

	* gutils.c (GLIB_LOCALE_DIR)
	* gwin32.h: Adapt accordingly.

	* testglib.c (main): Adapt tests accordingly.
2001-01-17 21:37:32 +00:00
Tor Lillqvist
a9d05d4cc4 Define ENABLE_NLS and GETTEXT_PACKAGE.
2001-01-17  Tor Lillqvist  <tml@iki.fi>

	* config.h.win32.in: Define ENABLE_NLS and GETTEXT_PACKAGE.

	* makefile.mingw.in
	* makefile.msc.in: Use the GNU intl library.

	* gwin32.c (g_win32_get_package_installation_directory): New
	function. To be used by various GLib-using packages to get their
	installation directory, which should be stored in the Registry by
	some installer.

	* gwin32.h: Declare it.

	* testglib.c (main): Test it.

	* gutils.c: On Win32, define GLIB_LOCALE_DIR using
	g_win32_get_package_installation_directory().

	* glib.def: Update.
2001-01-16 22:06:23 +00:00
Tor Lillqvist
deb68e1592 Get len using strlen() if arg is negative in the Win32 code, too.
2001-01-06  Tor Lillqvist  <tml@iki.fi>

	* gconvert.c (g_locale_to_utf8, g_locale_from_utf8): Get len using
	strlen() if arg is negative in the Win32 code, too.

	* giowin32.c: Changes necessary to be able to run
	mainloop-test. We can't close the fd that our (internal) reader
	thread is sitting doing a blocking read() from. We must terminate
	the thread first. Keep track of thread handle, and close it when
	thread is dying. Start reader thread with the lower-level
	CreateThread() instead of _beginthreadex() from the C runtime, in
	order to be able to use TerminateThread(). Hopefuly this isn't
	harmful.

	* glib.def: Update.

	* tests/makefile.{mingw,msc}.in (TESTS): Add mainloop-test and
	unicode-encoding.

	* tests/mainloop-test.c: Portability: <unistd.h>, need <fcntl.h>
	on Win32.

	* tests/unicode-encoding.c (process): Add missing "line" argument
	to fail(). On Win32, convert UTF-16LE, as libiconv'c ivonf always
	converts to UTF-16BE if we ask for unspecific UTF-16.
	(main) Handle also '\r'.
2001-01-06 03:09:46 +00:00
Owen Taylor
956f00ed96 move $enable_debug down below checks for GCC to avoid setting CFLAGS
Fri Jan  5 11:25:42 2001  Owen Taylor  <otaylor@redhat.com>

	* configure.in (PACKAGE): move $enable_debug down below
	checks for GCC to avoid setting CFLAGS prematurely,
	change checks to avoid adding -g twice.

	* gutf8.c (g_ucs4_to_utf8): Support len < 0 to mean
	0 termination.

	* gutf8.c (g_utf8_to_ucs4): Terminate result with 0.

	* tests/mainloop-test.c (main): Fix uses of
	g_main_loop_destroy().

	* tests/unicode-encoding.c tests/Makefile.am tests/utf8.txt:
	Tests for unicode-conversion code.

	* gconvert.c (g_convert, g_convert_with_fallback): work around
	a couple of GNU libc bugs.

	* gconvert.[ch] (g_{locale,filename}_{to,from}_utf8): Standardize
	arguments to match g_convert(). Document.

	* gunicode.[ch]:
	  - Implement conversion functions to and from UTF-16
	  - Standardize unicode conversion functions on prototype like
	    g_convert.
	  - Add a lot of error checking to unicode conversion functions.

	* gunicode.[ch] (g_utf8_to_ucs4_fast): Add fast, non-checking
	variant of g_utf8_to_ucs4.

	* gutf8.c (g_utf8_validate):
	 - add g_return_if_fail (str != NULL).
	 - add checks for overlong strings, non-valid Unicode characters (>= 110000)
	   and single surrogates.
2001-01-05 21:22:47 +00:00
Tor Lillqvist
71e0f93747 Add test for g_path_skip_root().
2001-01-05  Tor Lillqvist  <tml@iki.fi>

	* testglib.c (main): Add test for g_path_skip_root().

	* gutils.c (g_path_skip_root): Fix bugs in code I just added ;-)
2001-01-05 20:19:37 +00:00
Havoc Pennington
c52cce1b51 -I$(top_srcdir)/gmodule, fix from Michael Meeks
2001-01-03  Havoc Pennington  <hp@pobox.com>

* tests/Makefile.am (INCLUDES): -I$(top_srcdir)/gmodule,
fix from Michael Meeks

* Makefile.am (INCLUDES): DISABLE was spelled wrong
2001-01-04 03:49:45 +00:00
Ali Abdin
855e230f31 New gcompat.h header file as recommended by Havoc.
2000-12-24  Ali Abdin  <aliabdin@aucegypt.edu>

        * Makefile.am, gcompat.h, glib.h: New gcompat.h header file
          as recommended by Havoc.

        * gdate.c, gdate.h, testgdate.c,
          docs/reference/glib/glib-sections.txt,
          docs/reference/glib/tmpl/date.sgml, tests/date-test.c: Rename some
          of the gdate functions to use the '_get' in their name. Patch
          reviewed by Havoc.
2000-12-24 12:11:06 +00:00
Sebastian Wilhelmi
57a7a2b010 Determine the suffix of the shared librarries for this system. This is
2000-12-22  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* configure.in: Determine the suffix of the shared librarries for
	this system. This is done analogous to
	ltconfig.sh. G_MODULE_SUFFIX in glibconfig.h is set to either
	"sl", "dll", or (most often) "so".

	* tests/Makefile.am, tests/module-test.c,
	tests/libmoduletestplugin_a.c, tests/libmoduletestplugin_b.c:
	Added new testcase for gmodule. This is mostly copied from
	gmodule/testgmodule.c, but unlike that is is quiet. (Why BTW are
	some tests that verbose, not to say loquacious...)

	* gmodule.c: Make g_module_open more tolerant wrt to the module
	name. First it tries to open the module as named, if that fails,
	it checks, whether it is a libtool archive and parses it, if that
	fails it appends the systems shared library suffix
	(i.e. ".so") (if not already found) and tries again and if that
	fails it tries to append the ".la" libtool suffix (if not already
	found) and parses it.

	* gmodule.c: Lock recursive mutex during most module functions for
	safety.

	* gmodule-dl.c: Return an error from _g_module_symbol only, if
	dlerror says so. All other functions return an error as well, if
	dlerror returns NULL.

	* testgmodule.c: Thanks to the above change the #ifdefs have
	vanished.

	* glib/glib-sections.txt: Added G_MODULE_SUFFIX.

	* glib/tmpl/modules.sgml: Updated.
2000-12-22 13:44:25 +00:00
Raja R Harinath
0b6e1350e1 Rearrange into other veriables, and include run-markup-tests.sh.
* tests/Makefile.am (TESTS): Rearrange into other veriables, and
include run-markup-tests.sh.
(TESTS_ENVIRONMENT): New.  Pass $srcdir to tests.
(noinst_PROGRAMS): Rename to ...
(check_PROGRAMS): ... this.  'automake' ensures that these are
built before running the tests.
* tests/run-markup-tests.sh: Support $srcdir != $builddir.
2000-12-08 21:04:52 +00:00
Havoc Pennington
dd087e5aaa move markup-test to noinst_PROGRAMS; it isn't a proper test, the proper
2000-12-08  Havoc Pennington  <hp@pobox.com>

* tests/Makefile.am (TESTS): move markup-test to noinst_PROGRAMS;
it isn't a proper test, the proper test would be
run-markup-tests.sh, but that can't go in tests, so we need
a manual make check rule. Didn't do that yet.
2000-12-08 15:03:12 +00:00
Owen Taylor
1084477e03 Add a bunch of unrefs.
Thu Dec  7 15:22:30 2000  Owen Taylor  <otaylor@redhat.com>

	* tests/mainloop-test.c (recurser_start): Add a bunch
	of unrefs.

	* gmain.c (g_source_attach): Reference the source
	when adding (pointed out by Elliot)
2000-12-07 20:29:58 +00:00
Havoc Pennington
e5c1f207c9 add g_strdupv test
2000-12-06  Havoc Pennington  <hp@pobox.com>

* tests/strfunc-test.c (main): add g_strdupv test

* gstrfuncs.c (g_strdupv): Add a function to copy
an array of strings
2000-12-07 04:48:37 +00:00
Owen Taylor
e2fd4e2bd0 Major change in API for creating sources to handle multiple main loops
Tue Dec  5 12:23:04 2000  Owen Taylor  <otaylor@redhat.com>

        * gmain.[hc]: Major change in API for creating sources
	to handle multiple main loops (GMainContext *).

	GSources are now exposed as GSource * and implemented
	with structure derivation.

	* giochannel.[ch]: Changed vtable for GIOChannel to correspond
	to the new mainloop API, add g_io_channel_create_watch().

	* gtypes.h: Move GTimeVal here.

	* gthread.h: Remove gmain.h include to avoid circularity.

        * giounix.c: Update for new GMain API.

	* giowin32.c: Update for new GMain API. (No check for
	proper compilation or working.)

	* timeloop.c timeloop-basic.c: A benchmarking program for
	the main loop comparing the main loop against a
	hand-written (timeloop-basic.c) variant.

	* tests/mainloop-test.c: New torture test of mainloop.

	* docs/Changes-2.0.txt: Started. Added text about
	changes to GMain.

	* gmain.c (g_main_add_poll_unlocked): Initial fd->revents
	to zero. (#8482, Benjamin Kahn)
2000-12-05 20:45:33 +00:00
Tor Lillqvist
74987b2cf0 Include make.msc from GLib's build subdir.
2000-12-01  Tor Lillqvist  <tml@iki.fi>

	* {.,*}/makefile.msc.in: Include make.msc from GLib's build subdir.

	* makefile.{mingw,msc}.in (glib_OBJECTS): Add gunibreak.

	* glib.def: Update correspondingly.
2000-12-01 15:11:54 +00:00
Elliot Lee
790a7bd3be Fix warnings.
* gmarkup.c: Fix warnings.

* guniprop.c, gunidecomp.c: Make warnings go away by using
GPOINTER_TO_INT() instead of (int).

* gcompletion.[ch]: Add g_completion_set_compare(),
to allow (for example) using case-insensitive completion.

* gobject/gsignal.c: Fix warnings about possible use of uninitialized
variables, and fix logic that would leave 'node' unset in cases
that it might be used in.

* gobject/glib-genmarshal.c: Fix warning about printf format.
2000-11-28 23:44:21 +00:00
Owen Taylor
cc7ce9f9d7 Released 1.3.2
Fri Nov 17 15:43:00 2000  Owen Taylor  <otaylor@redhat.com>

        * Released 1.3.2

	* NEWS: Update.

	* tests/Makefile.am (dist-hook): Add code to distribute
	markup test files.
2000-11-17 20:44:24 +00:00
Tor Lillqvist
4f76917c6a Improve chance to generate unique names with less effort a bit.
2000-11-11  Tor Lillqvist  <tml@iki.fi>

	* gfileutils.c (g_mkstemp): Improve chance to generate unique
	names with less effort a bit.

	* gfileutils.h: Add g_file_open_tmp() declaration.

	* testglib.c: Include <io.h> on Win32.

	* makefile.mingw.in: Correct the way to invoke sub-makes.

2000-11-11  Tor Lillqvist  <tml@iki.fi>

	* gtypemodule.c: Include stdlib.h for exit().

	* makefile.{mingw,msc}.in (gobject_OBJECTS): Add gtypemodule.

	* gobject.def: Add new functions.
2000-11-11 13:46:15 +00:00