Commit Graph

26369 Commits

Author SHA1 Message Date
Owen Taylor
19f04a9024 head -n 4 ChangeLog 2000-09-06 00:04:49 +00:00
Sebastian Wilhelmi
3ca18629b0 Don't use a G_LOCK, as it isn't necessary.
2000-09-05  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* gthread.c (g_thread_error_quark): Don't use a G_LOCK, as it
	isn't necessary.
2000-09-05 08:58:20 +00:00
Sebastian Wilhelmi
702f1d12d0 .cvsignore updates
.cvsignore updates
2000-09-01 13:58:25 +00:00
Sebastian Wilhelmi
fab90158aa Use g_return_val_if_fail instead of g_return_if_fail, as the function now
2000-09-01  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* gstring.c (g_string_free): Use g_return_val_if_fail instead of
	g_return_if_fail, as the function now is supposed to return
	something.
2000-09-01 13:45:43 +00:00
Sebastian Wilhelmi
4d1cb41ef9 Use GError to report errors as well.
2000-09-01  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* gthread-solaris.c (g_thread_create_solaris_impl): Use GError to
	report errors as well.
2000-09-01 13:33:04 +00:00
Sebastian Wilhelmi
64bbfbb6da Include gerror.h before it is used for some g_thread_* functions.
2000-09-01  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* glib.h: Include gerror.h before it is used for some g_thread_*
	functions.

	* gthread.c, gthreadpool.c, glib.h: Enable error reporting for
	thread creation, namly for g_thread_create, g_thread_pool_new,
	g_thread_pool_push and g_thread_pool_set_max_threads.

	* tests/thread-test.c, tests/threadpool-test.c: Adapted
	accordingly.

	* gthread-posix.c (g_thread_create_posix_impl): Use GError to
	report errors.
2000-09-01 13:03:23 +00:00
Sebastian Wilhelmi
21a498b1a5 Added function g_propagte_error to hand over local errors to the calling
2000-09-01  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* gerror.c, gerror.h (g_propagte_error): Added function
	g_propagte_error to hand over local errors to the calling
	function.
2000-09-01 12:47:42 +00:00
Tor Lillqvist
3dcf39eb77 glib.h glib.def New function, to make a GPollFD from a GIOChannel. Creates
2000-08-31  Tor Lillqvist  <tml@iki.fi>

	* glib.h
	* glib.def
	* giowin32.c (g_io_channel_win32_make_pollfd): New function, to
	make a GPollFD from a GIOChannel. Creates the events and starts
	the reader thread if necessary.
2000-08-31 22:47:24 +00:00
Tor Lillqvist
ba8a71589d glib.h No use for separate condition parameter.
2000-08-31  Tor Lillqvist  <tml@iki.fi>

	* glib.h
	* giowin32.c (g_io_channel_win32_poll): No use for separate
	condition parameter.
2000-08-31 21:58:59 +00:00
Tor Lillqvist
48b41a2f5f Keep the check for non-NULL parameter. 2000-08-31 20:56:42 +00:00
Tor Lillqvist
a7e60b7576 Simplify, use GetSystemTimeAsFileTime().
2000-08-31  Tor Lillqvist  <tml@iki.fi>

	* gmain.c (g_get_current_time): (Win32): Simplify, use
	GetSystemTimeAsFileTime().
2000-08-31 20:55:16 +00:00
Tor Lillqvist
55cd16c993 Hmm, the parameter to g_io_channel_win32_poll() should be a GPollFD array,
2000-08-27  Tor Lillqvist  <tml@iki.fi>

