Commit Graph

50 Commits

Author SHA1 Message Date
Emmanuel Fleury
cf29e37c54 Moving GCopyFunc typedef from glib/gnode.h to glib/gtypes.h 2019-06-25 09:19:49 +02:00
Christoph Reiter
0cf55f4fd9 gtypes: add g-i annotations for G_MININT macros. Fixes #1673
They were changed in 6a2cfde2 to reuse the G_MAXINT values but
parsing nexted macros is currently broken in g-i and results in wrong
values.

Add value annotations for g-i to override the values.

This also moves the annotations to the macro definitions to have
everything g-i uses in one place.
2019-02-01 15:04:57 +01:00
Philip Withnall
6a2cfde29f gtypes: Define signed integer minimum values in terms of maximum values
This is what limits.h does. It avoids a problem when compiling with MSVC
(in C++ mode) on Windows, whereby the 0x80000000 constant is interpreted
as unsigned, and *then* the unary minus is applied to it.

https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-2-c4146?view=vs-2017

Add a test which should hopefully catch problems with different
compilers’ interpretations of this in future.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/glib/issues/1663
2019-01-23 13:23:53 +00:00
Emmanuele Bassi
9e5a53d576 Add reference counting types
We have a common pattern for reference counting in GLib, but we always
implement it with ad hoc code. This is a good chance at trying to
standardise the implementation and make it public, so that other code
using GLib can take advantage of shared behaviour and semantics.

Instead of simply taking an integer variable, we should create type
aliases, to immediately distinguish the reference counting semantics of
the code; we can handle mixing atomic reference counting with a
non-atomic type (and vice versa) by using differently signed values for
the atomic and non-atomic cases.

The gatomicrefcount type is modelled on the Linux kernel refcount_t
type; the grefcount type is added to let single-threaded code bases to
avoid paying the price of atomic memory barriers on reference counting
operations.
2018-06-11 14:59:39 +01:00
Nirbheek Chauhan
e2bd6a6a8f gmacros: Don't define bogus __has_* macros
This pollutes the reserved compiler namespace and breaks applications
trying to do their own feature detection. For instance, this falsely
detects that alloca is not a builtin on gcc:

    #include <glib.h>
    #if defined(__has_builtin)
    # if !__has_builtin(alloca)
    #  error "wtf glib?"
    # endif
    #else
    /* version-checking to determine alloca existence */
    #endif

Instead, define our own g_macro__has_* versions that have the
behaviour that we need.

https://bugzilla.gnome.org/show_bug.cgi?id=794635
2018-03-26 17:12:32 +05:30
Philip Withnall
0e888bdf52 gtypes: Fix signedness of __builtin_bswap() usage
In GUINT64_TO_BE(), for example, when compiling with -Wsign-conversion,
we get a warning due to an implicit cast from (gint64) to (guint64) when
passing the argument to __builtin_bswap64().

According to the GCC documentation, __builtin_bswap64() takes an
unsigned argument:

https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html

