Commit Graph

177 Commits

Author SHA1 Message Date
Havoc Pennington
c38d1dd9e9 #include <gerror.h>
2000-07-12  Havoc Pennington  <hp@redhat.com>

* glib.h: #include <gerror.h>

* Makefile.am (include_HEADERS): Add gerror.h
(libglib_la_SOURCES): Add gbacktrace.c

* gbacktrace.c: Move g_on_error_query() in here (moved on the
server, so history is preserved)

* gerror.h: GError interface

* gerror.c: GError implementation replaces stuff that's now in
gbacktrace.c
2000-07-12 21:06:16 +00:00
Tor Lillqvist
39732afc59 Rename the GUTILS_C_VAR macro to GLIB_VAR.
2000-07-08  Tor Lillqvist  <tml@iki.fi>

* glib.h (GLIB_VAR): Rename the GUTILS_C_VAR macro to GLIB_VAR.

* gunicode.h: Mark the g_utf8_skip array with GLIB_VAR.

* glib.def: Add two missing entry points.
2000-07-08 12:40:09 +00:00
Owen Taylor
8384a1342e Comment g_get_codeset() out of the header file temporarily. (Very similar
Mon Jul  3 17:18:19 2000  Owen Taylor  <otaylor@redhat.com>

	* glib.h: Comment g_get_codeset() out of the header file
	temporarily. (Very similar to g_get_charset(), need
	to resolve the two.)
2000-07-03 21:20:34 +00:00
Owen Taylor
6e47268c14 updated
Thu Jun 29 15:57:28 2000  Owen Taylor  <otaylor@redhat.com>

        * NEWS: updated

	* Makefile.am: added snapcheck target to go along with snapshot

	* gstring.c glib.h (g_string_hash): Add g_string_hash to
	go along with g_string_equal.

Tue Jun 27 12:40:23 EDT 2000  David A. Wheeler <dwheeler@dwheeler.com>

	* glib.h: Added g_string_equal for comparing GStrings;
	changed g_str_equal so it returns gboolean (instead of gint).

	* gstring.c: Modified GString implementation to support embedded
	ASCII NUL ('\0') characters, and implemented g_string_equal.

	* testglib.c tests/string-test.c: Added tests for g_string_equal
	and tests for proper handling of embedded ASCII NUL characters.
2000-06-29 20:09:36 +00:00
Tim Janik
09f8e937f2 define gstring in terms of gchar*. this typedef reflects the type name of
Fri Jun 23 17:20:26 2000  Tim Janik  <timj@gtk.org>

        * glib.h: define gstring in terms of gchar*. this typedef reflects
        the type name of the primitive G_TYPE_STRING in the gobject module.

Sat Jun 24 23:03:04 2000  Tim Janik  <timj@gtk.org>

        * gtype.[hc]: provide G_TYPE_CHAR, G_TYPE_UCHAR, G_TYPE_BOOLEAN,
        G_TYPE_INT, G_TYPE_UINT, G_TYPE_LONG, G_TYPE_ULONG, G_TYPE_FLOAT,
        G_TYPE_DOUBLE and G_TYPE_STRING fundamental types.
        added a GTypeValueTable* pointer to GTypeInfo structure for types
        to implement GValue handling functions.
        GTypeValueTable contains the following members:
          value_init(): initialize a GValue structure.
          value_free(): free GValue structure contents (optional).
          value_copy(): copy one GValue contents to another GValue structure of
          collect_type: varargs collection type for the first variable argument
          to be collected by collect_value().
          collect_value(): variable arguments collection function (optional).
          lcopy_type: varargs collection type for the first variable argument
          to be location copyied by lcopy_value().
          lcopy_value(): variable arguments location copy function (optional).
        g_type_value_table_peek(): new function to retrive the GTypeValueTable*
        for a type node. ValueTables get inherited from parent types, unless
        overridden through the GTypeInfo structure. internally, GTypeValueTable
        support means an added overhead of one pointer per static or used
        dynamic type node.
        g_type_add_class_cache_func(): provide a cache_func/data pair to be
        called  prior to a type nodes last_unref() function, this can be used
        to prevent premature class destruction. multiple installed cache_func()
        will be chained upon last_unref() untill one of them returns TRUE.
        the cache_func()s have to check the type id passed in to figure whether
        they actually wants to cache the class of this type (since any types are
        routed through the cache_func() chain).
        g_type_remove_class_cache_func(): remove a previously installed
        cache_func/data pair. the cache maintained by this function has to be
        clear when calling g_type_remove_class_cache_func() to avoid leaks.
        g_type_class_unref_uncached(): class unref function for cache_func()
        implementations, unreferences a class omitting the cache chain (and
        therefore unref->cache->unref->... loops).

        * gvaluetypes.[hc]: provide the value setters/getters for the primitive
        fundamental types boolean, char, uchar, int, uint, long, ulong, float,
        double and string.

        * gvalue.[hc]: provide G_TYPE_IS_VALUE() in terms of whether a
        GTypeValueTable is provided for this type.
        removed g_value_init_default(), g_value_validate(), g_value_defaults(),
        g_value_set_default() and g_values_cmp() as these are supplied by the
        GParamSpec API now.
        moved g_values_exchange() into the "implementation details" section,
        since it just provides the underlying functionality for
        g_value_convert().

        * gvaluecollector.h: renamed the varargs value container from
        GParamCValue to GTypeCValue as the value collection methods are
        supplied by the type system now.
        G_PARAM_COLLECT_VALUE() and G_PARAM_LCOPY_VALUE() got renamed to
        G_VALUE_COLLECT() and G_VALUE_LCOPY() and operate without a
        GParamSpec structure now.

        * genums.h: macros cleanups/fixes.

        * genum.c: provide G_TYPE_ENUM and G_TYPE_FLAGS type
        and assorted g_value_{s|g}et_{enum|flags}() implementations.

        * gobject.[hc]:
        provide G_IS_VALUE_OBJECT(), G_TYPE_OBJECT ValueTable methods
        and g_value_{s|g}et_object().

        * gparam.[hc]: reduced class to value_set_default(),
        value_validate() and values_cmp(). also parameters now need to fill
        in a GType value_type; field to indicate the GValue type they
        are handling. provide g_param_value_set_default(),
        g_param_value_defaults(), g_param_value_validate() and
        g_param_values_cmp().

        * gparamspecs.[hc]: got rid of the g_value_* functions and
        the G_IS_VALUE_* macros. adapted param spec implementations
        according to the GParamSpecClass changes.
2000-06-24 22:30:10 +00:00
Owen Taylor
0891c64816 Initial pass at adding unicode support functions. A few things still need
Wed Jun 21 12:09:03 2000  Owen Taylor  <otaylor@redhat.com>

	* gunicode.h gutf8.c guniprop.c gunidecomp.[ch] gunichartables.h
	Makefile.am glib.h: Initial pass at adding unicode support
	functions. A few things still need to be implemented, a bit
	of cleanup needs to be done, tests need to be added, and
	the docs need to be finished, but this should allow replacing
	most or all use of libunicode.
2000-06-21 16:11:21 +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
Tor Lillqvist
77866eaf9b makefile.mingw.in tests/makefile.mingw.in Rename makefile.cygwin(.in) to
2000-05-13  Tor Lillqvist  <tml@iki.fi>

* makefile.mingw.in
* tests/makefile.mingw.in
* build-dll: Rename makefile.cygwin(.in) to
makefile.mingw(.in), which better describes what it is. Move the
build of gmodule, gthread and gobject DLLs to makefiles in those
directories. Move resource file handling and build number bump to
build-dll, where it sits much cleaner.

* README.win32
* Makefile.am (EXTRA_DIST): Update accordingly.

* glib.h: Add G_PI, G_PI_2, G_PI_4, G_E, G_LN2, G_LN10 and
G_SQRT2. M_PI etc aren't necessarily in <math.h> in strict ISO C
implementations.

* glib.def: Add g_strcanon.

* gtree.c (g_tree_node_rotate_left): Remove unused variables.

* gwin32.c (g_win32_opendir): Remove unneeded statement.

gmodule:

* makefile.mingw.in: New file, with gmodule stuff
moved from ../makefile.mingw.in.

* Makefile.am: Add to EXTRA_DIST, and add rule to make makefile.mingw.

gobject:
* makefile.mingw.in
* gobject.def
* gobject.rc.in: New files, for Win32 (mingw) build.

* Makefile.am: Add to EXTRA_DIST. Add rules to produce the
corresponding non-*.in files.

* gtype.h: (Win32:) Mark _g_type_fundamental_last for
export/import from DLL.

gthread:
* makefile.mingw.in: New file, with gthread stuff moved from
../makefile.mingw.in.

* Makefile.am: Add to EXTRA_DIST, add rule to build makefile.mingw.
2000-05-13 19:30:58 +00:00
Tim Janik
1df2ec98cb added gobject
Fri Apr 28 23:54:35 2000  Tim Janik  <timj@gtk.org>

        * setup things for a new sub-library libgobject:

        * Makefile.am (SUBDIRS): added gobject

        * glib-config.in: feature -lgobject.

        * configure.in (AC_OUTPUT): generate gobject/Makefile.

        * glib.m4 (AM_PATH_GLIB): feature gobject module.

        * glib.spec.in: added %{prefix}/lib/libgobject-1.3.so.*

Fri Apr 28 21:41:49 2000  Tim Janik  <timj@gtk.org>

        * glib.h: added G_STRLOC macro.
        G_STRUCT_OFFSET(): signedness corrections.
        (G_CSET_DIGITS): list 0-9.
        * gscanner.c (g_scanner_config_template): use G_CSET_DIGITS.

        * glib.h:
        * gstrfuncs.c:
        (g_strdown):
        (g_strup):
        (g_strreverse): return the modified string instead of void, so
        calls to these functions can be nested.
        (g_strcanon): new function, canonicalizes string according to
        a given character set.

Fri Apr 28 19:45:16 2000  Tim Janik  <timj@gtk.org>

        * gasyncqueue.c (g_async_queue_unref): get rid of an unused variable.
2000-05-12 15:23:16 +00:00
Sebastian Wilhelmi
1418fe3a6d New File implementing an asynchronous queue to be used for asynchronous
2000-04-28  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* gasyncqueue.c: New File implementing an asynchronous queue to be
	used for asynchronous inter-thread communication.

	* gthreadpool.c: New File implementing a thread pool to be used
	for distributing work among several threads.

	* glib.h: Added the type and function declarations for these two
	types.

	* tests/threadpool-test.c: New File implementing a test for the
	thread pool. This also checks the asynchronous queue underlying
	the thread pool.

	* tests/Makefile.am: Changed accordingly.
2000-04-28 12:24:53 +00:00
Sebastian Wilhelmi
d5fccfb0eb Changed the 'value' parameter of g_cache_remove from gpointer to
2000-04-26  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* glib.h, gcache.c, gtree.c: Changed the 'value' parameter of
	g_cache_remove from gpointer to gconstpointer. Dito for the 'key'
	parameter of g_tree_lookup and g_tree_remove and the 'data'
	parameter of g_tree_serach. This function now takes a function of
	type GCompareFunc instead of GSearchFunc.

	* glib.h: Removed declaration of GSearchFunc.

	* gmem.c: s/GSearchFunc/GCompareFunc/.
2000-04-26 08:42:19 +00:00
Sebastian Wilhelmi
1383e5b642 Made the debugging G_TRYLOCK call also work for compilers with funnt
2000-04-19  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* glib.h (G_TRYLOCK): Made the debugging G_TRYLOCK call also work
	for compilers with funnt G_STMT_(START|END) macros.

	* tests/thread-test.c: Implemented a check for that.
2000-04-19 09:29:19 +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
Sebastian Wilhelmi
059f5b9416 Changed the 'data' parameters from gpointer to gconstpointer for the
2000-04-18  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* glib.h, glist.h, gslist.h: Changed the 'data' parameters from
	gpointer to gconstpointer for the functions
	g_(list|slist)_(remove|find|find_custom|index), as they do not
	change this parameter. This fixes bug #4836.
2000-04-18 14:01:33 +00:00
Sebastian Wilhelmi
7c467669cc Changed comment for g_getenv to reflect, that the returned memory must not
2000-04-18  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* glib.h: Changed comment for g_getenv to reflect, that the
	returned memory must not be freed. Fixes Bug #8983.
2000-04-18 13:00:35 +00:00
Sebastian Wilhelmi
03f9d485c1 Added g_(array|ptr_array|byte_array)_sized_new functions, that reserve a
2000-04-17  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* garray.c, glib.h: Added g_(array|ptr_array|byte_array)_sized_new
	functions, that reserve a certain amount of memeory for the array
	at creation time to avoid reallocation. Fixes bug #6707 from
	Charles Kerr <ckerr@osserver1.nssl.noaa.gov>.
2000-04-17 10:59:46 +00:00
Sebastian Wilhelmi
8f02fac4ad Renamed g_queue_create to g_queue_new in conformance to all other GLib
2000-04-17  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* glib.h, gqueue.c, tests/queue-test.c (main): Renamed
	g_queue_create to g_queue_new in conformance to all other GLib
	data types.
2000-04-17 10:31:10 +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
5e7134375e Added the missing POSIX_NO_YIELD and POSIX_NO_PRIORITIES warning messages.
2000-03-17  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* configure.in: Added the missing POSIX_NO_YIELD and
	POSIX_NO_PRIORITIES warning messages.

	* configure.in: Use AC_TRY_RUN instead of AC_TRY_LINK, to test for
	real thread support. On solaris pthread_create can be linked to
	even in -lc, but it doesn't work then.

	* configure.in: Don't use priorities for threads, when the
	minimal/maximal priorities couldn't be determined at configure
	time.

	* configure.in, gthread.c: Always define GSystemThread in
	glibconfig.h to represent a system thread.

	* configure.in: Do not use native recursive threads, when
	possibe. We use some features, that they do not expose (namely the
	depth counter).

	* glib.h, gthread.c: Redefined GStaticRecMutex. The functions are
	now implemented in a different way, which should be way
	faster. Alsothere are now functions g_static_rec_mutex_unlock_full
	and g_static_rec_mutex_lock_full to leave/enter a recursive mutex
	completly.

	* gthread.c (g_thread_self): Do not test the system_thread to be
	non-zero to speed things up.

	* gthread.c (g_mutex_init): Therefore set the system_thread of the
	main thread here.

	* tests/thread-test.c: Rerun all tests once again, but this time
	we fool the system into thinking, that the available thread system
	is not native, but userprovided.

	* gthread/gthread-posix.c: Don't use priorities for threads,
	when the minimal/maximal priorities couldn't be determined at
	configure time.

	* gthread/gthread-posix.c: Don't check for errors, when
	setting the scope of a tread to system, as some posix
	implementations can't do that and we don't want the thing to
	fail because of that.
2000-03-17 14:49:59 +00:00
Tor Lillqvist
c35ab34774 New function that returns the message string for a Win32 error code.
2000-03-04  Tor Lillqvist  <tml@iki.fi>

* gwin32.c (g_win32_error_message): New function that returns the
message string for a Win32 error code.

* glib.h: Declare it.

* glib.def: Export it, plus g_node_copy.

* gmodule-win32.c: Call g_win32_error_message() to get the error
message strings.

* libgplugin_a.c
* libgplugin_b.c
* gmodule.c: Remove LibMain functions that were needed by LCC,
which is not a supported compiler.

* testgmodule.c (main): Test for G_MODULE_IMPL ==
G_MODULE_IMPL_WIN32, not G_OS_WIN32.

* gmoduleconf.h.win32: Remove LCC stuff from here, too.
2000-03-01 09:44:10 +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
Havoc Pennington
cf24ff7121 changed g_str_hash() to a 31 bit version based on a submission by Karl
Thu Feb 17 12:53:44 2000  Tim Janik  <timj@gtk.org>

        * gstring.c: changed g_str_hash() to a 31 bit version based on
        a submission by Karl Nelson and hand optimized ad absurdum by
        various people ;)

        * gstring.c: applied patch from havoc for new gstring functions,
        added some more sanity checks, coding style fixups.