Hmm, the parameter to g_io_channel_win32_poll() should be
a GPollFD array, not GIOChannel. That way the caller can know which
channels cause the callback.
2000-08-27 15:33:15 +00:00
Tor Lillqvist
3d0a1b3b22 New function, otherwise like g_io_channel_win32_wait_for_condition(), but
2000-08-27  Tor Lillqvist  <tml@iki.fi>

	* giowin32.c (g_io_channel_win32_poll): New function, otherwise
	like g_io_channel_win32_wait_for_condition(), but accept several
	GIOChannels.
	(g_io_channel_win32_wait_for_condition): Call
	g_io_channel_win32_poll().

	* glib.h: Declare g_io_channel_win32_poll().

	* gwin32.c (g_win32_error_message): Don't believe return value
	from FormatMessage.
2000-08-27 10:53:36 +00:00
Elliot Lee
a435aaff03 Mark the following functions G_GNUC_CONST (to allow betteroptimization)
2000-08-25 Elliot Lee <sopwith@redhat.com>
	* glib.h, gunicode.h, gmodule/gmodule.h:
	Mark the following functions G_GNUC_CONST (to allow
	betteroptimization) because their results are a function of only their parameters:
	g_int_hash, g_int_equal, g_direct_hash, g_direct_equal, g_quark_to_string,
	g_date_is_leap_year, g_date_days_in_month, g_date_monday_weeks_in_year,
	g_date_sunday_weeks_in_year, g_spaced_primes_closest, g_unichar_is*,
	g_unichar_to*, g_unichar_*digit_value, g_unichar_type
2000-08-25 22:45:48 +00:00
Elliot Lee
8f2c74a5b2 Fix inclusion of config.h
Fix inclusion of config.h
2000-08-21 23:06:11 +00:00
Owen Taylor
33df64519d Fix a couple of trivial bugs that were causing warnings.
Mon Aug 21 14:46:23 2000  Owen Taylor  <otaylor@redhat.com>

	* tests/gio-test.c: Fix a couple of trivial bugs that
	were causing warnings.

Mon Aug 21 14:39:36 2000  Owen Taylor  <otaylor@redhat.com>

	* glib.h: Use C99 varargs macros where possible
	(check __STDC_VERSION__), otherwise, on gcc, use an alternate
	form of gcc varargs which is more likely
	to be supported going forward. (Based on some code
	from Raja Harinath)
2000-08-21 18:46:52 +00:00
Darin Adler
4010a5acb2 Return the data left behind. Return the data left behind.
* glib.h:
    * garray.c: (g_array_free), (g_ptr_array_free),
    (g_byte_array_free): Return the data left behind.
    * gstring.c: (g_string_free): Return the data left behind.

    Changed the free calls that leave data behind so they
    return a pointer to the left-behind data, NULL if told not
    to leave anything behind. This makes these calls easier
    to use correctly, without any incompatible API change for
    callers that don't know about the return value. Of course,
    it would be even clearer if the free calls weren't dual-purpose
    in the first place.
2000-08-17 21:37:18 +00:00
Tor Lillqvist
f17ed7ee26 Some indentation and spacing fixes. Add some more logging.
2000-08-12  Tor Lillqvist  <tml@iki.fi>

	* giowin32.c: Some indentation and spacing fixes. Add some more
	logging.
	(g_io_win32_add_watch): New function, with common code from
	g_io_win32_fd_add_watch and g_io_win32_sock_add_watch. Don't start
	more than one reader thread for a GIOChannel. We should obviously
	have just one reader thread reading a file descriptor or socket.
2000-08-11 21:36:00 +00:00
Havoc Pennington
4261dcfa99 don't duplicate glib Cflags
2000-08-10  Havoc Pennington  <hp@redhat.com>

* gthread-2.0.pc.in (Cflags): don't duplicate glib Cflags

* gmodule-2.0.pc.in (Cflags): don't duplicate glib Cflags

* gobject-2.0.pc.in (Cflags): don't duplicate Cflags from glib
itself
2000-08-11 03:29:19 +00:00
Havoc Pennington
c055bfe189 Look in glib-2.0/include for glibconfig.h
2000-08-10  Havoc Pennington  <hp@redhat.com>

