summaryrefslogtreecommitdiff
path: root/gstrfuncs.c
AgeCommit message (Collapse)Author
2000-11-12Remove g_filename_{to,from}_utf8Robert Brady
2000-11-12 Robert Brady <robert@suse.co.uk> * gstrfuncs.c, gstrfuncs.h: Remove g_filename_{to,from}_utf8 * gconvert.c, gconvert.h: Add g_filename_{to,from}_utf8 and g_locale_{to.from}_utf8. The locale_ variant honours nl_langinfo(CODESET), the filename_ variant uses UTF-8 unless asked otherwise. (g_convert): Add G_CONVERT_ERROR_PARTIAL_INPUT error, if bytesread != length and no bytesread pointer passed.
2000-10-26When the string is ended by a delimiter, return an extra empty string justSebastian Wilhelmi
2000-10-26 Sebastian Wilhelmi <wilhelmi@ira.uka.de> * gstrfuncs.c (g_strsplit): When the string is ended by a delimiter, return an extra empty string just like for a delimiter at the start of the string. This makes the function behave more consitent and also fixes Bug #15026.
2000-09-29Several minor ANSI C fixes.Martin Baulig
2000-09-29 Martin Baulig <baulig@suse.de> Several minor ANSI C fixes. Added missing casts: * gdate.c (g_date_fill_parse_tokens): `s = (guchar *) str'. * gmain.c (g_idle_dispatch): `func = (GSourceFunc) source_data'. (g_idle_add_full): `(gpointer) function' in call to g_source_add(). * gstrfuncs.c (g_strdown): `s = (guchar *) string' and `return (gchar *) string'. (g_strup): Likewise. (g_strchug): `start = (guchar*) string' in 1st for() argument; `strlen ((gchar *) start)' in call to g_memmove(). * gstring.c (g_string_down): `s = (guchar *) string->str'. (g_string_up): Likewise. * gthreadpool.c (stop_this_thread_marker): `(gpointer) &g_thread_pool_new'. * gunidecomp.h (decomp_table[]): Cast all the strings to `unsigned char *'. Put text following #endif into comments: * gmain.c: here.
2000-09-10Add a missing g_return_if_fail().Owen Taylor
Sat Sep 9 18:50:42 2000 Owen Taylor <otaylor@redhat.com> * gstrfuncs.c (g_strescape): Add a missing g_return_if_fail().
2000-07-27completed tor's fix to cover both #ifdef branches.Tim Janik
Thu Jul 27 05:15:11 2000 Tim Janik <timj@gtk.org> * gstrfuncs.c (g_strlcpy, g_strlcat): completed tor's fix to cover both #ifdef branches.
2000-07-26Return 0 on error, not NULL.Tor Lillqvist
2000-07-26 Tor Lillqvist <tml@iki.fi> * gstrfuncs.c (g_strlcpy, g_strlcat): Return 0 on error, not NULL. * glib.def: Add g_strlcpy, g_strlcat. * glibconfig.h.win32.in: Add gsize and gssize.
2000-07-26applied patch from Andreas Persenius <ndap@swipnet.se> that updates theTim Janik
Wed Jul 26 12:59:31 2000 Tim Janik <timj@gtk.org> * *.[hc]: applied patch from Andreas Persenius <ndap@swipnet.se> that updates the license headers to the GNU Lesser General Public License, as well as updating the copyright year to 2000.
2000-07-26added g_strlcat() and g_strlcpy() wrappers, supplied by David WheelerTim Janik
Wed Jul 26 05:47:48 2000 Tim Janik <timj@gtk.org> * configure.in: * testglib.c: * gstrfuncs.c: * glib.h: added g_strlcat() and g_strlcpy() wrappers, supplied by David Wheeler <dwheeler@ida.org>: * glib.h, gstrfuncs.c: added g_strlcpy and g_strlcat to support safe manipulation of fixed-length string buffers. These functions were originally developed by Todd Miller to simplify development of security-related programs, and are available on many (but not all) Unix-like systems, including OpenBSD, FreeBSD, and Solaris. See ftp://ftp.openbsd.org/pub/OpenBSD/src/lib/libc/string/strlcpy.3 and http://www.openbsd.org/security.html. If there's a strlcpy/strlcat on the system, it's called, otherwise an implementation is provided. * testglib.c: Added tests for g_strlcpy, g_strlcat.
2000-07-15fixed an off by 0 error (yeah, the function went off when the while (n--)Tim Janik
Sat Jul 15 09:11:46 2000 Tim Janik <timj@gtk.org> * gstrfuncs.c (g_strncasecmp): fixed an off by 0 error (yeah, the function went off when the while (n--) loop failed due to n==0 ;), reported by Jean-Louis HAMEL <jlhamel@club-internet.fr>.
2000-05-12added gobjectTim Janik
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-03-01minor optimization.Tim Janik
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-02-02glib.h New functions for conversion between UTF-8 and the encodingTor Lillqvist
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-01-09correctly fetch the current locale, fix from owen.Tim Janik
Sun Jan 9 13:28:36 2000 Tim Janik <timj@gtk.org> * gstrfuncs.c (g_strtod): correctly fetch the current locale, fix from owen.
1999-10-12completly new implementation for printf string upper bounds calculation.Tim Janik
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-04G_OS_FOO #defines. I *think* I got the cygwin and beos stuff right, butManish Singh
I haven't tested it. The respective porters should fix any screwups -Yosh
1999-08-02glib.h gstrfuncs.c Rename g_strccpy to g_strcompress and g_strecpy toTor Lillqvist
* 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-01glib.h the #define for g_strescape interfered with the compilation of theManish Singh
* 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-07-31New functions.Tor Lillqvist
* 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-2418:36. incorporated proposed cleanups from gtk-devel-list.Tim Janik
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-05-29Backslashify also '"' characters.Tor Lillqvist
* gstrfuncs.c (g_strescape): Backslashify also '"' characters. * glib.h: Document g_strescape.
1999-05-08Port to BeOS by myself and Richard Offer.CDT 1999 Shawn T. Amundson
Sat May 8 01:52:29 CDT 1999 Shawn T. Amundson <amundson@gtk.org> * configure.in gerror.c gmain.c gstrfuncs.c gutils.c ltconfig ltmain.sh gmodule/Makefile.am gmodule/gmodule.c gmodule/gmoduleconf.h.in gmodule/gmodule-beos.c gthread/Makefile.am: Port to BeOS by myself and Richard Offer.
1999-02-24inserted additional note to look for ChangeLog and AUTHORS file for a logCST 1999 Shawn T. Amundson
Wed Feb 24 00:08:42 CST 1999 Shawn T. Amundson <amundson@gtk.org> * *.[ch]: inserted additional note to look for ChangeLog and AUTHORS file for a log of modifications.
1999-02-10fixed errernerous code wrt to thread specific error string allocationTim Janik
Wed Feb 10 07:56:33 1999 Tim Janik <timj@gtk.org> * gmodule.c (g_module_error): fixed errernerous code wrt to thread specific error string allocation handling. Wed Feb 10 06:20:30 1999 Tim Janik <timj@gtk.org> * gmutex.c (g_static_private_set): invoke destroy notifier when overwriting values, initialize new array fields with NULL. (g_static_private_free_data): do not skip destroy notification for data == NULL. * gutils.c (g_direct_equal): compare pointer values directly instead of just their guint values which is a loosing conversion for sizeof(gpointer)==8 systems. (g_get_any_init): restructured code so we don't use endless loops like while (1), which boil down to an ugly alias for goto. strip ,.* from the real name.
1999-01-25NO_SYS_SIGLIST_DECL change.Timur Bakeyev
Mon Jan 25 15:34:43 1999 Timur Bakeyev <mc@bat.ru> * configure.in, gstrfuncs.c: Inverted logic of NO_SYS_SYGLIST_DECL - now it's normal (see 1999-01-19 Josh MacDonald). Also, remove from #include <signal.h> wrapper NO_SYS_SYGLIST - *sys_syglist[] declara- tion hides there.
1999-01-21Include signal.h only when the signal names will be needed.Tor Lillqvist
1999-01-19The "extern char* sys_siglist" declaration breaks systems with differentJosh MacDonald
Tue Jan 19 00:44:24 1999 Josh MacDonald <jmacd@axis.hip.berkeley.edu> * gstrfuncs.c (g_strsignal): The "extern char* sys_siglist" declaration breaks systems with different declarations, like mine (FreeBSD). So, I added a configuration variable to decide whether the declaration is neccesary. Change also appears on line 275 of configure.in.
1999-01-16Merge in current Win32 version. Almost no Unix code touched.Tor Lillqvist
* 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-11alloca and vasprintf go awayJeff Garzik
1999-01-09Add checks for vasprintf, localtime_r.Jeff Garzik
* configure.in: Add checks for vasprintf, localtime_r. * gdate.c (g_date_set_time): Use localtime if localtime_r is not available. * gstrfuncs.c (g_strdup_vprintf): Use glibc vasprintf if possible; it's a bit faster than using GLib routines, and makes output code a bit smaller. * acconfig.h: Remove HAVE_VSNPRINTF and HAVE_VPRINTF. autoheader picks these up automatically and puts them in config.h.in.
1998-12-15This commit merges the glib-threads branch into the mainOwen Taylor
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-11-05Added 'strncasecmp' to the list of functions to be searched for. Added aPhil Schwan
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-01applied glib-tml-981101-1 patch from Tor Lillqvist (ChangeLog entryManish Singh
* 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-01Land glib-rrh-19981025-0.patch.Raja R Harinath
* Makefile.am (glibconfig.h): New rule. (stamp-gc-h): New rule. Generate `glibconfig.h'. * configure.in (AM_CONFIG_HEADER): It is now `config.h'. (HAVE_BROKEN_WCTYPE): On Solaris, look for iswalnum in -lw before concluding "broken wctype". (glibconfig.h): Use AC_OUTPUT_COMMANDS to put generation code into config.status. * glib.h: Remove a lot of tests and defines. All these have been moved to `configure.in (glibconfig.h)'. * gerror.c: Include <config.h>. * gmem.c: Likewise. * gstrfuncs.c: Likewise. * gutils.c: Likewise. This could cause some short term instability.
1998-10-27removed dummy structure definitions for struct _GCache, _GTree, _GTimer,Tor Lillqvist
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-10-25no more characters are available if read() returns anything less than 1,Tim Janik
Sun Oct 25 07:30:10 1998 Tim Janik <timj@gtk.org> * gscanner.c: (g_scanner_peek_next_char): (g_scanner_get_char): no more characters are available if read() returns anything less than 1, not only on 0 return. * glib.h: * gstrfuncs.c: final API cleanup of string arrays to suit sopwith's argument order requirements. (g_strsplit): renamed from g_str_array_split(). (g_strjoinv): renamed from g_str_array_joinv(), string array is now passed as last parameter. removed `const' qualifier from string array pointer (again). (g_strjoin): new function from sopwith to concatenate strings with an additional seperator. (g_strfreev): renamed from g_str_array_free.
1998-10-21Fix new strfuncs back up (again) - No, incrementing pointers in a loop isElliot Lee
Fix new strfuncs back up (again) - No, incrementing pointers in a loop is not any faster than indexing an array in a loop with a good compiler, but it is harder to read. - strconcat doesn't allow a separator - added g_str_array_join, renamed g_str_array_join to g_str_array_joinv - join routines take separator as first argument, as is customary.
1998-10-21API cleanups of the new g_str* functions for consistency with the existingTim Janik
Wed Oct 21 17:03:05 1998 Tim Janik <timj@gtk.org> * glib.h: * gstrfuncs.c: API cleanups of the new g_str* functions for consistency with the existing naming scheme for g_str* functions. grouped the g_str* functions that will return a newly allocated string seperatedly. all of the in_place arguments were skipped, the caller is supposed to pass a g_strdup()ed string if he wants to retrive a new copy. indentation and coding style fixups. added some g_return_if_fail() statements. string array functions are prefixed with g_str_array_. (g_strdelimit): return the modified string like all other g_str* functions, that operate in place. (g_strchug): renamed from g_str_chug(), removed in_place argument. (g_strchomp): renamed from g_str_chomp(), removed in_place argument. (g_strstrip): renamed from g_str_strip(), removed in_place argument. (g_str_array_join): renamed from g_strconcatv(), since it actually operates on a string array and has totaly different semantics from g_strconcat(). check for separator != NULL, don't segfault if the first string is NULL. removed the `const' from the string array that's passed, so users can operate on gchar** string arrays. (g_str_array_split): renamed from g_str_split() because we actually produce a string array. reimplemented this function for efficiency. removed macro aliases g_str_joinv and g_str_join.
1998-10-20I swear I'll get it right someday.Elliot Lee
I swear I'll get it right someday.
1998-10-20Move string join/split/free routines from libgnome/gnome-string, rename,Elliot Lee
* glib.h, gstrfuncs.c: Move string join/split/free routines from libgnome/gnome-string, rename, and add g_str_chug.
1998-09-19minor g_memdup() fixupsTim Janik
1998-09-18Added g_memdup implementationManish Singh
-Yosh
1998-09-02new function g_strnfill() to return a new string of specified length,Tim Janik
Wed Aug 26 06:32:40 1998 Tim Janik <timj@gtk.org> * glib.h: * gstrfuncs.c: new function g_strnfill() to return a new string of specified length, filled with a specific character.
1998-08-24removed this function which was not publically exported in glib.h. toTim Janik
Mon Aug 24 02:08:56 1998 Tim Janik <timj@gtk.org> * glib.h: * gstring.c: * gstrfuncs.c: (g_vsprintf): removed this function which was not publically exported in glib.h. to export it, it should have been named differently in the first place, since its semantics differ from vsprintf(). apart from that, it was a possible cause for problems since it worked on a previously allocated memory area and was used in a lot places of glib. exporting it would have been a guararant for problems with threaded programs. (g_printf_string_upper_bound): exported this function to return a string size, guarranteed to be big enough to hold the fully expanded format+args string. added 'q', 'L' and 'll' flag handling. in fact, the newly allocated area is in most cases much bigger than required. (g_strdup_vprintf()): new function returning a newly allocated string containing the contents of *format and associated args (size is calculated with g_printf_string_upper_bound()). (g_strdup_printf): new function which wraps g_strdup_vprintf(). * configure.in: check for va_copy() or __va_copy() alternatively. check whether va_lists can be copyied by value. * glib.h: provide a definition for G_VA_COPY. * glib.h: * gmessages.c: (g_logv): (g_vsnprintf): pass va_lists by value, not by reference, since this causes problems on platforms that implement va_list as as arrays. internaly, use G_VA_COPY (new_arg, org_arg); va_end (new_arg); to produce a second va_list variable, if multiple passes are required. changed all callers. * glib.h: * gerror.h: renamed g_debug() to g_on_error_query(), cleaned up a bit. renamed g_stack_trace() to g_on_error_stack_trace() since both functions cluttered different namespaces. there is an appropriate comment in glib.h now that explains the unix and gdb specific dependencies of both functions. removed g_attach_process(). g_on_error_stack_trace() should probably be handled with caution, i've seem several different linux versions (2.0.x) become unstable after invokation of this function.
1998-08-19added g_strndupManish Singh
-Yosh
1998-07-25indentation fixes.Tim Janik
1998-07-11typo fixupsTim Janik
1998-07-10new file.Tim Janik