2000-02-13  Havoc Pennington  <hp@pobox.com>

        * tests/string-test.c (main): Add tests for the new GString
        features

        * testglib.c (main): Add tests for the new GString features

        * gstring.c (g_string_insert_len): New function; insert
        a given length of string at a given position.
        (g_string_append): reimplement in terms of g_string_insert_len
        (g_string_append_len): new function
        (g_string_insert_c): accept -1 for "pos" arg to mean "append"
        (g_string_append_c): reimplement in terms of g_string_insert_c
        (g_string_prepend): reimplement in terms of g_string_insert_len
        (g_string_prepend_len): new function
        (g_string_prepend_c): reimplement in terms of g_string_insert_c
        (g_string_insert): reimplement in terms of g_string_insert_len

        * glib.h: Declare g_string_insert_len, g_string_append_len,
        g_string_prepend_len
2000-02-17 11:57:35 +00:00
Tim Janik
bbb532d59c return stolen data from g_datalist_id_remove_no_notify() and
Fri Feb  4 19:36:05 2000  Tim Janik  <timj@gtk.org>

        * glib.h:
        * gdataset.c: return stolen data from g_datalist_id_remove_no_notify()
        and g_dataset_id_remove_no_notify() to avoid second lookup for common
        use.
2000-02-03 20:43:00 +00:00
Tor Lillqvist
c22cf34e92 glib.h New functions for conversion between UTF-8 and the encoding
2000-02-01  Tor Lillqvist  <tml@iki.fi>

