Commit Graph

69 Commits

Author SHA1 Message Date
Sebastian Wilhelmi
6088718e19 max_len can't be initialized statically as it might call a function. So do
2000-09-28  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* gutils.c (g_get_current_dir): max_len can't be initialized
	statically as it might call a function. So do it at first call.
2000-09-28 07:35:02 +00:00
Sebastian Wilhelmi
e2600b0476 Test for the existence of getcwd, and use it only when found.
2000-09-19  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* acconfig.h, configure.in, gutils.c: Test for the existence of
	getcwd, and use it only when found.

	* glib.h: Only use the gcc-variable-macro-argument-extension for
	gcc >= 2.4. Both patches from Jonas Oberg <jonas@gnu.org>.
2000-09-19 14:30:35 +00:00
Tim Janik
9432265430 for non-i386 and non-alpha, or non gcc, implement BREAKPOINT() as raise (5
Mon Aug 21 03:57:46 2000  Tim Janik  <timj@gtk.org>

        * glib.h (G_BREAKPOINT): for non-i386 and non-alpha, or non gcc,
        implement BREAKPOINT() as raise (5 /* SIGTRAP */);

        * glib.h: provide user-definable switch G_IMPLEMENT_INLINES,
        to turn on compilation of inline function implementations provided
        in header files with extern linkage.
        wrap inline function implementations into ifdef __G_UTILS_C__, so we
        really only compile them for gutils.c and not also into arbitrary user
        code that wants to make use of G_IMPLEMENT_INLINES.
        adjusted comment apropriately.

        * gutils.c: to turn on compilation of inline functions, provide
        #define G_IMPLEMENT_INLINES 1 and #define __G_UTILS_C__.
2000-09-07 23:08:25 +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
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
Tor Lillqvist
88fd181eac Implement on Win32.
2000-05-30  Tor Lillqvist  <tml@iki.fi>

* gutils.c (g_locale_get_codeset): Implement on Win32.

* glib.def: Add g_get_codeset.

* tests/Makefile.am (EXTRA_DIST): makefile.cygwin* has been
renamed to makefile.mingw*.
2000-05-30 20:46:03 +00:00
Owen Taylor
e0b5636031 Move the g_locale_get_codeset() up in the header file to correspond to to
Tue May 30 16:01:32 2000  Owen Taylor  <otaylor@redhat.com>

	* glib.h gutils.c: Move the g_locale_get_codeset() up in the
	header file to correspond to to comments about memory
	management. Rename to g_get_codeset() to avoid
	polluting the g_locale_* namespace, which probably
	would have g_locale_get_codeset (GLocale *locale).
	Add a doc comment.
2000-05-30 20:05:23 +00:00
Owen Taylor
466305d0ca Add function to get the codeset name for the current locale.
Mon May 29 14:10:35 2000  Owen Taylor  <otaylor@redhat.com>

	* gutils.c (g_locale_get_codeset): Add function to get the
	codeset name for the current locale.

	* configure.in acconfig.h: Add check for nl_langinfo(CODESET);
2000-05-29 18:48:29 +00:00
Tim Janik
1fe02b28ad added argument assertments.
Fri May 19 11:39:29 2000  Tim Janik  <timj@gtk.org>


        * gutils.c (g_snprintf):
        (g_vsnprintf): added argument assertments.

        * gstring.c (g_string_assign): added argument assertments.
        (g_string_truncate): make len a guint.
2000-05-19 10:01:08 +00:00
Sebastian Wilhelmi
e366512775 Changed the win32 part of this function to be thread safe and to make the
2000-04-19  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* gutils.c (g_getenv): Changed the win32 part of this function to
	be thread safe and to make the returned environment string
	persistent to match the UN*X behavior. This is again a response to
	Bug #8983.

	* glib.h (G_LOCK_NAME): Removed parentheses around the lock name,
	as that seems to cause problems for some compilers and really
	isn't necessary.
2000-04-19 08:43:52 +00:00
Tor Lillqvist
142219f278 Move Win32-only includes after inclusion of glib.h, so that G_OS_WIN32 is
2000-03-22  Tor Lillqvist  <tml@iki.fi>

* gutils.c: Move Win32-only includes after inclusion of glib.h, so
that G_OS_WIN32 is defined.

* glibconfig.h.win32.in: Add GSystemThread.
2000-03-22 20:46:19 +00:00
Sebastian Wilhelmi
837cbbdf8d Ok, Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de> convinced me,
2000-03-22  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* gutils.c (g_get_current_dir): Ok, Marcus Brinkmann
	<Marcus.Brinkmann@ruhr-uni-bochum.de> convinced me, that 128 KB
	path length might not be enough for the HURD. So I changed the
	loop to at least avoid an integer overflow, which could happen at
	beyond 2GB size ;-)
