Commit Graph

116 Commits

Author SHA1 Message Date
Jeff Garzik
a6ab9d0a6b merge from HEAD 1999-03-07 01:44:10 +00:00
EST 1999 Jeff Garzik
0d0f178c09 Add checks for alloca, defining G_NATIVE_ALLOCA if present.
Fri Jan 22 13:41:41 EST 1999  Jeff Garzik  <jgarzik@pobox.com>

        * configure.in:
        Add checks for alloca, defining G_NATIVE_ALLOCA if present.

        * galloca.c:
        Import replacement alloca implementation from gettext 0.10.35.
        Begin to convert to using GLib types and functions.

        * glib.h:
        New macros g_alloca, g_alloca_gc, g_alloca_new, to perform
        stack-based memory allocations.

        * tests/Makefile.am, tests/queue-test.c, tests/alloca-test.c:
        New tests for g_alloca_*, GQueue ADT.

        * tests/stack-test.c:
        Fix pointer casts, include config.h, and
        call g_stack_free at end of run.
1999-01-22 19:33:26 +00:00
EST 1999 Jeff Garzik
b5706b2604 Add gqueue.c
Fri Jan 22 11:58:13 EST 1999  Jeff Garzik  <jgarzik@pobox.com>

        * Makefile.am:
        Add gqueue.c

        * glib.h:
        Add GQueue struct and prototypes.
        Remove g_stack_free macro.

        * gqueue.c
        New file.  Implementation of a queue ADT.

        * gstack.c:
        Rename _g_stack_free back to g_stack_free.

        * tests/Makefile.am, tests/stack-test.c:
        New test for GStack objects.
1999-01-22 17:23:13 +00:00
EST 1999 Jeff Garzik
ee3d2a3d4d New stack ADT implementation.
Fri Jan 22 02:06:10 EST 1999  Jeff Garzik  <jgarzik@pobox.com>

        * gstack.c:
        New stack ADT implementation.

        * glib.h:
        Add g_stack function prototypes and macros.
1999-01-22 07:08:35 +00:00
EST 1999 Jeff Garzik
2ae91cff96 New file. Short notes on what has been said in e-mail, plus a couple other
Thu Jan 21 23:55:54 EST 1999  Jeff Garzik  <jgarzik@pobox.com>

        * TODO:
        New file.  Short notes on what has been said in e-mail, plus a
        couple other new items.

        * glib.h, glist.c:
        New function g_list_delete().  Removes a node from the list,
        then frees it.
1999-01-22 05:02:37 +00:00
Tim Janik
8ad2623ded if !defined (G_LOG_DOMAIN) define G_LOG_DOMAIN as ((gchar*) 0) instead of
Sun Jan 17 16:14:03 1999  Tim Janik  <timj@gtk.org>

        * glib.h (g_error): if !defined (G_LOG_DOMAIN) define G_LOG_DOMAIN as
        ((gchar*) 0) instead of ((void*) 0) to silence egcs C++ mode, reported
        by Seth Alves <alves@hungry.com>.
1999-01-17 15:21:28 +00:00
Tim Janik
5c2fb3762f added a define G_HOOK_DEFERRED_DESTROY, to substitute a noop
Sun Jan 17 14:13:52 1999  Tim Janik  <timj@gtk.org>

        * glib.h: added a define G_HOOK_DEFERRED_DESTROY, to substitute a noop
        GHookList.hook_destroy function.

        * ghook.c (g_hook_destroy_link): don't really call hook_destroy if it
        is G_HOOK_DEFERRED_DESTROY. for the case where we invoke hook->destroy()
        we now clean up the hook completely afterwards, i.e. data, func and
        destroy are immediately set to NULL and hook_free can't play with that
        values anymore.

        * gmain.c (g_source_add): set hook_destroy to G_HOOK_DEFERRED_DESTROY,
        instead of using an ugly _noop() hack, this is to avoid an uneccessary
        function invokation. set hook_free to g_source_destroy_func, this way
        we always invoke the destroy notifiers for user_data and source_data
        after execution of dispatch(). thus, g_source_destroy_func() will always
        be called within the main_loop lock (this wasn't really assured
        before), and can release and reaquire the look around destroy notifier
        invokation.