* glib.h
* gstrfuncs.c (g_filename_to_utf8, g_filename_from_utf8): New
functions for conversion between UTF-8 and the encoding expected
by C runtime functions like open() and stat(), and returned by
readdir().

Implement them on Win32 where we use the system "ANSI" codepage,
which might be single-byte or double-byte. On Unix, just skip the
issue for now and provide dummy implementations that return a copy
of the argument.

* README.win32
* build-dll
* glib.def: Minor updates.
2000-02-02 23:39:32 +00:00
Tim Janik
ce4d6765c9 s/current_time/dispatch_time/ for the dispatch() handlers. refetch the
Wed Jan 26 05:24:38 2000  Tim Janik  <timj@gtk.org>

        * glib.h:
        * gmain.c: s/current_time/dispatch_time/ for the dispatch() handlers.
        refetch the current time after invocation of poll() to cover up for
        the time spent in that function call.
2000-01-26 04:29:06 +00:00
Owen Taylor
948f64a183 Added G_N_ELEMENTS macro to determine the number of elements in an array.
Fri Jan 21 10:18:24 2000  Owen Taylor  <otaylor@redhat.com>

	* glib.h (G_N_ELEMENTS): Added G_N_ELEMENTS macro to determine
	the number of elements in an array.
2000-01-21 15:27:39 +00:00
Sebastian Wilhelmi
c54892b11b This of course should return TRUE in a program with a thread-disabled
1999-11-25  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* glib.h (G_TRYLOCK): This of course should return TRUE in a
	program with a thread-disabled GLib.