2000-03-22 15:18:11 +00:00
Sebastian Wilhelmi
66034865b1 always define G_GNUC_EXTENSION, even when not needed by GLib. That's
2000-03-21  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* glib.h, configure.in, gutils.h: always define G_GNUC_EXTENSION,
	even when not needed by GLib. That's actually also the way, the
	GLib reference manual describes that macro. Therefore I had to
	remove the lonesome #include <glibconfig.h> in gutils.c, which
	doesn't seem to be needed there however. This change should make
	Ben Gertzfield <che@debian.org> happy.

	* gutils.c: Furthermore two warnings in gutils.c were voided,
	which crept in due to my last change.
2000-03-21 15:21:41 +00:00
Sebastian Wilhelmi
cdb6195572 Allocate only up to 128KB for a pathname. While this is an arbitrary value
2000-03-21  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* gutils.c (g_get_current_dir): Allocate only up to 128KB for a
	pathname. While this is an arbitrary value just like 2048, it
	seems to be enough (after all, even 4GB is an arbitrary value).
2000-03-21 13:46:59 +00:00
Sebastian Wilhelmi
2c4b4788fd Make g_get_current_dir work on systems with unlimited pathname length like
2000-03-20  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* gutils.c (g_get_current_dir): Make g_get_current_dir work on
	systems with unlimited pathname length like the HURD (It worked
	there before, but only for pathes shorter than 2048). Closes
	Bug#4525 as reported by Marcus Brinkmann
	<Marcus.Brinkmann@ruhr-uni-bochum.de>.
2000-03-20 16:01:41 +00:00
Tim Janik
db8baf6978 minor optimization.
Wed Mar  1 10:39:39 2000  Tim Janik  <timj@gtk.org>

        * gslist.c (g_slist_reverse): minor optimization.

        * testglib.c (g_node_test): added a couple of tests for
        g_node_copy().

        * glib.h:
        * gnode.c (g_node_copy): new function to copy subtrees,
        supplied by dbsears@ix.netcom.com.
        changed iterator to walk the children list backwards, so
        we get down from O(n^2) to O(n).

        * gnode.c (g_node_first_sibling): applied patch from
        dbsears@ix.netcom.com to optimize access if node->parent
        is present.

        * gutils.c (g_get_any_init): backed out HAVE_PW_GECOS check around
        assignment of g_real_name, sicne HAVE_PW_GECOS is never defined and
        thus breaks the original code.

        * merged changes from 1.2.7.

Sat Feb 19 19:43:29 2000  Tim Janik  <timj@gtk.org>

        * testgmodule.c (main): added test to check that not yet bound symbols
        in shared libraries of the main module are retrievable, from David Gero.

Fri Jan 28 11:37:41 2000  Owen Taylor  <otaylor@redhat.com>

        Bug #4156 - Changes vaguely modelled after Scott Gifford's patch

        * gtimer.c (g_timer_elapsed): Never report negative times -
        clip times to 0.

        * gmain.c (g_timeout_prepare): Guard against unexpected
        clock shifts by never setting a timeout of more than
        data->interval msecs.