* glib-2.0.pc.in (Cflags): Look in glib-2.0/include for
glibconfig.h
2000-08-11 03:23:08 +00:00
Tor Lillqvist
3d6f441f96 New function, that calls g_source_remove(). Check return value of
2000-08-07  Tor Lillqvist  <tml@iki.fi>

	* tests/gio-test.c (shutdown_source): New function, that calls
	g_source_remove(). Check return value of g_source_remove(), and
	decrement running subprocess counter only if g_source_remove()
	actually did remove the source.

	(recv_message): Call shutdown_source() on EOF condition. Return
	FALSE on G_IO_HUP and G_IO_ERR condition. Fix printf format typo.
2000-08-06 23:33:29 +00:00
Tim Janik
042179dad8 keep *last updated while running through the domain list, so we don't
Sun Aug  6 20:06:02 2000  Tim Janik  <timj@gtk.org>

        * gmessages.c (g_log_domain_check_free): keep *last updated while
        running through the domain list, so we don't screw up the removal,
        patch provided by Gady Kozma <gadykozma@hotmail.com>.

Sun Aug  6 20:03:41 2000  Tim Janik  <timj@gtk.org>

        * gmessages.c (g_log_remove_handler): keep *last updated while running
        through the handler list, so we don't screw up the removal.
2000-08-06 18:09:32 +00:00
Owen Taylor
37e7118821 Fix stray character
Sun Jul 30 16:54:13 2000  Owen Taylor  <otaylor@redhat.com>

        * gunicode.h: Fix stray character

	* gutf8.c (g_unichar_to_utf8): Allow outbuf to be NULL, in
	which case we just compute the length.
2000-07-31 18:52:11 +00:00
Havoc Pennington
8bca378a6e forgot to add .pc.in to EXTRA_DIST
2000-07-31  Havoc Pennington  <hp@redhat.com>

* Makefile.am (EXTRA_DIST): forgot to add .pc.in to EXTRA_DIST
2000-07-31 17:13:55 +00:00
Havoc Pennington
0ae2749548 pkg-config data files
2000-07-31  Havoc Pennington  <hp@redhat.com>

        * glib-2.0.pc.in, gobject-2.0.pc.in, gmodule-2.0.pc.in,
	gobject-2.0.pc.in: pkg-config data files

	* Makefile.am: Install/dist the .pc files

	* configure.in: Output the .pc files
2000-07-31 17:10:33 +00:00
Tor Lillqvist
c58440ecfc Drop a few unused variables. 2000-07-31 15:12:21 +00:00
Tor Lillqvist
beed3997ab The code didn't compile (must have been sleepy when committing). "return"
2000-07-31  Tor Lillqvist  <tml@iki.fi>

	* giowin32.c (buffer_read): The code didn't compile (must
	have been sleepy when committing). "return" instead of "break"

	(g_io_win32_fd_add_watch): Cannot check if the file descriptor is
	readable by calling ReadFile to read zero bytes. ReadFile blocks
	on NT even if trying to read nothing at all. So, don't check if
	file descriptor is readable; assume this function isn't called
	otherwise.
2000-07-31 15:11:02 +00:00
Tim Janik
33efff673a fix tor's recent changes which got rid of a required variable in the
Sun Jul 30 10:44:16 2000  Tim Janik  <timj@gtk.org>

        * gmain.c (g_get_current_time): fix tor's recent changes which
        got rid of a required variable in the non-windows path.
2000-07-30 08:44:06 +00:00
Tor Lillqvist
1860151db0 Compile in the debugging code all the time, but only output debug messages
2000-07-30  Tor Lillqvist  <tml@iki.fi>

	* giowin32.c: Compile in the debugging code all the time, but only
	output debug messages if told so. Add (unadvertised) function to
	turn on/off debug messages for a channel.

	(buffer_read): Don't loop. It is expected behaviour to return a
	short read occasionally, for instance when reading from
	pipes. It's the calling code that should loop if it *knows* how
	much the writer has written.

	* tests/gio-test.c: Correct the program's name in the output.
	(recv_message): Loop calling g_io_channel_read() (in a new
	function read_all()) until we have all the bytes we want (that we
	know the writer has written/will write).