1999-11-25 13:47:55 +00:00
Sebastian Wilhelmi
760a7ceef2 Renamed GLIB_SIZEOF_PTHREAD_T to GLIB_SIZEOF_SYSTEM_THREAD to reflect
1999-11-16  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

        * acconfig.h, config.h.win32.in, configure.in: Renamed
        GLIB_SIZEOF_PTHREAD_T to GLIB_SIZEOF_SYSTEM_THREAD to reflect
        changed meaning.

        * configure.in: Cope with systems, that have a pthread_t type,
        that is not a pointer. Hint from Karl Nelson
        <kenelson@ece.ucdavis.edu>. Define GLIB_SIZEOF_SYSTEM_THREAD to 4
        for Solaris. Cope with systems, that have no default mutex
        initialize, like obviously most DCE systems.

        * glib.h, gthread.c: Changed the prototype of thread_create and
        thread_self to return the system thread into provided memory
        instead of a return value. This is necessary, as HPUX has a
        pthread_t, that is bigger than the biggest integral type there.

        * gthread.c: system_thread is no longer a pointer, but an memory
        area of size GLIB_SIZEOF_SYSTEM_THREAD. Changed the
        zeroinitialization and the tests for zeroness accordingly.
1999-11-16 10:30:25 +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
Tim Janik
9a65b20e07 removed useless g_string(x) macro that cluttered the namespace and was
Tue Oct 12 14:17:12 1999  Tim Janik  <timj@gtk.org>

        * glib.h: removed useless g_string(x) macro that cluttered the namespace
        and was just a poor wrapper around the cpp '#' symbol, use #x if you
        need to work around this.
        added new macro G_STRINGIFY(arg) that will convert arg to a string,
        no matter whether it contains macros or not.