2000-03-01 09:44:10 +00:00
Tor Lillqvist
6c5ec62da2 glib.h Rename Win32-only functions from gwin_* to g_win32_* to match the
1999-11-01  Tor Lillqvist  <tml@iki.fi>

* glib.h
* glib.def: Rename Win32-only functions from gwin_* to g_win32_*
to match the GLib naming conventions.

* gutils.c
* gwin32.c
* testglib.c
* makefile.{cygwin,msc}: Move the Win32-only functions to the new
file gwin32.c
1999-11-01 20:46:44 +00:00
Tor Lillqvist
30cc3ed1fe Don't crash if removing a nonexistent value.
1999-10-31  Tor Lillqvist  <tml@iki.fi>

* gcache.c (g_cache_remove): Don't crash if removing a nonexistent
value.

* gutils.c (gwin_getlocale): New Win32-specific function, returns
a Unixish current locale string (en, zh_TW etc).

* glib.h: Declare it.

* glib.def: Export it.

* testglib.c: Test it.

* gmessages.c (Win32: ensure_stdout_valid): Some improvements,
make sure we don't call AllocConsole several times, which I think
has happened.
1999-10-31 12:15:34 +00:00
Manish Singh
7ea73a0199 G_OS_FOO #defines. I *think* I got the cygwin and beos stuff right, but
I haven't tested it. The respective porters should fix any screwups

-Yosh
1999-10-04 02:32:50 +00:00
Tim Janik
87c7aeb93b 18:36. incorporated proposed cleanups from gtk-devel-list.
Sat Jul 24 20:11:35 1999  Tim Janik  <timj@gtk.org>

        * merged GLib 1.3.0 with glib-1.2.3 from Fri Jul 16 22:18:36.
        * incorporated proposed cleanups from gtk-devel-list.

        * bumped version number to GLib-1.3.1

        * glib.h:
        * gqueue.c:
        * gstring.c:
        * glist.c:
        removed string tokenisation (we got g_strsplit() and g_strjoin()
        already) and readline functions.
        s/g_list_delete/g_list_delete_link.
        implemented g_slist_delete_link.
        removed notion of g_ATEXIT() macro in glib.h, this is an *internal*
        macro, g_atexit() is provided for public consumption.
        added GTrashStack inline utility functions.
        reimplement double eneded queues.
        removed GStack implementation, people can use a queue or a (singly)
        linked list for this task.
        deprecated g_strescape(), we need the SunOS variants here.

        * gdate.c: added DEBUG_MSG() macro to wrap old messages.

        * *.*: CVS merges.

        * upgrade to libtool 1.3.3.
1999-07-24 18:50:58 +00:00
Sebastian Wilhelmi
d610460c22 Added a g_memmove replacement for platforms without memmove, where bcopy
1999-07-01  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* configure.in, acconfig.h, gutils.c: Added a g_memmove
	replacement for platforms without memmove, where bcopy can't
	handle overlapping copies and the corresponding checks, which is
	taken form the PERL Configure routine.

	* glib.h: Updated the commentary about g_memmove to be right and
	more GLib-like.

	* configure.in: Removed test for rand_r, as it isn't used anymore.
1999-07-01 09:30:18 +00:00
Sebastian Wilhelmi
90f6cc9bf2 Completed the thread support in GLib. Thread creation, prioritizing
1999-06-17  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* configure.in, acglib.m4, acconfig.h, glib.h, gthread.c:
	Completed the thread support in GLib. Thread creation,
	prioritizing threads, yielding, joining threads as well as
	reader/writer locks and recursive mutexes are now in place. Please
	test heavily on your platform. It is so far tested on
	Linux/i386/pthreads, Solaris/Sparc/pthreads and
	Solaris/Sparc/solaristhreads.

	* gtimer.c, glib.h: Implement g_usleep (gulong microseconds) for
	thread safe sleeping. (sleep() is not MT-safe at all!)

	* gutils.c: Avoid compiler warning.

	* tests/Makefile.am, tests/thread-test.c: New program to test some
	aspects of the thread implementation.

	* gthread.c, Makefile.am: Renamed from gmutex.c to reflect the
	change of content.

	* configure.in: Purged all appearances of nspr.

	* gthread/gthread-posix.c, gthread-solaris.c: Added the native
	implementations for the GLib's extended thread support.

	* gthread/gthread-nspr.c: Removed for good. NSPR is nothing we
	would want to build upon.

	* gthread/gthread.c: Renamed to gthread-impl.c to avoid
	confusion with ../gthread.c (Formerly known as the file called
	gmutex.c)

	* gthread/testgthread.c: Removed. The new and much extended
        tests are in ../tests/thread-test.c.

	* gthread/Makefile.am: Changed to reflect the changes above.