1999-01-17 14:52:20 +00:00
Tim Janik
08425ac4c2 incremented version number to 1.1.13, bin age 0, interface age 0.
Sun Jan 17 05:12:17 1999  Tim Janik  <timj@gtk.org>

        * configure.in: incremented version number to 1.1.13, bin age 0,
        interface age 0.

        * glib.h: added hook_destroy member to struct _GHookList.

        * ghook.c (g_hook_destroy_link): if the hook_list defines a hook_destroy
        function, use that to marshal hook destruction notifiers.

        * gmain.c: removed g_source_free_func and added g_source_destroy_func,
        which marshalls the user_data and source_data destructors of sources
        outside of the main_loop lock.
        removed GIdleData struct since its single member callback can be passed
        as source_data directly.
        added a gboolean return value to all g_source_remove* functions,
        indicating whether the source could be removed, because these functions
        don't issue warnings upon unseccessful removals themselves. this way at
        least the caller gets a chance to warn upon failing removals.
        (g_main_iterate): set in_check_or_prepare around calls to check() or
        prepare().
        (g_main_pending): simply return FALSE if called from within check() or
        prepare().
        (g_main_iteration): issue a warning if called from within check() or
        prepare() and bail out with FALSE.
        (g_main_run): likewise.
        (g_source_remove_by_funcs_user_data): new function to remove sources by
        user data and function table.
        (g_idle_remove_by_data): new function to really remove idles only, since
        g_source_remove_by_user_data would remove timeouts or other sources as
        well.
1999-01-17 04:49:43 +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
Manish Singh
b9dd5bc19c don't use inline for !__GNUC__ case with g_warning, g_error, and g_message
* glib.h: don't use inline for !__GNUC__ case with g_warning,
g_error, and g_message wrappers since some compilers throw
away arguments in this case

-Yosh
1999-01-13 19:30:15 +00:00
Jeff Garzik
b4c62873da alloca and vasprintf go away 1999-01-11 20:24:28 +00:00
Andrew T. Veliath
aaf8f430e0 fix macro to be shorthand of g_array_insert_vals.
* glib.h (g_array_insert_val): fix macro to be shorthand of
	g_array_insert_vals.
1999-01-05 00:33:10 +00:00
Tim Janik
72b139a74d adjusted the g_strdup_a, g_strndup_a and g_strconcat3_a macros so their
Mon Jan  4 14:38:11 1999  Tim Janik  <timj@gtk.org>

        * glib.h: adjusted the g_strdup_a, g_strndup_a and g_strconcat3_a macros
        so their arguments get only evaluated once. changed g_strconcat3_a to
        have the same semantics as g_strconcat, i.e. if a certain argument is
        NULL, the rest of the parameter list is skipped.

        * tests/alloca-test.c: removed #if/#endif G_HAVE_ALLOCA, we need to be
        able to compile on all systems. added test for g_strconcat() semantics.

        * we need a alloca() replacement for !G_HAVE_ALLOCA rsn!
1999-01-04 13:49:05 +00:00
Jeff Garzik
81224ac5ac Added g_alloca, g_new_a, g_new0_a macros. 1999-01-03 00:53:58 +00:00
Jeff Garzik
bbbfe78d70 Handle NULL strings like g_strdup. s/g_strconcat_a/g_strconcat3_a/ to
* glib.h:
        (g_strdup_a, g_strndup_a): Handle NULL strings like g_strdup.
        s/g_strconcat_a/g_strconcat3_a/ to reflect fixed number of args

        * testglib.c:
        Added g_strdup, g_strconcat checks.
        Added str==NULL checks for alloca string macros.
        s/g_strconcat_a/g_strconcat3_a/
1999-01-02 03:05:36 +00:00
Jeff Garzik
58aaa9d32b added g_strndup_a macro
* glib.h: added g_strndup_a macro

        * testglib.c:
        Added tests for new alloca-based string routines.
        Reformatted a couple strings.