1999-10-14 22:04:24 +00:00
Tor Lillqvist
52ad8a9c2a Define the new GLIB_SIZEOF_* constants here, too.
1999-10-12  Tor Lillqvist  <tml@iki.fi>

* config.h.win32.in: Define the new GLIB_SIZEOF_* constants here,
too.

* glib.h: Small Win32 comments improvement.
1999-10-12 20:46:13 +00:00
Tim Janik
30a1e1addb completly new implementation for printf string upper bounds calculation.
Tue Oct 12 12:16:12 1999  Tim Janik  <timj@gtk.org>

        * gmessages.c (g_printf_string_upper_bound): completly new implementation
        for printf string upper bounds calculation.
        we handle all glibc 2.1 format specifiers now, except for positional
        parameters (%nn$...) and wide char strings, plus some obscure upper
        case variants of the standard conversions. this fixes a lot of
        bugs in the old code, i.e.
        - NULL format strings
        - floats with exponents >+24
        - %G
        - precision specifications in general
        - negative field widths
        - %p for SIZEOF_VOID_P > 4 platforms
        we now issue warnigns in places where the old code would have
        caused buffer overruns anyways. warnings are suppressed when invoked
        from glogv(), to avoid infinite recursions if someone passes a log
        message that comes with really obscure format specifications.