2000-07-30 00:27:39 +00:00
Tor Lillqvist
b965bb5db1 Finally, a new and improved IO Channel and condition watch implementation
2000-07-30  Tor Lillqvist  <tml@iki.fi>

	Finally, a new and improved IO Channel and condition watch
	implementation for Win32. Based on code provided by Craig Setera.

	When watching file descriptors, for which there is no select()
	like functionality on Win32 that would work on all Win32 platforms
	for all types of file descriptors (including anonymous pipes), we
	start a new thread that blocks while trying to read from the file
	descriptor. When the read returns, a Win32 Event is signalled that
	the polling routine eventually notices. Meanwhile, the data being
	read is stored in a circular buffer, from where the IO channel's
	read() method picks it up.

	If the buffer fills up the reading thread has to wait for space
	becoming available. For this another Win32 Event is used. The IO
	Channel's read() method signals this when it has read some data
	out of the buffer.

	The separate reader thread(s), and the circular buffer(s) with
	associated events mean lots of possibilities for fun parallellism
	errors. But it seems to work OK, i.e. GIMP runs.

	* gmain.c: Small changes to the Win32 polling function.
	(g_main_win32_get_poll_func): New function. Perhaps it would be a
	good idea to provide this on all platforms.

	* giowin32.c: The bulk of the new implementation.
	(g_io_channel_win32_wait_for_condition): New function. To be used
	where on Unix one does a select() on the channel's fd, like
	libgimp's gimp_extension_process(). Could be provided on all
	platforms.

	* glib.h: Update documentation for IO Channels on Win32. Remove
	the declarations for the as of now obsolete old functions related
	to IO Channels for pipes with "wakeup" messages.

	* glib.def: Some new functions.

	* tests/gio-test.c: New file, to test GIOChannel and main loop.

	* tests/Makefile.am
	* tests/makefile.mingw.in: Add it.
2000-07-29 20:59:07 +00:00
Tor Lillqvist
d33887428e No, don't mark glib_debug_objects for export here, it's handled specially
2000-07-27  Tor Lillqvist  <tml@iki.fi>

	* gobject.c: No, don't mark glib_debug_objects for export here,
	it's handled specially in gtktypeutils.c.

	* gobject.def: Export g_type_fundamental_last (the function).
2000-07-27 05:31:12 +00:00
Tim Janik
864d4be8ca completed tor's fix to cover both #ifdef branches.
Thu Jul 27 05:15:11 2000  Tim Janik  <timj@gtk.org>

        * gstrfuncs.c (g_strlcpy, g_strlcat): completed tor's fix
        to cover both #ifdef branches.
2000-07-27 03:16:15 +00:00
Tor Lillqvist
42d1962199 Return 0 on error, not NULL.
2000-07-26  Tor Lillqvist  <tml@iki.fi>

	* gstrfuncs.c (g_strlcpy, g_strlcat): Return 0 on error, not NULL.

	* glib.def: Add g_strlcpy, g_strlcat.

	* glibconfig.h.win32.in: Add gsize and gssize.
2000-07-26 15:39:44 +00:00
Tor Lillqvist
f0cdf86878 gobject.def Mark glib_debug_objects for export/import as it is used by
2000-07-26  Tor Lillqvist  <tml@iki.fi>

	* gobject.def
	* gobject.c: Mark glib_debug_objects for export/import as it is
	used by GTK+.
2000-07-26 15:33:50 +00:00
Tim Janik
c9bd7542e1 applied patch from Andreas Persenius <ndap@swipnet.se> that updates the
Wed Jul 26 12:59:31 2000  Tim Janik  <timj@gtk.org>

        * *.[hc]: applied patch from Andreas Persenius <ndap@swipnet.se> that
        updates the license headers to the GNU Lesser General Public License,
        as well as updating the copyright year to 2000.