1999-06-17 15:39:31 +00:00
CDT 1999 Shawn T. Amundson
499c9786d1 Port to BeOS by myself and Richard Offer.
Sat May  8 01:52:29 CDT 1999 Shawn T. Amundson <amundson@gtk.org>

        * configure.in
          gerror.c
          gmain.c
          gstrfuncs.c
          gutils.c
          ltconfig
          ltmain.sh
          gmodule/Makefile.am
          gmodule/gmodule.c
          gmodule/gmoduleconf.h.in
          gmodule/gmodule-beos.c
          gthread/Makefile.am: Port to BeOS by myself and Richard Offer.
1999-05-08 07:40:44 +00:00
Tor Lillqvist
d6c6eb3d92 More editing. Use gcc, not ld to link. On native Win32 use _unlink(). Use
* README.win32: More editing.
	* build-dll: Use gcc, not ld to link.
	* glib.h: On native Win32 use _unlink().
	* gscanner.c: Use corrent NATIVE_WIN32 feature test macro,
	not _MSC_VER.
	* gstring.c: Include <io.h> on Win32 for _read prototype.
	* gutils.c: Remove old IO channel code (was in #if 0).
	* makefile.cygwin: Don't need to link with kernel32 and msvcrt
	explicitly, they are included anyway.
1999-04-25 20:52:42 +00:00
Tor Lillqvist
2aa1277d60 Support added for building using a GNU toolchain on Win32,
i.e. gcc -mno-cygwin on cygwin (a.k.a. mingw32, using egcs-1.1.2).

	* README.win32: Updated.
	* build-dll makefile.cygwin tests/makefile.cygwin: New files.
	* glib.h glib.def glibconfig.h.win32 makefile.msc: Slight updates.
	* gmain.c: No need to include <fcntl.h> and <io.h> on Win32.
	* gmain.c gutils.c testglib.c tests/string-test.c: Test for
	NATIVE_WIN32, not _MSC_VER.
	* gmutex.c: Must declare g_thread_functions_for_glib_use as
	exported (using the GUTILS_C_VAR macro).
	* gutils.c gmodule/libgplugin_[ab].c: LibMain not needed.
	* gmodule/gmoduleconf.h.win32: Need underscore with gcc.
	* gthread/gthread.c: With gcc on Win32, must use memcpy to assign
	value of g_thread_functions_for_glib_use (?).
	* makefile.msc tests/makefile.msc: Cosmetics.
1999-04-24 13:52:51 +00:00
Sebastian Wilhelmi
737d9c6714 use sysconf (_SC_GETPW_R_SIZE_MAX) as the new initinal bufsize for
1999-04-22  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* gutils.c (g_get_any_init): use sysconf (_SC_GETPW_R_SIZE_MAX) as
	the new initinal bufsize for getpwuid_r on systems, that support
	this. Hint from Holger Duerer <H.Duerer@zait.uni-bremen.de>.
1999-04-22 13:16:10 +00:00
Asbjørn Pettersen
0ecd369530 add OS/2 changes 1999-03-06 10:05:32 +00:00
Sebastian Wilhelmi
1ed6997670 Fixed yet another bloody implementation of getpwuid_r. This time for AIX.
1999-03-01  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* gutils.c (g_get_any_init): Fixed yet another bloody
	implementation of getpwuid_r. This time for AIX. Thanks to Olaf
	Dietsche <olaf.dietsche+list.gtk@netcologne.de>. I would like a
	configure test better than that, but have no idea, how to do that
	easily.
1999-03-01 07:55:34 +00:00
CST 1999 Shawn T. Amundson
b9ef2b41db inserted additional note to look for ChangeLog and AUTHORS file for a log
Wed Feb 24 00:08:42 CST 1999 Shawn T. Amundson <amundson@gtk.org>

        * *.[ch]: inserted additional note to look for ChangeLog and
	  AUTHORS file for a log of modifications.
1999-02-24 06:14:27 +00:00
Sebastian Wilhelmi
b37e032581 s/G_LOCK_DECLARE/G_LOCK_DEFINE/ throuhout glib. Added G_LOCK_EXTERN macro
1999-02-10  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* glib.h: s/G_LOCK_DECLARE/G_LOCK_DEFINE/ throuhout glib. Added
	G_LOCK_EXTERN macro to declare a lock externally.
1999-02-10 09:40:46 +00:00
Tim Janik
a8ff1b4fce fixed errernerous code wrt to thread specific error string allocation
Wed Feb 10 07:56:33 1999  Tim Janik  <timj@gtk.org>

        * gmodule.c (g_module_error): fixed errernerous code wrt to thread
        specific error string allocation handling.

Wed Feb 10 06:20:30 1999  Tim Janik  <timj@gtk.org>

        * gmutex.c (g_static_private_set): invoke destroy notifier when
        overwriting values, initialize new array fields with NULL.
        (g_static_private_free_data): do not skip destroy notification for
        data == NULL.

        * gutils.c (g_direct_equal): compare pointer values directly instead
        of just their guint values which is a loosing conversion for
        sizeof(gpointer)==8 systems.
        (g_get_any_init): restructured code so we don't use endless loops like
        while (1), which boil down to an ugly alias for goto.
        strip ,.* from the real name.
1999-02-10 08:06:26 +00:00
Sebastian Wilhelmi
28500009d4 Make the error message in case of a broken thread system a bit more
1999-02-05  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* configure.in: Make the error message in case of a broken thread
	system a bit more informative.

	* gutils.c (g_get_any_init): Changed the error logic again, now
	only leaving the memory doubling loop, when success is reached or
	when the user isn't found or when the buffer is 32k big,
	additionally now getpwuid will be run, if getpwuid_r didn't work
	out properly. A warning is issued however.
1999-02-05 16:41:02 +00:00
Tor Lillqvist
0221263645 Don't call ensure_stdout_valid (which would open an unneeded console
* gmessages.c (g_log_default_handler): (Win32:) Don't call
  ensure_stdout_valid (which would open an unneeded console window)
  if we're calling a logging function.  Define ensure_stdout_valid
  as an empty macro on Unix.

* gutils.c (g_get_any_init): (Win32:) Trust HOME first if defined,
  then try HOMEDRIVE and HOMEPATH.
1999-02-02 01:24:34 +00:00
Sebastian Wilhelmi
9b09f1feed Changed initial bufsize to 64. Should solve some problems out there.
1999-01-29  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* gutils.c (g_get_any_init): Changed initial bufsize to 64. Should
	solve some problems out there.
1999-01-29 08:02:44 +00:00
Sebastian Wilhelmi
def1947e4f Do not use the thread libs, when searching for some functions, as this
1999-01-25  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* configure.in: Do not use the thread libs, when searching for
	some functions, as this might require glib to always be linked
	with the thread libs on some platforms.

	* gutils.c (g_get_any_init): Don't set errno to zero and use it
	only as the error code, if the function returned a value less
	0. It might happen, that the call succeeds, even though the errno
	is set during the call (i.e. it first looks for a passwd file,
	which is not found). Submitted by Michael Natterer
	<mitschel@cs.tu-berlin.de>. BTW: Sorry for all the mess with that
	`getpwuid_r' change, but it had to be done once.
1999-01-25 09:53:17 +00:00
Tim Janik
c5fd4a3dc4 reverted raja's changes, since they leaked a struct passwd contents buffer
Sun Jan 24 10:33:30 1999  Tim Janik  <timj@gtk.org>

        * gutils.c (g_get_any_init): reverted raja's changes, since they leaked
        a struct passwd contents buffer and for the rest mostly substituted a
        while loop with a bunch of gotos.
        restored the getpwuid() code to what we had after my recent clean ups
        ("Sat Jan 23 02:14:28 1999 Tim Janik"), module yosh's recent changes.
        to feature solaris behaviour of directly returning errno, we don't
        modify error anymore if it's > 0 and simply reset errno.
        don't reset g_home_dir for !NATIVE_WIN32 && !NATIVE_WIN32.
1999-01-24 10:32:56 +00:00
Raja R Harinath
96cf177352 Hopefully got the error handling for `getpwuid_r' right. (g_get_any_init)
* gutils.c
        (g_get_any_init) [HAVE_GETPWUID_R && HAVE_GETPWUID_R_POSIX]:
        Hopefully got the error handling for `getpwuid_r' right.
        (g_get_any_init) [HAVE_GETPWUID_R && !HAVE_GETPWUID_R_POSIX]:
        Fix typo (change `pw == NULL' to `pw != NULL').