1999-01-02 01:51:08 +00:00
Jeff Garzik
0e2f565f14 Added two new alloca-based function macros, g_strdup_a and g_strconcat_a.
* configure.in, glib.h:
        Added two new alloca-based function macros, g_strdup_a and
        g_strconcat_a.  These are stack-based and much faster than
        their g_malloc-based counterparts.  Kudos to Ulrich Drepper
        for help on this one.
1999-01-01 23:35:26 +00:00
Raja R Harinath
3558437281 Define to G[U]INT64_TO_{LE,BE}, not G[U]INT32_TO_{LE,BE}.
* glib.h (G[U]INT64_FROM_{LE,BE}):
Define to G[U]INT64_TO_{LE,BE}, not G[U]INT32_TO_{LE,BE}.

Wonder why it wasn't caught before.
1998-12-30 22:53:37 +00:00
Tim Janik
097c9b1798 there was a reference count race for hooks during invocation loops. since
Mon Dec 21 21:48:29 1998  Tim Janik  <timj@gtk.org>

        * glib.h:
        * gmain.c: there was a reference count race for hooks during invocation
        loops. since all (known) hook loop implementations, do currently start
        out with g_hook_first_valid() and iterate with g_hook_next_valid(),
        g_hook_first_valid() will now return a referenced hook, and
        g_hook_next_valid() will "eat" that, and eventually transfer it to
        the next hook. <sigh> unfortunately this requires g_hook_next_valid()
        to take the hook_list as additional argument.

        * gmain.c (g_main_iterate): adjusted callers of g_hook_next_valid().
1998-12-21 21:43:00 +00:00
Owen Taylor
7f237f6fcd Add #defines defining scale of priorities.
Sat Dec 19 16:56:02 1998  Owen Taylor  <otaylor@redhat.com>

	* glib.h gmain.c (G_PRIORITY_LOW): Add #defines defining
	scale of priorities.
1998-12-19 22:21:39 +00:00
Tim Janik
e0153773a6 fixed up sys/poll.h and sys/types.h inclusions.
Sat Dec 19 04:27:17 1998  Tim Janik  <timj@gtk.org>

        * fixed up sys/poll.h and sys/types.h inclusions.
1998-12-19 03:44:30 +00:00
Tim Janik
c0c488e4ba fixed up gthread includes, cleaned up glibconfig.h a little bit.
Sat Dec 19 03:10:50 1998  Tim Janik  <timj@gtk.org>

        * fixed up gthread includes, cleaned up glibconfig.h a little bit.
1998-12-19 02:13:34 +00:00
Tim Janik
8be41eae4d new function to check whether a main loop has been quitted. (g_main_new):
Fri Dec 18 00:03:17 1998  Tim Janik  <timj@gtk.org>

        * glib.h:
        * gmain.c:
        (g_main_is_running): new function to check whether a main loop has been
        quitted.
        (g_main_new): added a gboolean argument to determine whether the loop
        should be considered initially running or not. however, g_main_run ()
        will still reset the main loops running state to TRUE upon initial
        entrance.

        * gmain.c:
        (g_main_iterate): documented this function's purpose in 5 steps.
        for step 2), flag sources as G_SOURCE_READY even if !dispatch and
        check G_SOURCE_READY prior to (*prepare), so we don't call (*prepare)
        on them multiple times.

Thu Dec 17 23:43:47 1998  Tim Janik  <timj@gtk.org>

        * gmain.c (g_main_add_poll): reordered arguments, so GPollFD* comes
        first, <sigh> (sorry Snorfle, i should have let you know in the first
        place).
        (g_main_dispatch): stack G_HOOK_FLAG_IN_CALL flags. call source's
        destructor when destroying a source.
1998-12-18 02:23:33 +00:00
CST 1998 Shawn T. Amundson
77ccad4d2f giounix.c: s/g_main_poll_add/g_main_remove_add/g
Wed Dec 16 22:32:13 CST 1998 Shawn T. Amundson <amundson@gtk.org>

        * glib.h:
          giounix.c: s/g_main_poll_add/g_main_remove_add/g
                     s/g_main_poll_remove/g_main_remove_poll/g
                     s/g_main_poll_add_unlocking/g_main_add_unlocking_poll/g
          (from Tim Janik)

        * gthread-posix.c: use g_free in mutex_free (from Tim Janik)