2000-07-26 11:02:02 +00:00
Tim Janik
83e49bd036 added g_strlcat() and g_strlcpy() wrappers, supplied by David Wheeler
Wed Jul 26 05:47:48 2000  Tim Janik  <timj@gtk.org>

        * configure.in:
        * testglib.c:
        * gstrfuncs.c:
        * glib.h: added g_strlcat() and g_strlcpy() wrappers, supplied by
        David Wheeler <dwheeler@ida.org>:

        * glib.h, gstrfuncs.c: added g_strlcpy and g_strlcat to support
          safe manipulation of fixed-length string buffers.
          These functions were originally developed by Todd Miller to simplify
          development of security-related programs, and
          are available on many (but not all) Unix-like systems,
          including OpenBSD, FreeBSD, and Solaris.  See
          ftp://ftp.openbsd.org/pub/OpenBSD/src/lib/libc/string/strlcpy.3
          and http://www.openbsd.org/security.html.
          If there's a strlcpy/strlcat on the system, it's called, otherwise
          an implementation is provided.

        * testglib.c: Added tests for g_strlcpy, g_strlcat.
2000-07-26 03:51:07 +00:00
Tim Janik
cb2f078051 include <stdlib.h> and <stddef.h> if STDC_HEADERS is defined.
Wed Jul 26 05:03:24 2000  Tim Janik  <timj@gtk.org>

        * acglib.m4 (GLIB_SIZEOF): include <stdlib.h> and <stddef.h> if
        STDC_HEADERS is defined.

        * glib.h:
        * glibconfig.h: define gsize and gssize in terms of GLIB_SIZEOF_SIZE_T

        * glib.h (g_return_if_reached): applied darin's fix for copy'n
        paste error in the macro implementation.
2000-07-26 03:18:27 +00:00
Tim Janik
623efc182c applied patch from Darin Adler <darin@eazel.com> which supplies
Wed Jul 26 00:46:03 2000  Tim Janik  <timj@gtk.org>

        * glib.h: applied patch from Darin Adler <darin@eazel.com> which
        supplies g_return_if_reached(), g_return_val_if_reached() and
        g_critical().
2000-07-25 22:48:09 +00:00
Tim Janik
18ac8965f8 make g_type_fundamental_last() a function, avoiding all that extern
Sun Jul 23 17:23:35 2000  Tim Janik  <timj@gtk.org>

        * gtype.[hc]: make g_type_fundamental_last() a function, avoiding all
        that extern variable clutter and avoiding further problems with thread
        safety.
2000-07-25 22:47:41 +00:00
Tor Lillqvist
524cb26d54 Mention -fnative-struct here, too... 2000-07-22 11:54:19 +00:00
Tor Lillqvist
f07b4a876e Fix resource handling, the resource file got left out from the DLL after
2000-07-22  Tor Lillqvist  <tml@iki.fi>

	* build-dll: Fix resource handling, the resource file got left out
	from the DLL after all... Remove the WIN32APIHEADERS, not needed
	with current windres.

	* glib.def: Add new functions.
2000-07-22 08:38:06 +00:00
Sebastian Wilhelmi
fec9828ac6 Mark the functions g_basename and g_dirname deprecated. They will issue an
2000-07-20  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* gutils.c, glib.h: Mark the functions g_basename and g_dirname
	deprecated. They will issue an warning once, when compiled with
	G_ENABLE_DEBUG, but continue to work as before. Instead the
	functions g_path_get_basename and g_path_get_dirname should be
	used, which BOTH return newly allocated memory, that has to freed
	by g_free. The new g_path_get_basename now strips trailing slashes
	from the path. This fixes #5097. For discussion see
	http://mail.gnome.org/pipermail/gtk-devel-list/2000-April/003139.html

	* gwin32.c, testglib.c, tests/dirname-test.c: Use the new
	functions instead of the old ones.

	* gmodule/libgplugin_a.c, gmodule/testgmodule.c: Use
	g_path_get_basename instead of the deprecated g_basename.