Please let this be right :-/.
1999-01-24 07:10:18 +00:00
Manish Singh
90ca4040f6 Moved the warning about MT and no getpwuid_r from gutils.c to configure
-Yosh
1999-01-24 04:42:35 +00:00
Raja R Harinath
ff87d4a0b6 (g_get_any_init) [HAVE_GETPWUID_R && HAVE_GETPWUID_R_POSIX]:
Aargh.

`getpwuid_r' error return: GNU libc.info says to look at `errno'.
Solaris 2.5 man page says error code (eg ERANGE) is returned.
1999-01-24 03:32:55 +00:00
Raja R Harinath
c9e92e124e Rewrite not to look at errno' if library call succeeds, since errno' is
* gutils.c (g_get_any_init) [HAVE_GETPWUID_R]:
Rewrite not to look at `errno' if library call succeeds, since
`errno' is not reset to 0.
1999-01-24 03:18:36 +00:00
Tim Janik
63cc3f3cfb cleaned up the errno mess for GETPWUID. we especially don't want to
Sat Jan 23 02:14:28 1999  Tim Janik  <timj@gtk.org>

        * gutils.c (g_get_any_init): cleaned up the errno mess for
        GETPWUID. we especially don't want to g_error() out here!
        the warning for G_THREADS_ENABLED and !HAVE_GETPWUID_R isn't
        gcc related.
        if !HAVE_PWD_H and !NATIVE_WIN32, g_free the home dir before
        resetting it to NULL, why are we doing this anyways?
        reordered code a bit so we always provide defaults (except
        for g_home_dir).