1998-12-17 04:36:04 +00:00
Tim Janik
a62ebb0e75 if !G_THREADS_ENABLED, eat the trailing semicolon with a bogus function
Thu Dec 17 04:10:49 1998  Tim Janik  <timj@gtk.org>

        * glib.h (G_LOCK_DECLARE_*): if !G_THREADS_ENABLED, eat the
        trailing semicolon with a bogus function declaration, instead
        of with a bogus variable declarations, so we avoid unused
        variable warnings.
1998-12-17 04:06:27 +00:00
Joel Becker
053793d72a changed func_data to user_data for g_scanner_scope_symbol_foreach() 1998-12-16 14:41:18 +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
05d49ddbd3 Use an "inheritance" scheme for IO channel memory allocation.h
Tue Dec 15 17:17:46 1998  Owen Taylor  <otaylor@redhat.com>

	* glib.h giounix.c giochannel.c: Use an "inheritance"
	scheme for IO channel memory allocation.h
1998-12-15 22:30:15 +00:00
Sebastian Wilhelmi
d98c425676 Dont complain, if --without-threads or --with-threads=none is supplied;
1998-12-15  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* configure.in: Dont complain, if --without-threads or
	--with-threads=none is supplied; Test for pthread_attr_init
	instead of pthread_cond_init, if threads seems to be supported by
	standard glib. (CFLAGS): Use G_THREAD_CFLAGS for compiling of glib
	as well.

	* glib.h, gmutex.c: Changed private to private_key to avoid
	problems when compiling with under C++.
1998-12-15 17:50:47 +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
Havoc Pennington
dca6fcb59c Rely on GDate::dmy and GDate::Julian flags, rather than re-checking the
1998-12-02  Havoc Pennington  <hp@pobox.com>

* gdate.c (g_date_valid): Rely on GDate::dmy and GDate::Julian
flags, rather than re-checking the validity of the actual
values. This should be the correct behavior, the old way was
leftover cruft.

* glib.h, gdate.c: Changed MDY to DMY throughout.
1998-12-02 18:47:10 +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
Sebastian Wilhelmi
c8477277fe changed `gpointer struct_tm_p' parameter of g_date_to_struct_tm back to
1998-12-02  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* glib.h:
	* gdate.c: changed `gpointer struct_tm_p' parameter of
	g_date_to_struct_tm back to `struct tm *tm' and forward declared
	`struct tm' in glib.h; yes, this is nice, we still need not
	include time.h.