Tue Oct 12 11:49:00 1999  Tim Janik  <timj@gtk.org>

        * gstrfuncs.c: nuked old g_printf_string_upper_bound() version.

Tue Oct 12 03:34:40 1999  Tim Janik  <timj@gtk.org>

        * glib.h: added GFloatIEEE754 and GDoubleIEEE754 unions to access sign,
        mantissa and exponent of IEEE floats and doubles (required by the new
        version of g_printf_string_upper_bound). the unions are endian specific,
        we handle G_LITTLE_ENDIAN and G_BIG_ENDIAN as of currently. ieee floats
        and doubles are supported (used for storage) by at least intel, ppc and
        sparc, reference:
        http://twister.ou.edu/workshop.docs/common-tools/numerical_comp_guide/ncg_math.doc.html

Mon Oct 11 18:01:49 1999  Tim Janik  <timj@gtk.org>

        * configure.in: added additional checks to figure sizes of size_t,
        ptrdiff_t and intmax_t (required by g_printf_string_upper_bound).
1999-10-12 12:08:13 +00:00
Tor Lillqvist
374c870b96 Drop the mapping of POSIX function names to the underscored versions, it's
* glib.h: (Win32) Drop the mapping of POSIX function names to the
underscored versions, it's unnecessary after all. With MSVC we get
them from oldnames.lib, with gcc-2.95 and mingw32 from
-lmoldname-msvc. Add comment about what headers to include for
prototypes.
1999-10-05 16:05:38 +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
4944d4df46 define NULL as (0L) if __cplusplus is defined, to avoid "ANSI C++ forbids
Wed Sep 22 01:53:18 1999  Tim Janik  <timj@gtk.org>

        * glib.h (NULL): define NULL as (0L) if __cplusplus is defined, to
        avoid "ANSI C++ forbids implicit conversion from `void *' in argument
        passing" errors upon NULL usage in C++ programs (gcc-2.95 is on crack
        for erroring out on this, instead of just issueing a warning).

        * glib.h (g_trash_stack_pop): use uncasted NULL again.