1999-01-23 02:16:11 +00:00
Sebastian Wilhelmi
11ea0ea133 Changed error handling again, as the error is not always set in errno, it
1999-01-21  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* gutils.c (g_get_any_init): Changed error handling again, as the
	error is not always set in errno, it is the return value on some
	systems. What an evil world.
1999-01-21 09:06:28 +00:00
Jeff Garzik
e0015d5a27 jgarzik enthusiastically applies a patch 1999-01-20 21:21:24 +00:00
GMT 1999 Adam D. Moss
e4199bbcaf All gtk apps were broken here on my setup. I changed the error to a
Wed Jan 20 20:48:58 GMT 1999  Adam D. Moss  <adam@gimp.org>

        * gutils.c (g_get_any_init): All gtk apps were broken
        here on my setup.  I changed the error to a warning to at
        least get things limping.
1999-01-20 20:52:42 +00:00
Sebastian Wilhelmi
8c54935c34 Use getpwuid_r with the right signature, if available.
1999-01-20  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* gutils.c (g_get_any_init): Use getpwuid_r with the right
	signature, if available.

	* configure.in, acconfig.h: Test for existance of getpwuid_r and
	its signature.
1999-01-20 15:06:46 +00:00
Tor Lillqvist
f477518c3a Merge in current Win32 version. Almost no Unix code touched.
* README.win32: More text.

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

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

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

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

	* giowin32.c: New file.

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

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

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

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

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

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

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

	* gthread-posix.c: Conditionalize <sys/time.h> inclusion.