1998-12-02 09:07:18 +00:00
Tim Janik
2886be294a s/time_t/GTime/ and s/g_print/g_message/ include time.h.
Wed Dec  2 02:10:59 1998  Tim Janik  <timj@gtk.org>

        * gdate.c: s/time_t/GTime/ and s/g_print/g_message/
        include time.h.

        * glib.h: removed #include <time.h>, changed time_t paramter of
        g_date_set_time() to time_t, changed struct tm parameter of
        g_date_to_struct_tm to `gpointer struct_tm_p'. yes, this is not
        nice, but including time.h actually breaks a bunch of code.
1998-12-02 02:24:14 +00:00
Havoc Pennington
a3e59c3ebf There are outstanding issues, but they should be resolvable in-place. If
this breaks something let me know and I will fix it.

1998-11-30  Havoc Pennington  <hp@pobox.com>

* gdate.c: New file, implements calendrical calculations.

* glib.h: Added declarations for GDate module.
1998-12-01 20:24:32 +00:00
Tim Janik
958f33656a added g_hook_list_marshal_check() to eventually destroy hooks after they
Mon Nov 30 07:12:10 1998  Tim Janik  <timj@gtk.org>

        * glib.h:
        * ghook.c: added g_hook_list_marshal_check() to eventually destroy
        hooks after they got marshalled.
1998-11-30 07:08:54 +00:00
Tim Janik
3a14f25fdf reverted the g_hash_table_set_key_freefunc() addition, since it's to
Thu Nov 26 01:36:20 1998  Tim Janik  <timj@gtk.org>

        * glib.h:
        * ghash.c: reverted the g_hash_table_set_key_freefunc() addition,
        since it's to specialized and needs to be resolved in a generic
        fashion.
1998-11-26 00:42:14 +00:00
PST 1998 Manish Singh
61bdacfb59 applied glib-tml-981120-0, change log appended below.
Tue Nov 24 18:57:59 PST 1998 Manish Singh <yosh@gimp.org>

        * applied glib-tml-981120-0, change log appended below.

        * glibconfig.h.win32: passthrough 64-bit constants unchanged, VC++
        infers them

Fri Nov 20 22:26:43 1998  Tor Lillqvist  <tml@iki.fi>

        * glib.h: Moved MSC pragmas from glib.h to glibconfig.h.win32.
        peer_offset field in WIN32 part of GIOChannel removed, need_wakeups
        added. Added "extern" to __declspec(dllimport).

        * gutils.c: Initialise need_wakeups.

        * glibconfig.h.win32: Pragmas moved here. Define G_GINT64_CONSTANT.

        * gmodule/gmodule.def: Added g_module_build_path.

        * gscanner.c: (g_scanner_cur_value) Move initailisation of v
        to before its use.

        * glib.def: Added g_(s)list_sort.

        * makefile.msc: A few more comments.

-Yosh
1998-11-25 03:02:56 +00:00
EST 1998 Michael K. Johnson
3568d22b53 added GFreeFunc and g_hash_table_set_key_freefunc() prototype. added
Tue Nov 24 14:05:47 EST 1998	Michael K. Johnson <johnsonm@redhat.com>

	* glib.h: added GFreeFunc and g_hash_table_set_key_freefunc()
	prototype.
	* ghash.c: added g_hash_table_set_key_freefunc() implementation.
	Modified the prototypes of the functions g_hash_node_destroy() and
	g_hash_nodes_destroy(), and changed the functions that call them
	to match the new definitions.
	This changes no external interfaces, and should create no binary
	or source incompatibilities.  It does add a member to the
	GHashTable structure.
1998-11-24 19:38:17 +00:00
Tim Janik
9c1692c260 removed the GListAllocator type and its g_*_allocator_*() function
Tue Nov 24 09:40:00 1998  Tim Janik  <timj@gtk.org>

        * glib.h: removed the GListAllocator type and its g_*_allocator_*()
        function variants (which weren't working anyways) in favour of a
        generic GAllocator type. new functions:
        g_allocator_new, g_allocator_free, g_slist_push_allocator,
        g_slist_pop_allocator, g_list_push_allocator, g_list_pop_allocator,
        g_node_push_allocator and g_node_pop_allocator.

        * gstring.c: removed bogus slist allocator code.
        * gtree.c: maintain own list of free tree nodes and don't waste
        GSLists for that, removed bogus slist allocator code.
        * glist.c: use GAllocators for node allocation.
        * gslist.c: use GAllocators for node allocation.
        * gnode.c: use GAllocators for node allocation.

        * gdataset.c: cleanups wrt automatic initialization.
1998-11-24 12:18:22 +00:00
Owen Taylor
eabb208b30 added g_array_insert_vals() to insert elements at an arbitrary index, and
Mon Nov 23 10:03:58 1998  Owen Taylor  <otaylor@gtk.org>

	* glib.h garray.[ch]: added g_array_insert_vals() to
	insert elements at an arbitrary index, and
	g_array_insert_val() macro.
1998-11-23 15:02:44 +00:00
Tim Janik
70a6dbff87 new function g_slist_copy() to duplicate a list with all its data
Sun Nov 22 17:07:03 1998  Tim Janik  <timj@gtk.org>

        * glib.h:
        * gslist.c: new function g_slist_copy() to duplicate a list with all its
        data pointers.
        * glist.c: new function g_list_copy.
1998-11-23 01:52:07 +00:00
Tim Janik
6515316f82 added empty default imlementation so gmodule.so compiles on systems that
Fri Nov 20 14:43:44 1998  Tim Janik  <timj@gtk.org>

        * gmodule.c (_g_module_build_path): added empty default imlementation
        so gmodule.so compiles on systems that are not yet supported, fix from
        Erik Bagfors <bagfors@hpc2n.umu.se>.
1998-11-20 13:49:35 +00:00
Tim Janik
5b0bbc2924 fixed off-by-one error, so we don't waste a loop iteration if (-1) was
Mon Nov 16 07:48:06 1998  Tim Janik  <timj@gtk.org>

        * glib.h (g_bit_nth_msf): fixed off-by-one error, so we don't waste
        a loop iteration if (-1) was passed, reported by Andreas Bombe
        <andreas.bombe@munich.netsurf.de>.
1998-11-16 07:45:10 +00:00
Owen Taylor
be7ab912ee Added g_list_sort() and g_slist_sort() to merge sort GLists and GSLists.
Fri Nov 13 15:17:34 1998  Owen Taylor  <otaylor@redhat.com>

	* glist.c gslist.c glib.h: Added g_list_sort() and
	g_slist_sort() to merge sort GLists and GSLists.
	Submitted by Sven Over <sven.over@ob.kamp.net>
	over a year ago!

	* testglib.c: Test the new sort functions.
1998-11-13 20:50:41 +00:00
Manish Singh
11376df686 use __extension__ for long long on gcc >= 2.8 and egcs, and provide a
* configure.in: use __extension__ for long long on gcc >= 2.8 and
egcs, and provide a G_GINT64_CONSTANT wrapper so -ansi -pedantic
compiles clean.

* glib.h: make the endian x86 asm __const__ so the compiler can do
better optimizations. Also remove the cc clobber, these shouldn't
be changing condition codes. Ditch some redundant casts. Add an
optimization for 64-bit endian conversions in x86. Use constant
wrapper for the generic method.

* testglib.c: use constant wrappers for 64-bit constants

-Yosh
1998-11-11 01:26:10 +00:00
Phil Schwan
59f6876ded Added 'strncasecmp' to the list of functions to be searched for. Added a
1998-11-04  Phil Schwan  <pschwan@cmu.edu>

        * configure.in: Added 'strncasecmp' to the list of functions to be
        searched for.
        * glib.h: Added a prototype for 'g_strncasecmp'
        * strfuncs.c: (g_strncasecmp) new function modeled closely after
        'g_strcasecmp'
1998-11-05 01:36:36 +00:00
Sebastian Wilhelmi
4dbf739ea9 new function for removing an entry from an array while preserving the
1998-11-03  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* glib.h:
	* garray.h:
	(g_array_remove_index): new function for removing an entry from an
	array while preserving the order
	(g_array_remove_index_fast): new function for removing an entry
	from an array. the order might be distorted
	(g_ptr_array_remove_index_fast, g_ptr_array_remove_fast): new
	functions; working similiar to the above. (they have the semantic
	of the old g_ptr_array_remove[_index] functions)
	(g_ptr_array_remove_index, g_ptr_array_remove): new semantic. now
	the order of the elements in the array is not changed
	(g_byte_array_remove_index, g_byte_array_remove_index_fast): new
	functions; byte_array wrapper for g_array_remove_index[_fast]
1998-11-03 14:52:25 +00:00
Manish Singh
840114ac76 glib.h endian macros defined using the glibconfig.h mechanism now
* glib.h
* configure.in: endian macros defined using the glibconfig.h mechanism now

* ghook.c: casts for GHookFunc and GHookCheckFunc to avoid warnings

-Yosh
1998-11-02 07:04:38 +00:00
Manish Singh
7e04691726 applied glib-tml-981101-1 patch from Tor Lillqvist (ChangeLog entry
* applied glib-tml-981101-1 patch from Tor Lillqvist (ChangeLog
entry appended below)

* testglib.c
* gstrfuncs.c
* glib.h: use G_HAVE_GINT64, since HAVE_GINT64 is gone

* gmessages.c
* gscanner.c: #include <config.h> in here too, for HAVE_UNISTD_H

-Yosh
1998-11-01 04:19:54 +00:00