summaryrefslogtreecommitdiff
path: root/testglib.c
AgeCommit message (Collapse)AuthorFilesLines
1999-02-24inserted additional note to look for ChangeLog and AUTHORS file for a logCST 1999 Shawn T. Amundson1-0/+8
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-01-24- Fixed bug that overwrote nodes in hash buckets instead of adding them toJeff Garzik1-1/+1
Sat Jan 23 22:45:59 1999 Jeff Garzik <jgarzik@pobox.com> * ghash.c (g_hash_table_lookup_node, g_hash_table_lookup, g_hash_table_insert, g_hash_table_remove, g_hash_table_lookup_extended): - Fixed bug that overwrote nodes in hash buckets instead of adding them to the hash bucket node list. Hash tables now work as advertised. (g_hash_table_resize): - Use g_new0 instead of manual init. - Space out code a bit for readability. (g_hash_nodes_destroy): - Replaced "if (!hash_node) return;" with "if (hash_node) {do stuff}". Testing takes up less code space than explicit call to 'return' before end of function. (look at gcc -S) Updated module header copyright to 1999. New module macro G_HASH_BUCKET for (table,key)->bucket lookups. * tests/hash-test.c: - Add two new tests, one with strings as the keys and values, and one with ints as the keys and values. Tests indirect (strings) and direct (ints) hashing. - Cleanup unused junk left over from testglib.c. - Converted a g_print call to g_assert_not_reached. - Updated copyright to 1999. * testglib.c, tests/string-test.c: - Init 'tmp_string' var to NULL, silencing uninit-var warning.
1999-01-23cleaned up the errno mess for GETPWUID. we especially don't want toTim Janik1-0/+4
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-13acinclude.m4 ltconfig upgrade to libtool 1.2d (with fixes for irix6 andManish Singh1-6/+0
* acinclude.m4 * ltconfig * ltmain.sh: upgrade to libtool 1.2d (with fixes for irix6 and osf) * testglib.c: removed unused cruft -Yosh
1999-01-11alloca and vasprintf go awayJeff Garzik1-52/+0
1999-01-09Make all aux functions static.Jeff Garzik1-10/+10
* testglib.c: Make all aux functions static. * tests/Makefile.am, tests/dirname-test.c, tests/type-test.c: New tests dirname-test and type-test, from testglib.
1999-01-03Added g_alloca, g_new_a, g_new0_a macros.Jeff Garzik1-0/+34
1999-01-02Added g_strdup_printf checkJeff Garzik1-0/+8
1999-01-02Handle NULL strings like g_strdup. s/g_strconcat_a/g_strconcat3_a/ toJeff Garzik1-1/+28
* 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-02made the alloca tests follow the testglib styleManish Singh1-5/+7
* testglib.c: made the alloca tests follow the testglib style * Makefile.am: minor cleanups, mostly cosmetic -Yosh
1999-01-02added g_strndup_a macroJeff Garzik1-2/+24
* glib.h: added g_strndup_a macro * testglib.c: Added tests for new alloca-based string routines. Reformatted a couple strings.
1998-11-13Added g_list_sort() and g_slist_sort() to merge sort GLists and GSLists.Owen Taylor1-0/+40
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-11use __extension__ for long long on gcc >= 2.8 and egcs, and provide aManish Singh1-1/+2
* 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-01applied glib-tml-981101-1 patch from Tor Lillqvist (ChangeLog entryManish Singh1-4/+4
* 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-10-27reimplemented the endian stuff, using inline asm for x86. #define g_htonlManish Singh1-0/+18
* glib.h: reimplemented the endian stuff, using inline asm for x86. #define g_htonl and friends. * testglib.c: new tests for the endian stuff * configure.in: care for AIX in gmodule linker flags test (from Joel Becker <jlbec@raleigh.ibm.com>). Check $host_os for linux instead of existance of /usr/include/linux * gutils.c: buh-bye evil warning. Thou hast been #ifdef'd out of thine existance! -Yosh
1998-10-27removed dummy structure definitions for struct _GCache, _GTree, _GTimer,Tor Lillqvist1-2/+51
Tue Oct 27 03:00:50 1998 Tim Janik <timj@gtk.org> * glib.h: removed dummy structure definitions for struct _GCache, _GTree, _GTimer, _GMemChunk, _GListAllocator and _GStringChunk. * gutils.c: implement glib's inline functions _after_ all include statements have been processed. removed Tor's MAXPATHLEN check since there already was one supplied further down in this file. (LibMain): special cased the #ifdef __LCC__ case for NATIVE_WIN32, since lcc maybe used on other platforms as well. why in hell is this stuff required? (g_get_any_init): for windows, if the user name is supplied, use it as realname also. in general, if there is no homedir specified, use the tmpdir that we already figured. * gtimer.c (g_timer_elapsed): changed a g_assert() statement to g_return_if_fail(). * applied glib-tml-981020-0.patch for WIN32 portability, added some comments and g_return_if_fail() statements, minor indentation fixes. ChangeLog entry from Tor Lillqvist is appended. * glib.h (struct dirent): use lower case structure members. * glib.h: * makefile.lcc: * makefile.msc: s/COMPILING_GLIB/GLIB_COMPILATION/ 1998-10-20: Tor Lillqvist <tml@iki.fi> * README.win32 glib.def gmodule.def * glibconfig.h.win32 gmodule/gmoduleconf.h.win32: New files for the Windows port. The .def files list exported symbols for the Microsoft linker and compatibles. * configure.in: Added checks for some platform-dependent headers: pwd.h sys/param.h sys/select.h sys/time.h sys/times.h unistd.h, and the function lstat. * gerror.c: Conditionalized inclusion of system-dependent headers. Changes for Windows: no gdb to do a stack trace. Just call abort(). * glib.h: Changes for Windows: Added macros G_DIR_SEPARATOR, G_DIR_SEPARATOR_S for platform-dependent file name syntax elements. Added macros G_SEARCHPATH_SEPARATOR, G_SEARCHPATH_SEPARATOR_S for platform-dependent search path syntax conventions. Added pragmas for Microsoft C to make it more pedantic. Marked GLib's global variables for export from DLL. Added the function g_strescape that escapes backslashes. Added functions g_path_is_absolute and g_path_skip_root to handle platform-dependent file name syntax. Added the function g_getenv that expands environment variables that contain references to other environment variables, as is typical on Windows NT. Added the GIOChannel structure which is used to encapsulate the IPC mechanism used by the GIMP's plug-ins, and possibly other things later. On Unix a GIOChannel encapsulates just a file descriptor. On Windows it contains a file handle from _pipe() and a few other things related to the implementation of gdk_input_add and GIMP plug-in communication. Subject to change. Removed duplicate declarations of the version variables. For the Microsoft compiler, declare own implementation of ftruncate and the <dirent.h> functions. * gmem.c: Define a symbolic name for the profiling table size. * gmessages.c: Conditionalized inclusion of unistd.h. On Windows, output using stdio to stdout. * gscanner.c: Conditionalized inclusion of unistd.h. Added changes for Microsoft C. Added CR to the skipped character set. Added small workaround for MSC compiler bug in g_scanner_cur_value. * gstrfuncs.c: Added the function g_strescape, which escapes the backslash character. Needed especially when printing Windows filenames. * gtimer.c: Conditionalized inclusion of unistd.h and sys/time.h. Added implementations for Windows. * gutils.c: Conditionalized inclusion of platform-dependent headers. Use the platform-independent file name syntax macros. Conditionalize code on platform-dependent features. Added the functions g_path_is_absolute g_path_skip_root and g_getenv. Added the GIOChannel-related functions. Added compiler-dependent Unix compatibility functions for Windows. * makefile.lcc makefile.msc: New files. Compiler-specific makefiles for LCC-Win32 and Microsoft C. Only Microsoft C is actually supported currently. * testglib.c: Added pathname check cases for Windows. Added workaround for bug in the Microsoft runtime library. Improved some tests a bit. Tue Oct 27 04:00:11 1998 Tim Janik <timj@gtk.org> * testgmodule.c (main): changed the #ifdef WIN32 test to NATIVE_WIN32, this needs to be more constistent throughout the code, do we go for NATIVE_WIN32 or WIN32? * gmodule.c (LibMain): special cased the #ifdef __LCC__ case for NATIVE_WIN32, since lcc maybe used on other platforms as well. * libgplugin_a.c (LibMain): * libgplugin_b.c (LibMain): likewise. not sure i like this special requirement for lcc in here. * gmodule-dl.c (_g_module_build_path): feature empty "" directories and prepend the module name with "lib". * gmodule-dld.c (_g_module_build_path): * gmodule-win32.c (_g_module_build_path): feature empty "" directories. * we need some more magic in the _g_module_build_path variants so we don't append/prepend lib and .so, .sl or .dll for those names that already contain it. * applied patch from Tor Lillqvist for g_module_build_path() and windows support. 1998-10-20: Tor Lillqvist <tml@iki.fi> * gmodule/gmodule-win32.c: New file. * gmodule/gmodule.c gmodule/gmodule.h: Added the funcion g_module_build_path that builds the path to a module file, decorating the name according to the system's conventions. Added the Windows implementation. * gmodule/libgplugin_a.c gmodule/libgplugin_b.c: Added LibMain for LCC-Win32. * gmodule/testgmodule.c: Handle Windows dll names.
1998-09-20This is Josh, commiting as Manish. This is completely new, andManish Singh1-0/+37
nothing will break. * glib.h: New function g_hash_table_foreach_remove is similar to g_hash_table_foreach, but the callback's return value indicates whether to remove the element (if TRUE) or not (if FALSE).
1998-09-07check for all three inline keywords individually.Tim Janik1-1/+1
Mon Sep 7 07:53:21 1998 Tim Janik <timj@gtk.org> * configure.in: check for all three inline keywords individually. * glib.h: inlining hassle. for compilers that don't allow the `inline' keyword, mostly because of strict ANSI C compliance or dumbness, we try to fall back to either `__inline__' or `__inline'. we define G_CAN_INLINE, if the compiler seems to be actually *capable* to do function inlining, in which case inline function bodys do make sense. we also define G_INLINE_FUNC to properly export the function prototypes if no inlinig can be performed. we special case most of the stuff, so inline functions can have a normal implementation by defining G_INLINE_FUNC to extern and G_CAN_INLINE to 1. * ltconfig: (compiler PIC flag test): special case linux for non aout systems to honour lcc's position independant code (cases "linux*aout)" and "linux*)" got added). (this needs to go into libtool which does an advanced test, checking for __LCC__). * autogen.sh: take $CC=lcc into account by invoking automake with --include-deps so lcc isn't scared by gcc's auto-dependancy generation code. care about $ACLOCAL_FLAGS. optionally feature autoheader. * minor fixups in other places to cure some of lcc's warnings.
1998-09-02Mostly changes to GArray code. See ChangeLog.Manish Singh1-17/+17
1998-08-16version bump to 1.1.3, binary age 0, interface age 0.Tim Janik1-1/+7
Sun Aug 16 20:28:27 1998 Tim Janik <timj@gtk.org> * version bump to 1.1.3, binary age 0, interface age 0. * glib.h: be nice to platforms that don't have gint64 and don't issue #warning on every compilation. since glib doesn't require gint64 itself, packages that need gint64 should test for this themselves. * glib.h: * gutils.c: added a new function g_vsnprintf(). Fri Aug 14 16:41:53 1998 Tim Janik <timj@gtk.org> * glib.h: added static inline functions for bit mask tests: g_bit_nth_lsf, g_bit_nth_msf and g_bit_storage. Fri Aug 13 14:23:37 1998 Tim Janik <timj@gtk.org> * glib.h: * gmessages.c: revised the message handling system, which is now based on a new mechanism g_log*. most of the assertment macros got adapted to feature the new g_log() call with an additional specification of the log level in a preprocessor macro G_LOG_DOMAIN. if G_LOG_DOMAIN is undefined upon the includion of glib.h, it'll be defined with a value of (NULL) and thus preserves the original bahaviour for warning and error messages. the message handler setting functions for g_warning, g_error and g_message are only provided for backwards compatibility and might get removed somewhen. * Makefile.am: feature the G_LOG_DOMAIN macro to set the log domain to "GLib" upon compilation. we currently have to add this definition to the DEFS variable. * testglib.c: we need an ugly #undef G_LOG_DOMAIN at the start of this file currently, since automake doesn't support per target _CFLAGS yet. * glib.h: changed some gints to gbooleans, made a few const corrections, removed some superfluous G_STMT_START{}G_STMT_END wrappers, added some in other required places. * gnode.c: (g_node_prepend): (g_node_insert_before): (g_node_insert): (g_node_append_data): (g_node_prepend_data): (g_node_insert_data_before): (g_node_insert_data): (g_node_append): return (node), so these macros/functions can be usefully chained with g_node_new(). [GModule] Fri Aug 14 02:24:39 1998 Tim Janik <timj@gtk.org> * Makefile.am: feature the G_LOG_DOMAIN macro to set the log domain to "GModule" upon compilation. we currently have to add this definition to the DEFS variable. * testgmodule.c: we need an ugly #undef G_LOG_DOMAIN at the start of this file currently, since automake doesn't support per target _CFLAGS yet.
1998-08-05fix 64-bitness in g_prints, sizeof doesn't seem to return int so I cast itGeorge Lebl1-4/+4
Wed Aug 05 01:15:36 1998 George Lebl <jirka@5z.com> * testglib.c: fix 64-bitness in g_prints, sizeof doesn't seem to return int so I cast it for printing, probably just cosmetic
1998-08-04version bump to 1.1.1, binary age 1, interface age 0. updates. updates.Tim Janik1-9/+29
Tue Aug 4 15:17:54 1998 Tim Janik <timj@gtk.org> * configure.in: version bump to 1.1.1, binary age 1, interface age 0. * NEWS: updates. * README: updates. * INSTALL: updates and fixes. * COPYING: include the GNU LGPL, rather than shipping an empty file. * AUTHORS: listed original authors here, and added people who made significant improvements to glib. * glib.h: * gutils.c: implement g_get_current_dir() which returns a newly allocated string, instead of a g_getcwd() variant that operates on a static buffer. export glib_interface_age and glib_binary_age. as a convenience, macro definitions have been added for g_node_insert_data, g_node_insert_data_before, g_node_append_data and g_node_prepend_data. * testglib.c: minor cleanups, print current dir.
1998-07-31added a GNode test.Tim Janik1-1/+157
Fri Jul 31 22:17:05 1998 Tim Janik <timj@gtk.org> * testglib.c (g_node_test): added a GNode test. Fri Jul 31 09:08:16 1998 Tim Janik <timj@gtk.org> * Makefile.am: compile gnode.c. * glib.h: * gnode.c: added implementation of n-way trees. * gtree.c (g_tree_traverse): added a warning to the switch() statement which says that G_LEVEL_ORDER is not implemented.
1998-07-14new fuction g_dirname() which returns a newlly allocated string.Tim Janik1-0/+37
Tue Jul 14 09:05:18 1998 Tim Janik <timj@gtk.org> * glib.h: * gutils.c: new fuction g_dirname() which returns a newlly allocated string.
1998-06-18Use GINT_TO_POINTER casts to remove compiler warnings.Federico Mena Quintero1-3/+3
1998-06-18 Federico Mena Quintero <federico@nuclecu.unam.mx> * testglib.c (main): Use GINT_TO_POINTER casts to remove compiler warnings. * grel.c: #include <string.h>
1998-06-12[Changes from josh to sync with his glib stuff -Yosh]Josh MacDonald1-0/+109
Fri Jun 12 00:39:28 1998 Josh MacDonald <jmacd@icw.EECS.Berkeley.EDU> * glib.h: add new hash and equal functions g_int_*. complement g_direct_hash with g_direct_equal. * grel.c: new file, GRelations implement tuples of N-N mappings. A comment in glib.h briefly describes the interface. * ghash.c: new function, g_hash_table_size * glib.h: new typedefs, gsize, gssize, gtime. * garray.c: new functions implementing a simplified GArray. This GPtrArray is an array of gpointers and has functions to add and remove elements, much like java.lang.Vector. * garray.c: new functions for the single-byte special case of GArray. The functions g_byte_array* operate on arrays of bytes. Internally, a GArray is used. * testglib.c: tests for g_ptr_array, g_byte_array, and g_relation...
1998-06-10Initial revisionOwen Taylor1-0/+401