Cast the input appropriately.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=788384
2017-10-02 15:31:20 +01:00
Sébastien Wilmet
f9faac7661 glib/: LGPLv2+ -> LGPLv2.1+
All glib/*.{c,h} files have been processed, as well as gtester-report.

12 of those files are not licensed under LGPL:

	gbsearcharray.h
	gconstructor.h
	glibintl.h
	gmirroringtable.h
	gscripttable.h
	gtranslit-data.h
	gunibreak.h
	gunichartables.h
	gunicomp.h
	gunidecomp.h
	valgrind.h
	win_iconv.c

Some of them are generated files, some are licensed under a BSD-style
license and win_iconv.c is in the public domain.

Sub-directories inside glib/:

	deprecated/: processed in a previous commit
	glib-mirroring-tab/: already LGPLv2.1+
	gnulib/: not modified, the code is copied from gnulib
	libcharset/: a copy
	pcre/: a copy
	tests/: processed in a previous commit

https://bugzilla.gnome.org/show_bug.cgi?id=776504
2017-05-24 11:58:19 +02:00
Thiago Macieira
a5f209bc65 Fall back for overflow-checked arithmetic with Intel compiler
The Intel compiler does not have intrinsics like `__builtin_uadd_overflow`.

https://bugzilla.gnome.org/show_bug.cgi?id=769104
2016-07-23 09:27:52 -04:00
Allison Ryan Lortie
ec6971b864 gtypes.h: move G_STATIC_ASSERT to function scope
It seems that some compilers get upset if this is done at global scope,
so let's move it to function scope where we know it works.
2015-11-27 11:27:51 -05:00
Allison Ryan Lortie
d0219f2597 GLib: add bounds-checked unsigned int arithmetic
Add some helpers for builds-checked unsigned integer arithmetic to GLib.
These will be based on compiler intrinsics where they are available,
falling back to standard manual checks otherwise.

The fallback case needs to be implemented as a function (which we do
inline) because we cannot rely on statement expressions.  We also
implement the intrinsics case as an inline in order to avoid people
accidentally writing non-portable code which depends on static
evaluation of the builtin.

For now there is only support for addition and multiplication for guint,
guint64 and gsize.  It may make sense to add support for subtraction or
for the signed equivalents of those types in the future if we find a use
for that.

https://bugzilla.gnome.org/show_bug.cgi?id=503096
2015-10-30 11:58:49 +01:00
Dan Winship
af0a47701d gtypes.h: fix G_MAXUINT64 definition to use G_GUINT64_CONSTANT
(Noticed as part of https://bugzilla.gnome.org/show_bug.cgi?id=756550)
2015-10-23 11:38:31 -04:00
Mikhail Zabaluev
05aafe2cff gtypes.h: Make G_MININTn literals negative
This is more friendly to the GIR scanner; with previous definitions,
the constant values end up out of range for their stated integer type.

https://bugzilla.gnome.org/show_bug.cgi?id=756550
2015-10-15 23:47:04 +03:00
Ryan Lortie
dce88768dc all: remove use of 'register' keyword
We should have done this a decade ago...

https://bugzilla.gnome.org/show_bug.cgi?id=730293
2014-06-28 13:07:52 -04:00
Daniel Mustieles
078dbda148 Updated FSF's address 2014-01-31 14:31:55 +01:00
Stephan Bergmann
255c65f83c gmacros: Ensure GUINT32/64_SWAP_LE_BE macros parenthesize arguments
Like all macros, we need to parenthesize arguments to ensure the order
of operations is correct.

See the mail thread starting at
<http://lists.fedoraproject.org/pipermail/devel/2013-March/180302.html>
"GCC produced wrong code in gvfs-1.14.2-3.fc18.x86_64" for how this
caused trouble with GVFS (which in turn caused trouble with
LibreOffice, where running "soffice sftp://.../.../test.odt" to access
an .odt file via GVFS failed to properly type-detect that file as a
Writer document and produced bogus error messages about the file being
broken).

https://bugzilla.gnome.org/show_bug.cgi?id=695925
2013-03-15 12:51:49 -04:00
Ryan Lortie
b91c476827 Add a new _GLIB_EXTERN macro for "extern"
This macro simply evaluates the "extern" unless it has been explicitly
defined to something else.

All of the version macros (including the unversioned deprecation markers
and GLIB_AVAILABLE_IN_ALL) now include _GLIB_EXTERN as part of their
definition.

G_INLINE has also been modified to use _GLIB_EXTERN where appropriate.

This macro should never be used outside of the gmacros.h/gversonmacros.h
headers.

The effect of this patch is that "extern" has now been added to all
functions declared in installed headers.  Strictly speaking, this is
something we should have had all along...

GLIB_VAR and GOBJECT_VAR have also been modified to use _GLIB_EXTERN on
non-Windows, instead of "extern" which they were using before.  The
eventual goal is to use the normal version/deprecation macros on
exported variables and drop GLIB_VAR but we need to see how this will
work on Windows before we go ahead with that.

https://bugzilla.gnome.org/show_bug.cgi?id=688681
2013-01-13 13:13:36 -05:00
Matthias Clasen
e1b99b2ddc Move single-include guards inside include guards
gcc has optimizations for include guards that only work
if they are outermost in the the header.
https://bugzilla.gnome.org/show_bug.cgi?id=689810
2012-12-27 23:43:14 -05:00
Sebastian Dröge
57878d6042 Use __builtin_bswap* for GUINT*_SWAP_LE_BE if building with GCC
https://bugzilla.gnome.org/show_bug.cgi?id=531901
2012-03-17 23:28:48 -04:00
Emmanuele Bassi
34aeeb7d64 Add flexible API version boundaries
There are cases when it should be possible to define at compile time
what range of functions and types should be used, in order to get,
or restrict, the compiler warnings for deprecated or newly added
types or functions.

For instance, if GLib introduces a deprecation warning on a type in
version 2.32, application code can decide to specify the minimum and
maximum boundary of the used API to be 2.30; when compiling against
a new version of GLib, this would produce the following results:

  - all deprecations introduced prior to 2.32 would emit compiler
    warnings when used by the application code;
  - all deprecations introduced in 2.32 would not emit compiler
    warnings when used by the application code;
  - all new symbols introduced in 2.32 would emit a compiler warning.

Using this scheme it should be possible to have fairly complex
situations, like the following one:

  assuming that an application is compiled with:
    GLIB_VERSION_MIN_REQUIRED = GLIB_VERSION_2_30
    GLIB_VERSION_MAX_ALLOWED  = GLIB_VERSION_2_32

  and a GLib header containing:

    void function_A (void) GLIB_DEPRECATED_IN_2_26;
    void function_B (void) GLIB_DEPRECATED_IN_2_28;
    void function_C (void) GLIB_DEPRECATED_IN_2_30;
    void function_D (void) GLIB_AVAILABLE_IN_2_32;
    void function_E (void) GLIB_AVAILABLE_IN_2_34;

  any application code using the above functions will get the following
  compiler warnings:

    function_A: deprecated symbol warning
    function_B: deprecated symbol warning
    function_C: no warning
    function_D: no warning
    function_E: undefined symbol warning

This means that it should be possible to gradually port code towards
non-deprecated API gradually, on a per-release basis.

https://bugzilla.gnome.org/show_bug.cgi?id=670542
2012-02-26 23:58:41 -05:00
Matthias Clasen
7455dd370e Make single includes mandatory
This has been the official line since 2.17, which seems plenty
long enough for a transition phase.
2011-10-12 00:25:38 -04:00
Matthias Clasen
7648415a50 Move gutils docs inline 2011-06-08 23:44:39 -04:00
Colin Walters
2300be5be3 Consistently use G_GNUC_EXTENSION instead of __extension__
g-ir-scanner doesn't like __extension__, and while I can add it, since
we have this macro, we should be using it consistently.
2011-05-31 10:35:38 -04:00
Ryan Lortie
92df8a1d77 Drop GTimeSpec type 2010-11-02 22:39:09 -04:00
Ryan Lortie
ac82e74895 Add 'GTimeSpec' as 'struct timespec' equivalent 2010-10-27 09:22:12 -04:00
Ryan Lortie
74a970f754 Add byteswap macros for gsize/gssize. 2009-11-30 19:53:30 -05:00
Stefan Kost
2026c232b3 goption: move docs from tmpl folder to inline comments 2009-04-21 16:35:26 +03:00
Matthias Clasen
57d48592db Properly include gmacros.h
svn path=/trunk/; revision=7575
2008-10-07 18:52:18 +00:00
Tor Lillqvist
81481e8436 Cosmetics.
svn path=/trunk/; revision=7307
2008-08-04 18:48:01 +00:00
Michael Natterer
e0aa9d8a61 #define __GLIB_H_INSIDE__ around including everything.
2008-05-05  Michael Natterer  <mitch@imendio.com>

	* glib/glib.h: #define __GLIB_H_INSIDE__ around including
	everything.

	* glib/*.h: check for that define instead of __G_LIB_H__ if
	G_DISABLE_SINGLE_INCLUDES is defined.

	* glib/gdatasetprivate.h: #include <glib.h> instead of
	<glib/gdataset.h>


svn path=/trunk/; revision=6875
2008-05-05 15:02:15 +00:00
Michael Natterer
f4bb21aa1d make it possible to disable single-file includes by defining
2008-03-14  Michael Natterer  <mitch@imendio.com>

	* glib/*.h: make it possible to disable single-file includes by
	defining G_DISABLE_SINGLE_INCLUDES when building against GLib.
	Approved by Tim Janik.

	* glib/glib.h: include <glib/gslice.h>.

	* glib/gi18n.h
	* glib/gi18n-lib.h
	* glib/gprintf.h: include <glib.h> so the above works when these
	files are included without including <glib.h> first.


svn path=/trunk/; revision=6713
2008-03-14 19:30:38 +00:00
Tor Lillqvist
b91d083561 Add -I$(top_srcdir)/glib so that gregex.h finds <glib.h>.
2007-03-15  Tor Lillqvist  <tml@novell.com>

	* glib/gnulib/Makefile.am (INCLUDES): Add -I$(top_srcdir)/glib so
	that gregex.h finds <glib.h>.

	* glib/update-pcre/Makefille.am-1: Add -DGLIB_COMPILATION so that
	we don't think g_ascii_table is dllimport.

	* glib/pcre/Makefile.am: Corresponding change.

	* glib/update-pcre/notdll.patch: New file. Drop
	dllimport/dllexport magic for the pcre symbols.

	* glib/update-pcre/Makefile.am: Dist it.

	* glib/update-pcre/update.sh: Apply notdll.patch.

	* glib/pcre/pcre.h: Corresponding change.

2007-03-15  Tor Lillqvist  <tml@novell.com>

	* glib/gtypes.h: Add comment to avoid misleading people with the
	large number of digits in G_PI etc. (#404338)


svn path=/trunk/; revision=5410
2007-03-15 15:17:17 +00:00
Stepan Kasal
d923d1f03f (G_MININT64): Cast to gint64. 2005-08-24 14:14:02 +00:00
Anders Carlsson
247843302a Move GTranslateFunc to gtypes.h
2004-08-03  Anders Carlsson  <andersca@gnome.org>

	* glib/goption.h:
	* glib/gtypes.h:
	Move GTranslateFunc to gtypes.h
2004-08-02 22:24:17 +00:00
Matthias Clasen
c9d97c2e2a Use higher precision for the mathematical constants. (#141941, Morten
Wed Jun  2 00:57:16 2004  Matthias Clasen  <maclas@gmx.de>

	* glib/gtypes.h: Use higher precision for the mathematical
	constants.  (#141941, Morten Welinder)
2004-06-02 04:58:24 +00:00
Manish Singh
919df0b3bf check for __pentium4__ when deciding whether to use bswap for
Sun May  2 03:51:59 2004  Manish Singh  <yosh@gimp.org>

        * glib/gtypes.h: check for __pentium4__ when deciding whether to
        use bswap for GUINT32_SWAP_LE_BE_IA32(). Fixes bug #141620.
2004-05-02 10:55:08 +00:00
Matthias Clasen
04c96e8fa3 Fix for #103710, Mark Jones:
Tue Dec  2 02:29:41 2003  Matthias Clasen  <maclas@gmx.de>

	Fix for #103710, Mark Jones:

	* glib/gtypes.h (G_MAXINT64): Define G_{MIN,MAX,MAXU}INT{8,16,32,64}.
	* configure.in: Don't put G_{MIN,MAX,MAXU}INT64 in glibconfig.h.
2003-12-02 01:31:43 +00:00
Matthias Clasen
7802271bf0 Fix a bunch of typos in header comments. (#102422, Morten Welinder)
2003-02-06  Matthias Clasen  <maclas@gmx.de>

	* glib/gmessages.h:
	* glib/gmem.h:
	* glib/ghash.h:
	* glib/gasyncqueue.h:
	* glib/garray.h:
	* glib/ghook.h:
	* glib/gtypes.h: Fix a bunch of typos in header comments.
	(#102422, Morten Welinder)
2003-02-06 19:57:14 +00:00
Manish Singh
ad427fd806 new endian asm for ia64 and x86_64, general reorg and clean up. New
Wed Dec 18 16:19:08 2002  Manish Singh  <yosh@gimp.org>

        * glib/gtypes.h: new endian asm for ia64 and x86_64, general
        reorg and clean up. New implementation of GUINT16_SWAP_LE_BE_CONSTANT()
        that should optimize better. (#101318)
2002-12-19 00:20:03 +00:00
Owen Taylor
a95ec87a93 Remove __const__ qualifier from __asm__ statements... GCC since at least
Mon Mar 25 18:13:06 2002  Owen Taylor  <otaylor@redhat.com>

        * glib/gtypes.h (GUINT*_SWAP_LE_BE_X86): Remove __const__
        qualifier from __asm__ statements... GCC since at least
        2.96 has assumed no side effects automaticaly, and gcc-3.1
        will warn about this usage. (#73308, Cody Russell)
2002-03-25 23:18:13 +00:00
Joshua N Pritikin
dbf99df7e3 Remove G_HAVE_GINT64 conditionalization.
* glib/gmessages.c glib/gtypes.h: Remove G_HAVE_GINT64
conditionalization.
2001-10-11 03:06:49 +00:00
Sebastian Wilhelmi
f96f290c63 Use G_GNUC_EXTENSION instead of __extension__. Patch from Pavel Roskin
2001-07-27  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* glib/gtypes.h: Use G_GNUC_EXTENSION instead of
	__extension__. Patch from Pavel Roskin <proski@gnu.org>.
2001-07-27 10:46:13 +00:00
Tim Janik
45fb71949a removed archaic gpointer derived_data; relict and added a GData member
Wed Mar 14 18:46:54 2001  Tim Janik  <timj@gtk.org>

        * gscanner.[hc]: removed archaic gpointer derived_data; relict and
        added a GData member instead.

        * glist.[hc]: added g_list_remove_all().

        * gslist.[hc]: added g_slist_remove_all().

Sat Mar 17 23:18:36 2001  Tim Janik  <timj@gtk.org>

        * gobject.c (g_object_get_property): minor bug-fix.

        * gbsearcharray.[hc]: provide a macro for static initialization and
        functions g_bsearch_array_new() and g_bsearch_array_destroy() for
        dynamic allocations.

        * gboxed.c: introduce G_TYPE_GSTRING, boxed type for GString.

        * gclosure.[hc]: naming corrections.

Fri Mar  9 16:42:08 2001  Tim Janik  <timj@gtk.org>

        * gvaluetypes.[hc]: moved g_strdup_value_contents() into this file as
        a public function (was static in gobject.c before). it's a bit odd
        to have that function here, especially since it requires extra includes,
        but then it doesn't very well fit somewhere else either.

        * gparamspecs.c: added default/max/min checks to param spec creation
        functions.
2001-03-18 04:44:38 +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
Tim Janik
37e4b8c87e changed prototype of g_boxed_type_register_static() to contain an optional
Wed Mar  7 09:36:33 2001  Tim Janik  <timj@gtk.org>

	* gboxed.[hc]: changed prototype of g_boxed_type_register_static()
	to contain an optional init function and a hint at whether the
	boxed structure uses ref counting internally.
	added g_value_set_boxed_take_ownership().
	made G_TYPE_BOXED an abstract value type.

	* genums.[hc]: made G_TYPE_ENUM and G_TYPE_FLAGS abstract value
	types.

	* glib-genmarshal.c: argument type changes, preparation for third-party
	arg specification.

	* gobject.[hc]: cleaned up get/set property code.
	added g_strdup_value_contents() to improve warnings.

	* gparam.[hc]: added g_param_value_convert(), taking over responsibility
	of the old g_value_convert(). added G_PARAM_LAX_VALIDATION flag so
	validation alterations may be valid a part of the property setting
	process.

	* gparamspecs.[hc]: made value comparisons stable (for sort applications).
	added GParamSpecValueArray, a param spec for value arrays and
	GParamSpecClosure. nuked the value exchange functions and
	GParamSpecCCallback.

	* gtype.[hc]: catch unintialized usages of the type system with
	g_return_val_if_uninitialized(). introduced G_TYPE_FLAG_VALUE_ABSTRACT
	to flag types that introduce a value table, but can't be used for
	g_value_init(). cleaned up reserved type ids.

	* gvalue.[hc]: code cleanups and saner checking.
	nuked the value exchange API. implemented value transformations, we
	can't really "convert" values, rather transforms are an anylogy to
	C casts, real conversions need a param spec for validation, which is
	why g_param_value_convert() does real conversions now.

	* gvaluearray.[hc]: new files that implement a GValueArray, a struct
	that can hold inhomogeneous arrays of value (to that extend that it
	also allowes undefined values, i.e. G_VALUE_TYPE(value)==0).
	this is exposed to the type system as a boxed type.

	* gvaluetransform.c: new file implementing most of the former value
	exchange functions as single-sided transformations.

	* gvaluetypes.[hc]: nuked G_TYPE_CCALLBACK, added
	g_value_set_string_take_ownership().

	* *.h: s/G_IS_VALUE_/G_VALUE_HOLDS_/.

	* *.[hc]: many fixes and cleanups.

	* many warning improvements.

Tue Feb 27 18:35:15 2001  Tim Janik  <timj@gtk.org>

	* gobject.c (g_object_get_valist): urg, pass G_VALUE_NOCOPY_CONTENTS
	into G_VALUE_LCOPY(), this needs proper documenting.

	* gparam.c: fixed G_PARAM_USER_MASK.

	* gtype.c (type_data_make_W):
	(type_data_last_unref_Wm): fixed invalid memory freeing.

	* gobject.c (g_object_last_unref): destroy signal handlers associated
	with object, right before finalization.

	* gsignal.c (g_signal_parse_name): catch destroyed nodes or signals
	that don't actually support details.

	* gobject.[hc]: got rid of property trailers. nuked GObject
	properties "data" and the "signal" variants.
	(g_object_connect): new convenience function to do multiple
	signal connections at once.
	(g_object_disconnect): likewise, for disconnections.

	* gparam.[hc] (g_param_spec_pool_lookup): took out trailer support.

	* gvalue.[hc]: marked g_value_fits_pointer() and g_value_peek_pointer()
	as private (the latter got renamed from g_value_get_as_pointer()).

Wed Mar  7 09:32:06 2001  Tim Janik  <timj@gtk.org>

        * glib-object.h: add gvaluearray.h.

        * gstring.[hc]: fixup naming of g_string_sprint*.

        * gtypes.h: fixed GCompareDataFunc naming.

Wed Mar  7 09:33:27 2001  Tim Janik  <timj@gtk.org>

        * gobject/Makefile.am: shuffled rules to avoid excessive
        rebuilds.

        * gobject/gobject-sections.txt: updates.

        * gobject/tmpl/*: bunch of updates, added another patch
        from Eric Lemings <eric.b.lemings@lmco.com>.
2001-03-07 14:46:45 +00:00
Tor Lillqvist
aed994f714 gtypes.h Move GLIB_VAR definition from gutils.h to gtypes.h
2001-02-10  Tor Lillqvist  <tml@iki.fi>

	* gtypes.h
	* gutils.h: Move GLIB_VAR definition from gutils.h to gtypes.h

	* glib.def
	* gmem.h: Mark glib_mem_profiler_table for export.
2001-02-10 01:43:25 +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
Jonathan Blandford
2645aaf59c Patch from David Benson <daveb@idealab.com> to add user_data support to
Mon Nov 20 18:55:17 2000  Jonathan Blandford  <jrb@redhat.com>

	* gtree.[hc]: Patch from David Benson <daveb@idealab.com> to add
	user_data support to gtree functions.

Mon Nov 13 18:35:52 2000  Jonathan Blandford  <jrb@redhat.com>

	* gtypes.h (GCompareFuncData): new func type to let you use user
	data when comparing nodes.

	* gslist.c (g_list_sort_with_data): new function to sort with
	user_data.

	* glist.c (g_list_sort_with_data): new function to sort with
	user_data.

	* garray.[ch]: Added convenience functions to sort arrays.
2000-11-20 23:59:32 +00:00
Sebastian Wilhelmi
267b681370 Introduced new function type GEqualFunc to return TRUE for equal params.
2000-10-30  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* gcache.h, gcache.c, ghash.h, ghash.c, grel.c, grel.h, gtypes.h:
	Introduced new function type GEqualFunc to return TRUE for equal
	params. This is now used instead of GCompareFunc (which should
	work akin to strcmp) here. This kind of fixes Bug #14412. Note
	that technically GCompareFunc and GEqualFunc are still the same
	types, as gint == gboolean.

	* ghash.h, gutils.c: g_int_equal and g_direct_equal now return
	gboolean to be really become GEqualFunc.

	* gscanner.c, testglib.c, tests/hash-test.c: Some tiny changes to
	follow the above change.
2000-10-30 14:34:52 +00:00
Sebastian Wilhelmi
24b4bfbea1 Readded GFreeFunc, g_node_insert_after and g_find_program_in_path resp.,
2000-10-13  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* gtypes.h, gnode.h, gutils.h: Readded GFreeFunc,
	g_node_insert_after and g_find_program_in_path resp., which
	mysteriously disappeared during the glib.h dissection.
2000-10-13 08:16:54 +00:00
Sebastian Wilhelmi
b1d1558747 Split glib.h into many header files mostly according to the resp.
2000-10-12  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
	gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
	ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
	gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
	grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
	gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
	into many header files mostly according to the resp. *.c-files.

	* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
	of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
	__END_DECLS.

	* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
	gunicode.h, : Changed guard-macro names to something more
	consistent.

	* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 11:52:07 +00:00