2000-07-20 16:58:54 +00:00
Sebastian Wilhelmi
84114c5321 Mark the functions g_hash_table_freeze, g_hash_table_thaw and thus
2000-07-20  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* ghash.c, gscanner.c, glib.h: Mark the functions
	g_hash_table_freeze, g_hash_table_thaw and thus
	g_scanner_freeze_symbol_table and g_scanner_thaw_symbol_table
	deprecated. They will issue an warning once, when compiled with
	G_ENABLE_DEBUG. This fixes Bug #3883. For discussion see
	http://mail.gnome.org/pipermail/gtk-devel-list/2000-April/003139.html
2000-07-20 16:06:33 +00:00
Tor Lillqvist
5e4c5611ab gparam.h gvalue.h gparam.c Shut up Sun's picky compiler.
2000-07-19  Tor Lillqvist  <tml@iki.fi>

* gparam.h
* gvalue.h
* gparam.c
* gtype.c: Shut up Sun's picky compiler.
2000-07-19 16:02:43 +00:00
Sebastian Wilhelmi
cb931f4980 glibconfig.h and glib.h now include files outside of the extern "C" block.
2000-07-19  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* configure.in, glib.h: glibconfig.h and glib.h now include files
	outside of the extern "C" block. Makes some C++ compiler
	happy. Reported by Denis Vakatov <vakatov@peony.nlm.nih.gov>.

	* gmodule/gmodule.h: include glib.h before doing extern "C".
        Makes some C++ compiler happy. Reported by Denis Vakatov
	<vakatov@peony.nlm.nih.gov>.
2000-07-19 14:01:22 +00:00
Tor Lillqvist
93b1001c10 Don't #include <tlhelp32.h> when compiling with gcc, as it isn't provided.
2000-07-19  Tor Lillqvist  <tml@iki.fi>

* gmodule-win32.c: Don't #include <tlhelp32.h> when compiling with gcc, as it
isn't provided. Declaration of a needed struct (from
www.microsoft.com) inserted instead.
2000-07-18 20:24:29 +00:00
Owen Taylor
9556b49053 Remove incomplete start of info file -
Sat Jul 15 23:49:03 2000  Owen Taylor  <otaylor@redhat.com>

	* glib/glib.texi: Remove incomplete start of info file -
2000-07-16 03:49:54 +00:00
Owen Taylor
26602fdbc7 Add build/Makefile and build/win32/Makefile to AC_OUTPUT() so things build
Sat Jul 15 22:44:22 2000  Owen Taylor  <otaylor@redhat.com>

	* configure.in: Add build/Makefile and
        build/win32/Makefile to AC_OUTPUT() so things build
        again.
2000-07-15 21:59:15 +00:00
Tim Janik
a9a09f147f fixed an off by 0 error (yeah, the function went off when the while (n--)
Sat Jul 15 09:11:46 2000  Tim Janik  <timj@gtk.org>

        * gstrfuncs.c (g_strncasecmp): fixed an off by 0 error (yeah,
        the function went off when the while (n--) loop failed due to
        n==0 ;), reported by Jean-Louis HAMEL <jlhamel@club-internet.fr>.
2000-07-15 07:18:19 +00:00
Tor Lillqvist
45adcf12c1 Include the "build" module in GLib, too, to make it more self-contained.
2000-07-15  Tor Lillqvist  <tml@iki.fi>

* Makefile.am (SUBDIRS): Include the "build" module in GLib, too,
to make it more self-contained. If your CVS client doesn't
automatically get it, do a cvs get build in glib.

* */makefile.mingw.in: Include make.mingw from build in the glib
source directory.
2000-07-14 22:46:35 +00:00