1999-09-21 23:55:19 +00:00
Tim Janik
2a6f3bd69a add explicit (GTrashStack*) cast for NULL pointer to cure ANSI C++ error.
Thu Sep 16 13:19:54 1999  Tim Janik  <timj@gtk.org>

        * glib.h (g_trash_stack_pop): add explicit (GTrashStack*) cast for NULL
        pointer to cure ANSI C++ error.
1999-09-17 06:03:09 +00:00
Tor Lillqvist
80c44ef391 Add a cast.
* glib.h (g_trash_stack_push): Add a cast.

	* gslist.c
	* glist.c: Make the inline functions static inline, and add
	separate extern wrappers. Not all compilers produce callable entry
	points for inline functions, even if gcc does.
1999-08-17 17:41:01 +00:00
Tim Janik
4e858aebdb removed comma 1999-08-16 03:36:57 +00:00
Tim Janik
9c53053abe eliminate memset() call, since string.h has not neccessarily been included
Sun Aug 15 02:47:14 1999  Tim Janik  <timj@gtk.org>

        * glib.h (g_trash_stack_pop): eliminate memset() call, since string.h
        has not neccessarily been included prior to glib.h.

Mon Aug  2 21:03:10 1999  Tim Janik  <timj@gtk.org>

        * configure.in: added --enable-msg-prefix option.

        * gmessages.c (g_log_default_handler): feature "prg_name (pid:%u): "
        if --enable-msg-prefix was selected (use "(process:%u): " if
        g_get_prgname () returns NULL, along the lines of g_on_error_query).
1999-08-15 00:58:48 +00:00
Tor Lillqvist
1c6c7f7489 glib.h gstrfuncs.c Rename g_strccpy to g_strcompress and g_strecpy to
* glib.h
	* gstrfuncs.c
	* tests/strfunc-test.c: Rename g_strccpy to g_strcompress and
	g_strecpy to g_strescape per Tim Janik's suggestion. Dropped the
	destination parameter, always g_malloc a new string.  Fix bug in
	g_strcompress, octal digits were gobbled up without limit, should
	use max three.

	Sources that use g_strescape must have ifdefs to be compilable
	both with GLib 1.2 and 1.3.
1999-08-02 23:16:32 +00:00
Manish Singh
4877766d0e glib.h the #define for g_strescape interfered with the compilation of the
* glib.h
* gstrfuncs.c: the #define for g_strescape interfered with the
compilation of the function, so just remove the function and
note that it's deprecated in the header

-Yosh
1999-08-01 00:54:14 +00:00
Tor Lillqvist
1146c6fbb3 New functions.
* gstrfuncs.c (g_strccpy, g_strecpy): New functions.

	* glib.h: Declare and document them. Define the deprecated
	g_strescape as a macro that calls g_strecpy.

	* tests/strfunc-test.c (main): Test them.

	* makefile.{cygwin,msc}.in
	* tests/makefile.{cygwin,msc}.in: Remove gstack and its test
	program.

	* glib.def: Additions and removals.

	* README.win32: Improve gcc build instructions.

	* build-dll: Also build import library for MSVC.
1999-07-31 21:45:21 +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
Tor Lillqvist
da87b1ac85 Correct URL for mingw runtime sources.
* README.win32: Correct URL for mingw runtime sources.

	* build-dll: Combine commands with &&.

	* glib.h: Map also rmdir() and hypot() for MSVCRT library.

	* makefile.cygwin.in
	* tests/makefile.cygwin.in: New DLL naming style. GCC-compiled DLLs are
 	now called *.gcc.dll, to avoid binary incompatibilities with
 	MSVC-compiled versions.

	* makefile.msc.in: Cosmetics.
1999-07-12 23:11:27 +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
f80d6cc540 Finally removed the g_random_normal and g_rand_normal functions.
1999-06-30  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* glib.h, grand.c: Finally removed the g_random_normal and
	g_rand_normal functions.
1999-06-30 08:10:01 +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