mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-24 09:58:54 +02:00
added gobject
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.
This commit is contained in:
40
gstrfuncs.c
40
gstrfuncs.c
@@ -801,12 +801,12 @@ extern const char * strsignal(int);
|
||||
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;
|
||||
|
||||
@@ -815,14 +815,16 @@ g_strdown (gchar *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;
|
||||
|
||||
@@ -831,12 +833,14 @@ g_strup (gchar *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)
|
||||
{
|
||||
@@ -856,6 +860,8 @@ g_strreverse (gchar *string)
|
||||
t--;
|
||||
}
|
||||
}
|
||||
|
||||
return string;
|
||||
}
|
||||
|
||||
gint
|
||||
@@ -942,13 +948,32 @@ g_strdelimit (gchar *string,
|
||||
return string;
|
||||
}
|
||||
|
||||
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 == '\\')
|
||||
@@ -993,6 +1018,7 @@ g_strcompress (const gchar *source)
|
||||
p++;
|
||||
}
|
||||
*q = 0;
|
||||
|
||||
return dest;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user