+Thu May 4 02:04:46 2000 Tim Janik <timj@gtk.org>
+
+ * configure.in (STRIP_DUMMY): some Make 3.79 $(strip ) versions are
+ broken and require an empty arg, give it to them.
+
+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.
+
Wed May 10 19:52:44 2000 Owen Taylor <otaylor@redhat.com>
* glib.m4: Print found version when test succeeds.
+Thu May 4 02:04:46 2000 Tim Janik <timj@gtk.org>
+
+ * configure.in (STRIP_DUMMY): some Make 3.79 $(strip ) versions are
+ broken and require an empty arg, give it to them.
+
+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.
+
Wed May 10 19:52:44 2000 Owen Taylor <otaylor@redhat.com>
* glib.m4: Print found version when test succeeds.
+Thu May 4 02:04:46 2000 Tim Janik <timj@gtk.org>
+
+ * configure.in (STRIP_DUMMY): some Make 3.79 $(strip ) versions are
+ broken and require an empty arg, give it to them.
+
+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.
+
Wed May 10 19:52:44 2000 Owen Taylor <otaylor@redhat.com>
* glib.m4: Print found version when test succeeds.
+Thu May 4 02:04:46 2000 Tim Janik <timj@gtk.org>
+
+ * configure.in (STRIP_DUMMY): some Make 3.79 $(strip ) versions are
+ broken and require an empty arg, give it to them.
+
+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.
+
Wed May 10 19:52:44 2000 Owen Taylor <otaylor@redhat.com>
* glib.m4: Print found version when test succeeds.
+Thu May 4 02:04:46 2000 Tim Janik <timj@gtk.org>
+
+ * configure.in (STRIP_DUMMY): some Make 3.79 $(strip ) versions are
+ broken and require an empty arg, give it to them.
+
+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.
+
Wed May 10 19:52:44 2000 Owen Taylor <otaylor@redhat.com>
* glib.m4: Print found version when test succeeds.
+Thu May 4 02:04:46 2000 Tim Janik <timj@gtk.org>
+
+ * configure.in (STRIP_DUMMY): some Make 3.79 $(strip ) versions are
+ broken and require an empty arg, give it to them.
+
+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.
+
Wed May 10 19:52:44 2000 Owen Taylor <otaylor@redhat.com>
* glib.m4: Print found version when test succeeds.
+Thu May 4 02:04:46 2000 Tim Janik <timj@gtk.org>
+
+ * configure.in (STRIP_DUMMY): some Make 3.79 $(strip ) versions are
+ broken and require an empty arg, give it to them.
+
+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.
+
Wed May 10 19:52:44 2000 Owen Taylor <otaylor@redhat.com>
* glib.m4: Print found version when test succeeds.
+Thu May 4 02:04:46 2000 Tim Janik <timj@gtk.org>
+
+ * configure.in (STRIP_DUMMY): some Make 3.79 $(strip ) versions are
+ broken and require an empty arg, give it to them.
+
+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.
+
Wed May 10 19:52:44 2000 Owen Taylor <otaylor@redhat.com>
* glib.m4: Print found version when test succeeds.
AUTOMAKE_OPTIONS = 1.4
-SUBDIRS = . gmodule gthread docs tests
+SUBDIRS = . gobject gmodule gthread docs tests
bin_SCRIPTS=glib-config
BUILT_SOURCES=glib-config
gtree.c \
gutils.c
-include_HEADERS = \
- glib.h
+include_HEADERS = glib.h glib-object.h
configexecincludedir = $(pkglibdir)/include
#configexecinclude_DATA = glibconfig.h
dnl are available for $ac_help expansion (don't we all *love* autoconf?)
AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
#
-# The following version number definitions apply to GLib, GModule and GThread
+# The following version number definitions apply to GLib, GModule, GObject and GThread
# as a whole, so if changes occoured in any of them, they are all
# treated with the same interface and binary age.
#
# check for bytesex stuff
AC_C_BIGENDIAN
-# xhexk for header files
+# check for header files
AC_CHECK_HEADERS(float.h, AC_DEFINE(HAVE_FLOAT_H))
AC_CHECK_HEADERS(limits.h, AC_DEFINE(HAVE_LIMITS_H))
AC_CHECK_HEADERS(pwd.h, AC_DEFINE(HAVE_PWD_H))
AC_CHECK_HEADERS(values.h, AC_DEFINE(HAVE_VALUES_H))
AC_CHECK_HEADERS(stdint.h, AC_DEFINE(HAVE_VALUES_H))
+AC_MSG_CHECKING(whether make is GNU Make)
+STRIP_BEGIN=
+STRIP_END=
+if $ac_make --version 2>/dev/null | grep '^GNU Make ' >/dev/null ; then
+ STRIP_BEGIN='$(strip $(STRIP_DUMMY)'
+ STRIP_END=')'
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
+fi
+STRIP_DUMMY=
+AC_SUBST(STRIP_DUMMY)
+AC_SUBST(STRIP_BEGIN)
+AC_SUBST(STRIP_END)
+
# check additional type sizes
size_includes=["
#include <stdarg.h>
glib-config
gmodule/gmoduleconf.h
gmodule/Makefile
+gobject/Makefile
gthread/Makefile
docs/Makefile
docs/glib-config.1
void
g_async_queue_unref (GAsyncQueue *queue)
{
- gboolean stop;
-
g_return_if_fail (queue);
g_return_if_fail (queue->ref_count > 0);
Libraries:
glib
gmodule
+ gobject
gthread
EOF
exit $1
gmodule)
lib_gmodule=yes
;;
+ gobject)
+ lib_gobject=yes
+ ;;
gthread)
lib_gthread=yes
;;
if test "$lib_glib" = "yes"; then
libsp="$libsp -lglib"
fi
+ if test "$lib_gobject" = "yes"; then
+ libsp="-lgobject $libsp"
+ fi
if test "$lib_gthread" = "yes"; then
libsp="-lgthread $libsp"
libsa="$libsa @G_THREAD_LIBS@"
#define G_STRINGIFY(macro_or_string) G_STRINGIFY_ARG (macro_or_string)
#define G_STRINGIFY_ARG(contents) #contents
+/* provide a string identifying the current code position */
+#ifdef __GNUC__
+# define G_STRLOC __FILE__ ":" G_STRINGIFY (__LINE__) ":" __PRETTY_FUNCTION__ "()"
+#else
+# define G_STRLOC __FILE__ ":" G_STRINGIFY (__LINE__)
+#endif
+
+
/* Count the number of elements in an array. The array must be defined
* as such; using this with a dynamically allocated array will give
* incorrect results.
* fields through their offsets.
*/
#define G_STRUCT_OFFSET(struct_type, member) \
- ((gulong) ((gchar*) &((struct_type*) 0)->member))
+ ((glong) ((guint8*) &((struct_type*) 0)->member))
#define G_STRUCT_MEMBER_P(struct_p, struct_offset) \
- ((gpointer) ((gchar*) (struct_p) + (gulong) (struct_offset)))
+ ((gpointer) ((guint8*) (struct_p) + (glong) (struct_offset)))
#define G_STRUCT_MEMBER(member_type, struct_p, struct_offset) \
(*(member_type*) G_STRUCT_MEMBER_P ((struct_p), (struct_offset)))
GSList* g_slist_insert_sorted (GSList *list,
gpointer data,
GCompareFunc func);
+GSList* g_slist_insert_before (GSList *slist,
+ GSList *sibling,
+ gpointer data);
GSList* g_slist_concat (GSList *list1,
GSList *list2);
GSList* g_slist_remove (GSList *list,
gchar* g_strdelimit (gchar *string,
const gchar *delimiters,
gchar new_delimiter);
+gchar* g_strcanon (gchar *string,
+ const gchar *valid_chars,
+ gchar subsitutor);
gdouble g_strtod (const gchar *nptr,
gchar **endptr);
gchar* g_strerror (gint errnum);
gint g_strncasecmp (const gchar *s1,
const gchar *s2,
guint n);
-void g_strdown (gchar *string);
-void g_strup (gchar *string);
-void g_strreverse (gchar *string);
+gchar* g_strdown (gchar *string);
+gchar* g_strup (gchar *string);
+gchar* g_strreverse (gchar *string);
/* removes leading spaces */
gchar* g_strchug (gchar *string);
/* removes trailing spaces */
/* Character sets */
#define G_CSET_A_2_Z "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
#define G_CSET_a_2_z "abcdefghijklmnopqrstuvwxyz"
+#define G_CSET_DIGITS "0123456789"
#define G_CSET_LATINC "\300\301\302\303\304\305\306"\
"\307\310\311\312\313\314\315\316\317\320"\
"\321\322\323\324\325\326"\
gmodule)
glib_config_args="$glib_config_args gmodule"
;;
+ gobject)
+ glib_config_args="$glib_config_args gobject"
+ ;;
gthread)
glib_config_args="$glib_config_args gthread"
;;
%{prefix}/lib/libglib-1.3.so.*
%{prefix}/lib/libgthread-1.3.so.*
%{prefix}/lib/libgmodule-1.3.so.*
+%{prefix}/lib/libgobject-1.3.so.*
%files devel
%defattr(-, root, root)
AUTOMAKE_OPTIONS = 1.4
-SUBDIRS = . gmodule gthread docs tests
+SUBDIRS = . gobject gmodule gthread docs tests
bin_SCRIPTS=glib-config
BUILT_SOURCES=glib-config
gtree.c \
gutils.c
-include_HEADERS = \
- glib.h
+include_HEADERS = glib.h glib-object.h
configexecincludedir = $(pkglibdir)/include
#configexecinclude_DATA = glibconfig.h
void
g_async_queue_unref (GAsyncQueue *queue)
{
- gboolean stop;
-
g_return_if_fail (queue);
g_return_if_fail (queue->ref_count > 0);
#define G_STRINGIFY(macro_or_string) G_STRINGIFY_ARG (macro_or_string)
#define G_STRINGIFY_ARG(contents) #contents
+/* provide a string identifying the current code position */
+#ifdef __GNUC__
+# define G_STRLOC __FILE__ ":" G_STRINGIFY (__LINE__) ":" __PRETTY_FUNCTION__ "()"
+#else
+# define G_STRLOC __FILE__ ":" G_STRINGIFY (__LINE__)
+#endif
+
+
/* Count the number of elements in an array. The array must be defined
* as such; using this with a dynamically allocated array will give
* incorrect results.
* fields through their offsets.
*/
#define G_STRUCT_OFFSET(struct_type, member) \
- ((gulong) ((gchar*) &((struct_type*) 0)->member))
+ ((glong) ((guint8*) &((struct_type*) 0)->member))
#define G_STRUCT_MEMBER_P(struct_p, struct_offset) \
- ((gpointer) ((gchar*) (struct_p) + (gulong) (struct_offset)))
+ ((gpointer) ((guint8*) (struct_p) + (glong) (struct_offset)))
#define G_STRUCT_MEMBER(member_type, struct_p, struct_offset) \
(*(member_type*) G_STRUCT_MEMBER_P ((struct_p), (struct_offset)))
GSList* g_slist_insert_sorted (GSList *list,
gpointer data,
GCompareFunc func);
+GSList* g_slist_insert_before (GSList *slist,
+ GSList *sibling,
+ gpointer data);
GSList* g_slist_concat (GSList *list1,
GSList *list2);
GSList* g_slist_remove (GSList *list,
gchar* g_strdelimit (gchar *string,
const gchar *delimiters,
gchar new_delimiter);
+gchar* g_strcanon (gchar *string,
+ const gchar *valid_chars,
+ gchar subsitutor);
gdouble g_strtod (const gchar *nptr,
gchar **endptr);
gchar* g_strerror (gint errnum);
gint g_strncasecmp (const gchar *s1,
const gchar *s2,
guint n);
-void g_strdown (gchar *string);
-void g_strup (gchar *string);
-void g_strreverse (gchar *string);
+gchar* g_strdown (gchar *string);
+gchar* g_strup (gchar *string);
+gchar* g_strreverse (gchar *string);
/* removes leading spaces */
gchar* g_strchug (gchar *string);
/* removes trailing spaces */
/* Character sets */
#define G_CSET_A_2_Z "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
#define G_CSET_a_2_z "abcdefghijklmnopqrstuvwxyz"
+#define G_CSET_DIGITS "0123456789"
#define G_CSET_LATINC "\300\301\302\303\304\305\306"\
"\307\310\311\312\313\314\315\316\317\320"\
"\321\322\323\324\325\326"\
) /* cset_identifier_first */,
(
G_CSET_a_2_z
- "_0123456789"
+ "_"
G_CSET_A_2_Z
+ G_CSET_DIGITS
G_CSET_LATINS
G_CSET_LATINC
) /* cset_identifier_nth */,
return msg;
}
-void
+gchar*
g_strdown (gchar *string)
{
register guchar *s;
- g_return_if_fail (string != NULL);
+ g_return_val_if_fail (string != NULL, NULL);
s = string;
*s = tolower (*s);
s++;
}
+
+ return string;
}
-void
+gchar*
g_strup (gchar *string)
{
register guchar *s;
- g_return_if_fail (string != NULL);
+ g_return_val_if_fail (string != NULL, NULL);
s = string;
*s = toupper (*s);
s++;
}
+
+ return string;
}
-void
+gchar*
g_strreverse (gchar *string)
{
- g_return_if_fail (string != NULL);
+ g_return_val_if_fail (string != NULL, NULL);
if (*string)
{
t--;
}
}
+
+ return string;
}
gint
}
gchar*
+g_strcanon (gchar *string,
+ const gchar *valid_chars,
+ gchar subsitutor)
+{
+ register gchar *c;
+
+ g_return_val_if_fail (string != NULL, NULL);
+ g_return_val_if_fail (valid_chars != NULL, NULL);
+
+ for (c = string; *c; c++)
+ {
+ if (!strchr (valid_chars, *c))
+ *c = subsitutor;
+ }
+
+ return string;
+}
+
+gchar*
g_strcompress (const gchar *source)
{
const gchar *p = source, *octal;
gchar *dest = g_malloc (strlen (source) + 1);
gchar *q = dest;
-
+
while (*p)
{
if (*p == '\\')
p++;
}
*q = 0;
+
return dest;
}
) /* cset_identifier_first */,
(
G_CSET_a_2_z
- "_0123456789"
+ "_"
G_CSET_A_2_Z
+ G_CSET_DIGITS
G_CSET_LATINS
G_CSET_LATINC
) /* cset_identifier_nth */,
return msg;
}
-void
+gchar*
g_strdown (gchar *string)
{
register guchar *s;
- g_return_if_fail (string != NULL);
+ g_return_val_if_fail (string != NULL, NULL);
s = string;
*s = tolower (*s);
s++;
}
+
+ return string;
}
-void
+gchar*
g_strup (gchar *string)
{
register guchar *s;
- g_return_if_fail (string != NULL);
+ g_return_val_if_fail (string != NULL, NULL);
s = string;
*s = toupper (*s);
s++;
}
+
+ return string;
}
-void
+gchar*
g_strreverse (gchar *string)
{
- g_return_if_fail (string != NULL);
+ g_return_val_if_fail (string != NULL, NULL);
if (*string)
{
t--;
}
}
+
+ return string;
}
gint
}
gchar*
+g_strcanon (gchar *string,
+ const gchar *valid_chars,
+ gchar subsitutor)
+{
+ register gchar *c;
+
+ g_return_val_if_fail (string != NULL, NULL);
+ g_return_val_if_fail (valid_chars != NULL, NULL);
+
+ for (c = string; *c; c++)
+ {
+ if (!strchr (valid_chars, *c))
+ *c = subsitutor;
+ }
+
+ return string;
+}
+
+gchar*
g_strcompress (const gchar *source)
{
const gchar *p = source, *octal;
gchar *dest = g_malloc (strlen (source) + 1);
gchar *q = dest;
-
+
while (*p)
{
if (*p == '\\')
p++;
}
*q = 0;
+
return dest;
}