1999-01-16 23:46:42 +00:00
Sebastian Wilhelmi
81f8d0bb10 Here we must replace getpwuid by getpwuid_r, but as I do not know how for
1999-01-07  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* gutils.c (g_get_any_init): Here we must replace getpwuid by
	getpwuid_r, but as I do not know how for now, I just made a FIXME
	note ;-)

	* gdate.c (g_date_set_time): localtime --> localtime_r to make it
	thread safe.

	* configure.in: We do not need to check for broken solaris mutex
	intitializer any longer. Provide a macro to show the used thread
	implementation. Not nice, but this is needed until thread support
	is completed here inside glib.

	* gthread/testgthread.c: conditionally compile according to the
	G_THREADS_IMPL_??? macros.
	(test_private_func): use rand_r instead of rand to make it
	thread safe.
1999-01-07 16:17:42 +00:00
Tim Janik
b2e318ff3e version bump to 1.1.8, binary age 0, interface age 0.
Wed Dec 16 03:16:58 1998  Tim Janik  <timj@gtk.org>

        * configure.in: version bump to 1.1.8, binary age 0, interface age 0.

        * glib.h: changed g_lock() to G_LOCK(), g_unlock() to G_UNLOCK() and
        g_trylock() to G_TRYLOCK(), since these are macros that expand to
        nothing with --disable-threads.
        changed G_LOCK_DEFINE() to G_LOCK_DECLARE() and introduced
        G_LOCK_DECLARE_STATIC() to achive the results of static G_LOCK_DECLARE().
        changed semantics of g_thread_supported to g_thread_supported() so it
        can be used as a function like g_module_supported(). the actuall
        definition is still a macro that expands into a variable for
        performance reasons though.
        various indentation and coding style cleanups.

        * configure.in: added --enable-threads that defaults to yes.

        * gmutex.c: changed tests g_thread_supported to g_thread_supported (),
        changed variable settings of g_thread_supported
        to g_threads_got_initialized.

        garray.c:
        gcache.c:
        gdataset.c:
        gdate.c:
        ghash.c:
        glist.c:
        gmain.c:
        gnode.c:
        gslist.c:
        gstring.c:
        gtree.c:
        gutils.c:
        changed s/g_lock/G_LOCK/, s/g_unlock/G_UNLOCK/,
        s/static G_LOCK_DEFINE/G_LOCK_DECLARE_STATIC/.
1998-12-16 05:38:35 +00:00
Owen Taylor
931ea95265 This commit merges the glib-threads branch into the main
branch. See the ChangeLog for details of the changes.

In brief overview:

 - The set of threading functions can be set
 - A default implementation is provided in -lgthread
 - All static data structures are locked using these
   functions if g_thread_init() is called.
1998-12-15 05:28:02 +00:00
Owen Taylor
beab982e3b Merge main loop into head. This probably breaks Win32, until
someone does the necessary updates.

Sat Nov 28 12:53:47 1998  Owen Taylor  <otaylor@redhat.com>

	* Makefile.am configure.in acconfig.h giochannel.c
	  glib.h glist.c gmain.c gutils.c:

        - Revised GIOChannel to provide a generic virtual-function
  	  based interface.
	- Added unix fd-based GIOChannel's
	- Added generic main-loop abstraction
	- Added timeouts and idle functions using main-loop abstraction.
1998-12-02 14:55:27 +00:00