glib-String-Utility-Functions.html   [plain text]


<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>String Utility Functions</title><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"><link rel="home" href="index.html" title="GLib Reference Manual"><link rel="up" href="glib-utilities.html" title="GLib Utilities"><link rel="previous" href="glib-utilities.html" title="GLib Utilities"><link rel="next" href="glib-Character-Set-Conversion.html" title="Character Set Conversion"><link rel="chapter" href="glib.html" title="GLib Overview"><link rel="refentry" href="glib-building.html" title="Compiling the GLib package"><link rel="refentry" href="glib-cross-compiling.html" title="Cross-compiling the GLib package"><link rel="refentry" href="glib-compiling.html" title="Compiling GLib Applications"><link rel="refentry" href="glib-running.html" title="Running GLib Applications"><link rel="refentry" href="glib-changes.html" title="Changes to GLib"><link rel="refentry" href="glib-resources.html" title="Mailing lists and bug reports"><link rel="chapter" href="glib-fundamentals.html" title="GLib Fundamentals"><link rel="refentry" href="glib-Basic-Types.html" title="Basic Types"><link rel="refentry" href="glib-Limits-of-Basic-Types.html" title="Limits of Basic Types"><link rel="refentry" href="glib-Standard-Macros.html" title="Standard Macros"><link rel="refentry" href="glib-Type-Conversion-Macros.html" title="Type Conversion Macros"><link rel="refentry" href="glib-Byte-Order-Macros.html" title="Byte Order Macros"><link rel="refentry" href="glib-Numerical-Definitions.html" title="Numerical Definitions"><link rel="refentry" href="glib-Miscellaneous-Macros.html" title="Miscellaneous Macros"><link rel="refentry" href="glib-Atomic-Operations.html" title="Atomic Operations"><link rel="chapter" href="glib-core.html" title="GLib Core Application Support"><link rel="refentry" href="glib-The-Main-Event-Loop.html" title="The Main Event Loop"><link rel="refentry" href="glib-Threads.html" title="
Threads"><link rel="refentry" href="glib-Thread-Pools.html" title="Thread Pools"><link rel="refentry" href="glib-Asynchronous-Queues.html" title="Asynchronous Queues"><link rel="refentry" href="glib-Dynamic-Loading-of-Modules.html" title="Dynamic Loading of Modules"><link rel="refentry" href="glib-Memory-Allocation.html" title="Memory Allocation"><link rel="refentry" href="glib-IO-Channels.html" title="IO Channels"><link rel="refentry" href="glib-Error-Reporting.html" title="Error Reporting"><link rel="refentry" href="glib-Warnings-and-Assertions.html" title="Message Output and Debugging Functions"><link rel="refentry" href="glib-Message-Logging.html" title="Message Logging"><link rel="chapter" href="glib-utilities.html" title="GLib Utilities"><link rel="refentry" href="glib-String-Utility-Functions.html" title="String Utility Functions"><link rel="refentry" href="glib-Character-Set-Conversion.html" title="Character Set Conversion"><link rel="refentry" href="glib-Unicode-Manipulation.html" title="Unicode Manipulation"><link rel="refentry" href="glib-I18N.html" title="Internationalization"><link rel="refentry" href="glib-Date-and-Time-Functions.html" title="Date and Time Functions"><link rel="refentry" href="glib-Random-Numbers.html" title="Random Numbers"><link rel="refentry" href="glib-Hook-Functions.html" title="Hook Functions"><link rel="refentry" href="glib-Miscellaneous-Utility-Functions.html" title="Miscellaneous Utility Functions"><link rel="refentry" href="glib-Lexical-Scanner.html" title="Lexical Scanner"><link rel="refentry" href="glib-Automatic-String-Completion.html" title="Automatic String Completion"><link rel="refentry" href="glib-Timers.html" title="Timers"><link rel="refentry" href="glib-Spawning-Processes.html" title="Spawning Processes"><link rel="refentry" href="glib-File-Utilities.html" title="File Utilities"><link rel="refentry" href="glib-Shell-related-Utilities.html" title="Shell-related Utilities"><link rel="refentry" href="glib-Glob-style-pattern-matching.html" title="Glob-style pattern matching"><link rel="refentry" href="glib-Simple-XML-Subset-Parser.html" title="Simple XML Subset Parser"><link rel="refentry" href="glib-Windows-Compatability-Functions.html" title="Windows Compatibility Functions"><link rel="chapter" href="glib-data-types.html" title="GLib Data Types"><link rel="refentry" href="glib-Memory-Chunks.html" title="Memory Chunks"><link rel="refentry" href="glib-Doubly-Linked-Lists.html" title="Doubly-Linked Lists"><link rel="refentry" href="glib-Singly-Linked-Lists.html" title="Singly-Linked Lists"><link rel="refentry" href="glib-Double-ended-Queues.html" title="Double-ended Queues"><link rel="refentry" href="glib-Trash-Stacks.html" title="Trash Stacks"><link rel="refentry" href="glib-Hash-Tables.html" title="Hash Tables"><link rel="refentry" href="glib-Strings.html" title="Strings"><link rel="refentry" href="glib-String-Chunks.html" title="String Chunks"><link rel="refentry" href="glib-Arrays.html" title="Arrays"><link rel="refentry" href="glib-Pointer-Arrays.html" title="Pointer Arrays"><link rel="refentry" href="glib-Byte-Arrays.html" title="Byte Arrays"><link rel="refentry" href="glib-Balanced-Binary-Trees.html" title="Balanced Binary Trees"><link rel="refentry" href="glib-N-ary-Trees.html" title="N-ary Trees"><link rel="refentry" href="glib-Quarks.html" title="Quarks"><link rel="refentry" href="glib-Keyed-Data-Lists.html" title="Keyed Data Lists"><link rel="refentry" href="glib-Datasets.html" title="Datasets"><link rel="refentry" href="glib-Relations-and-Tuples.html" title="Relations and Tuples"><link rel="refentry" href="glib-Caches.html" title="Caches"><link rel="refentry" href="glib-Memory-Allocators.html" title="Memory Allocators"><link rel="chapter" href="tools.html" title="GLib Tools"><link rel="refentry" href="glib-gettextize.html" title="glib-gettextize"><link rel="index" href="ix01.html" title="Index"><link rel="section" href="glib-String-Utility-Functions.html#id3098042" title="Description"><link rel="section" href="glib-String-Utility-Functions.html#id3098265" title="Details"><meta name="generator" content="GTK-Doc V1.2 (XML mode)"><link rel="stylesheet" href="style.css" type="text/css"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="glib-utilities.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td><a accesskey="u" href="glib-utilities.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td><th width="100%" align="center">GLib Reference Manual</th><td><a accesskey="n" href="glib-Character-Set-Conversion.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td></tr></table><div class="refentry" lang="en"><a name="glib-String-Utility-Functions"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><span class="refentrytitle">String Utility Functions</span></h2><p>String Utility Functions &#8212; various string-related functions.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">

#include &lt;glib.h&gt;
#include &lt;glib/gprintf.h&gt;


<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-String-Utility-Functions.html#g-strdup">g_strdup</a>                        (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str);
<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-String-Utility-Functions.html#g-strndup">g_strndup</a>                       (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str,
                                             <a href="glib-Basic-Types.html#gsize">gsize</a> n);
<a href="glib-Basic-Types.html#gchar">gchar</a>**     <a href="glib-String-Utility-Functions.html#g-strdupv">g_strdupv</a>                       (<a href="glib-Basic-Types.html#gchar">gchar</a> **str_array);
<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-String-Utility-Functions.html#g-strnfill">g_strnfill</a>                      (<a href="glib-Basic-Types.html#gsize">gsize</a> length,
                                             <a href="glib-Basic-Types.html#gchar">gchar</a> fill_char);
<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-String-Utility-Functions.html#g-stpcpy">g_stpcpy</a>                        (<a href="glib-Basic-Types.html#gchar">gchar</a> *dest,
                                             const char *src);
<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-String-Utility-Functions.html#g-strstr-len">g_strstr_len</a>                    (const <a href="glib-Basic-Types.html#gchar">gchar</a> *haystack,
                                             <a href="glib-Basic-Types.html#gssize">gssize</a> haystack_len,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *needle);
<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-String-Utility-Functions.html#g-strrstr">g_strrstr</a>                       (const <a href="glib-Basic-Types.html#gchar">gchar</a> *haystack,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *needle);
<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-String-Utility-Functions.html#g-strrstr-len">g_strrstr_len</a>                   (const <a href="glib-Basic-Types.html#gchar">gchar</a> *haystack,
                                             <a href="glib-Basic-Types.html#gssize">gssize</a> haystack_len,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *needle);
<a href="glib-Basic-Types.html#gboolean">gboolean</a>    <a href="glib-String-Utility-Functions.html#g-str-has-prefix">g_str_has_prefix</a>                (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *prefix);
<a href="glib-Basic-Types.html#gboolean">gboolean</a>    <a href="glib-String-Utility-Functions.html#g-str-has-suffix">g_str_has_suffix</a>                (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *suffix);

<a href="glib-Basic-Types.html#gsize">gsize</a>       <a href="glib-String-Utility-Functions.html#g-strlcpy">g_strlcpy</a>                       (<a href="glib-Basic-Types.html#gchar">gchar</a> *dest,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *src,
                                             <a href="glib-Basic-Types.html#gsize">gsize</a> dest_size);
<a href="glib-Basic-Types.html#gsize">gsize</a>       <a href="glib-String-Utility-Functions.html#g-strlcat">g_strlcat</a>                       (<a href="glib-Basic-Types.html#gchar">gchar</a> *dest,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *src,
                                             <a href="glib-Basic-Types.html#gsize">gsize</a> dest_size);

<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-String-Utility-Functions.html#g-strdup-printf">g_strdup_printf</a>                 (const <a href="glib-Basic-Types.html#gchar">gchar</a> *format,
                                             ...);
<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-String-Utility-Functions.html#g-strdup-vprintf">g_strdup_vprintf</a>                (const <a href="glib-Basic-Types.html#gchar">gchar</a> *format,
                                             va_list args);
<a href="glib-Basic-Types.html#gint">gint</a>        <a href="glib-String-Utility-Functions.html#g-printf">g_printf</a>                        (<a href="glib-Basic-Types.html#gchar">gchar</a> const *format,
                                             ...);
<a href="glib-Basic-Types.html#gint">gint</a>        <a href="glib-String-Utility-Functions.html#g-vprintf">g_vprintf</a>                       (<a href="glib-Basic-Types.html#gchar">gchar</a> const *format,
                                             va_list args);
<a href="glib-Basic-Types.html#gint">gint</a>        <a href="glib-String-Utility-Functions.html#g-fprintf">g_fprintf</a>                       (FILE *file,
                                             <a href="glib-Basic-Types.html#gchar">gchar</a> const *format,
                                             ...);
<a href="glib-Basic-Types.html#gint">gint</a>        <a href="glib-String-Utility-Functions.html#g-vfprintf">g_vfprintf</a>                      (FILE *file,
                                             <a href="glib-Basic-Types.html#gchar">gchar</a> const *format,
                                             va_list args);
<a href="glib-Basic-Types.html#gint">gint</a>        <a href="glib-String-Utility-Functions.html#g-sprintf">g_sprintf</a>                       (<a href="glib-Basic-Types.html#gchar">gchar</a> *string,
                                             <a href="glib-Basic-Types.html#gchar">gchar</a> const *format,
                                             ...);
<a href="glib-Basic-Types.html#gint">gint</a>        <a href="glib-String-Utility-Functions.html#g-vsprintf">g_vsprintf</a>                      (<a href="glib-Basic-Types.html#gchar">gchar</a> *string,
                                             <a href="glib-Basic-Types.html#gchar">gchar</a> const *format,
                                             va_list args);
<a href="glib-Basic-Types.html#gint">gint</a>        <a href="glib-String-Utility-Functions.html#g-snprintf">g_snprintf</a>                      (<a href="glib-Basic-Types.html#gchar">gchar</a> *string,
                                             <a href="glib-Basic-Types.html#gulong">gulong</a> n,
                                             <a href="glib-Basic-Types.html#gchar">gchar</a> const *format,
                                             ...);
<a href="glib-Basic-Types.html#gint">gint</a>        <a href="glib-String-Utility-Functions.html#g-vsnprintf">g_vsnprintf</a>                     (<a href="glib-Basic-Types.html#gchar">gchar</a> *string,
                                             <a href="glib-Basic-Types.html#gulong">gulong</a> n,
                                             <a href="glib-Basic-Types.html#gchar">gchar</a> const *format,
                                             va_list args);
<a href="glib-Basic-Types.html#gint">gint</a>        <a href="glib-String-Utility-Functions.html#g-vasprintf">g_vasprintf</a>                     (<a href="glib-Basic-Types.html#gchar">gchar</a> **string,
                                             <a href="glib-Basic-Types.html#gchar">gchar</a> const *format,
                                             va_list args);
<a href="glib-Basic-Types.html#gsize">gsize</a>       <a href="glib-String-Utility-Functions.html#g-printf-string-upper-bound">g_printf_string_upper_bound</a>     (const <a href="glib-Basic-Types.html#gchar">gchar</a> *format,
                                             va_list args);

<a href="glib-Basic-Types.html#gboolean">gboolean</a>    <a href="glib-String-Utility-Functions.html#g-ascii-isalnum">g_ascii_isalnum</a>                 (<a href="glib-Basic-Types.html#gchar">gchar</a> c);
<a href="glib-Basic-Types.html#gboolean">gboolean</a>    <a href="glib-String-Utility-Functions.html#g-ascii-isalpha">g_ascii_isalpha</a>                 (<a href="glib-Basic-Types.html#gchar">gchar</a> c);
<a href="glib-Basic-Types.html#gboolean">gboolean</a>    <a href="glib-String-Utility-Functions.html#g-ascii-iscntrl">g_ascii_iscntrl</a>                 (<a href="glib-Basic-Types.html#gchar">gchar</a> c);
<a href="glib-Basic-Types.html#gboolean">gboolean</a>    <a href="glib-String-Utility-Functions.html#g-ascii-isdigit">g_ascii_isdigit</a>                 (<a href="glib-Basic-Types.html#gchar">gchar</a> c);
<a href="glib-Basic-Types.html#gboolean">gboolean</a>    <a href="glib-String-Utility-Functions.html#g-ascii-isgraph">g_ascii_isgraph</a>                 (<a href="glib-Basic-Types.html#gchar">gchar</a> c);
<a href="glib-Basic-Types.html#gboolean">gboolean</a>    <a href="glib-String-Utility-Functions.html#g-ascii-islower">g_ascii_islower</a>                 (<a href="glib-Basic-Types.html#gchar">gchar</a> c);
<a href="glib-Basic-Types.html#gboolean">gboolean</a>    <a href="glib-String-Utility-Functions.html#g-ascii-isprint">g_ascii_isprint</a>                 (<a href="glib-Basic-Types.html#gchar">gchar</a> c);
<a href="glib-Basic-Types.html#gboolean">gboolean</a>    <a href="glib-String-Utility-Functions.html#g-ascii-ispunct">g_ascii_ispunct</a>                 (<a href="glib-Basic-Types.html#gchar">gchar</a> c);
<a href="glib-Basic-Types.html#gboolean">gboolean</a>    <a href="glib-String-Utility-Functions.html#g-ascii-isspace">g_ascii_isspace</a>                 (<a href="glib-Basic-Types.html#gchar">gchar</a> c);
<a href="glib-Basic-Types.html#gboolean">gboolean</a>    <a href="glib-String-Utility-Functions.html#g-ascii-isupper">g_ascii_isupper</a>                 (<a href="glib-Basic-Types.html#gchar">gchar</a> c);
<a href="glib-Basic-Types.html#gboolean">gboolean</a>    <a href="glib-String-Utility-Functions.html#g-ascii-isxdigit">g_ascii_isxdigit</a>                (<a href="glib-Basic-Types.html#gchar">gchar</a> c);

<a href="glib-Basic-Types.html#gint">gint</a>        <a href="glib-String-Utility-Functions.html#g-ascii-digit-value">g_ascii_digit_value</a>             (<a href="glib-Basic-Types.html#gchar">gchar</a> c);
<a href="glib-Basic-Types.html#gint">gint</a>        <a href="glib-String-Utility-Functions.html#g-ascii-xdigit-value">g_ascii_xdigit_value</a>            (<a href="glib-Basic-Types.html#gchar">gchar</a> c);

<a href="glib-Basic-Types.html#gint">gint</a>        <a href="glib-String-Utility-Functions.html#g-ascii-strcasecmp">g_ascii_strcasecmp</a>              (const <a href="glib-Basic-Types.html#gchar">gchar</a> *s1,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *s2);
<a href="glib-Basic-Types.html#gint">gint</a>        <a href="glib-String-Utility-Functions.html#g-ascii-strncasecmp">g_ascii_strncasecmp</a>             (const <a href="glib-Basic-Types.html#gchar">gchar</a> *s1,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *s2,
                                             <a href="glib-Basic-Types.html#gsize">gsize</a> n);

<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-String-Utility-Functions.html#g-ascii-strup">g_ascii_strup</a>                   (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str,
                                             <a href="glib-Basic-Types.html#gssize">gssize</a> len);
<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-String-Utility-Functions.html#g-ascii-strdown">g_ascii_strdown</a>                 (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str,
                                             <a href="glib-Basic-Types.html#gssize">gssize</a> len);

<a href="glib-Basic-Types.html#gchar">gchar</a>       <a href="glib-String-Utility-Functions.html#g-ascii-tolower">g_ascii_tolower</a>                 (<a href="glib-Basic-Types.html#gchar">gchar</a> c);
<a href="glib-Basic-Types.html#gchar">gchar</a>       <a href="glib-String-Utility-Functions.html#g-ascii-toupper">g_ascii_toupper</a>                 (<a href="glib-Basic-Types.html#gchar">gchar</a> c);

<a href="glib-Strings.html#GString">GString</a>*    <a href="glib-String-Utility-Functions.html#g-string-ascii-up">g_string_ascii_up</a>               (<a href="glib-Strings.html#GString">GString</a> *string);
<a href="glib-Strings.html#GString">GString</a>*    <a href="glib-String-Utility-Functions.html#g-string-ascii-down">g_string_ascii_down</a>             (<a href="glib-Strings.html#GString">GString</a> *string);

<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-String-Utility-Functions.html#g-strup">g_strup</a>                         (<a href="glib-Basic-Types.html#gchar">gchar</a> *string);
<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-String-Utility-Functions.html#g-strdown">g_strdown</a>                       (<a href="glib-Basic-Types.html#gchar">gchar</a> *string);

<a href="glib-Basic-Types.html#gint">gint</a>        <a href="glib-String-Utility-Functions.html#g-strcasecmp">g_strcasecmp</a>                    (const <a href="glib-Basic-Types.html#gchar">gchar</a> *s1,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *s2);
<a href="glib-Basic-Types.html#gint">gint</a>        <a href="glib-String-Utility-Functions.html#g-strncasecmp">g_strncasecmp</a>                   (const <a href="glib-Basic-Types.html#gchar">gchar</a> *s1,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *s2,
                                             <a href="glib-Basic-Types.html#guint">guint</a> n);

<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-String-Utility-Functions.html#g-strreverse">g_strreverse</a>                    (<a href="glib-Basic-Types.html#gchar">gchar</a> *string);

<a href="glib-Basic-Types.html#guint64">guint64</a>     <a href="glib-String-Utility-Functions.html#g-ascii-strtoull">g_ascii_strtoull</a>                (const <a href="glib-Basic-Types.html#gchar">gchar</a> *nptr,
                                             <a href="glib-Basic-Types.html#gchar">gchar</a> **endptr,
                                             <a href="glib-Basic-Types.html#guint">guint</a> base);
#define     <a href="glib-String-Utility-Functions.html#G-ASCII-DTOSTR-BUF-SIZE-CAPS">G_ASCII_DTOSTR_BUF_SIZE</a>
<a href="glib-Basic-Types.html#gdouble">gdouble</a>     <a href="glib-String-Utility-Functions.html#g-ascii-strtod">g_ascii_strtod</a>                  (const <a href="glib-Basic-Types.html#gchar">gchar</a> *nptr,
                                             <a href="glib-Basic-Types.html#gchar">gchar</a> **endptr);
<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-String-Utility-Functions.html#g-ascii-dtostr">g_ascii_dtostr</a>                  (<a href="glib-Basic-Types.html#gchar">gchar</a> *buffer,
                                             <a href="glib-Basic-Types.html#gint">gint</a> buf_len,
                                             <a href="glib-Basic-Types.html#gdouble">gdouble</a> d);
<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-String-Utility-Functions.html#g-ascii-formatd">g_ascii_formatd</a>                 (<a href="glib-Basic-Types.html#gchar">gchar</a> *buffer,
                                             <a href="glib-Basic-Types.html#gint">gint</a> buf_len,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *format,
                                             <a href="glib-Basic-Types.html#gdouble">gdouble</a> d);
<a href="glib-Basic-Types.html#gdouble">gdouble</a>     <a href="glib-String-Utility-Functions.html#g-strtod">g_strtod</a>                        (const <a href="glib-Basic-Types.html#gchar">gchar</a> *nptr,
                                             <a href="glib-Basic-Types.html#gchar">gchar</a> **endptr);

<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-String-Utility-Functions.html#g-strchug">g_strchug</a>                       (<a href="glib-Basic-Types.html#gchar">gchar</a> *string);
<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-String-Utility-Functions.html#g-strchomp">g_strchomp</a>                      (<a href="glib-Basic-Types.html#gchar">gchar</a> *string);
#define     <a href="glib-String-Utility-Functions.html#g-strstrip">g_strstrip</a>                      ( string )

<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-String-Utility-Functions.html#g-strdelimit">g_strdelimit</a>                    (<a href="glib-Basic-Types.html#gchar">gchar</a> *string,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *delimiters,
                                             <a href="glib-Basic-Types.html#gchar">gchar</a> new_delimiter);
#define     <a href="glib-String-Utility-Functions.html#G-STR-DELIMITERS-CAPS">G_STR_DELIMITERS</a>
<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-String-Utility-Functions.html#g-strescape">g_strescape</a>                     (const <a href="glib-Basic-Types.html#gchar">gchar</a> *source,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *exceptions);
<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-String-Utility-Functions.html#g-strcompress">g_strcompress</a>                   (const <a href="glib-Basic-Types.html#gchar">gchar</a> *source);
<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-String-Utility-Functions.html#g-strcanon">g_strcanon</a>                      (<a href="glib-Basic-Types.html#gchar">gchar</a> *string,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *valid_chars,
                                             <a href="glib-Basic-Types.html#gchar">gchar</a> substitutor);
<a href="glib-Basic-Types.html#gchar">gchar</a>**     <a href="glib-String-Utility-Functions.html#g-strsplit">g_strsplit</a>                      (const <a href="glib-Basic-Types.html#gchar">gchar</a> *string,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *delimiter,
                                             <a href="glib-Basic-Types.html#gint">gint</a> max_tokens);
<a href="glib-Basic-Types.html#gchar">gchar</a>**     <a href="glib-String-Utility-Functions.html#g-strsplit-set">g_strsplit_set</a>                  (const <a href="glib-Basic-Types.html#gchar">gchar</a> *string,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *delimiters,
                                             <a href="glib-Basic-Types.html#gint">gint</a> max_tokens);
void        <a href="glib-String-Utility-Functions.html#g-strfreev">g_strfreev</a>                      (<a href="glib-Basic-Types.html#gchar">gchar</a> **str_array);
<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-String-Utility-Functions.html#g-strconcat">g_strconcat</a>                     (const <a href="glib-Basic-Types.html#gchar">gchar</a> *string1,
                                             ...);
<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-String-Utility-Functions.html#g-strjoin">g_strjoin</a>                       (const <a href="glib-Basic-Types.html#gchar">gchar</a> *separator,
                                             ...);
<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-String-Utility-Functions.html#g-strjoinv">g_strjoinv</a>                      (const <a href="glib-Basic-Types.html#gchar">gchar</a> *separator,
                                             <a href="glib-Basic-Types.html#gchar">gchar</a> **str_array);

G_CONST_RETURN <a href="glib-Basic-Types.html#gchar">gchar</a>* <a href="glib-String-Utility-Functions.html#g-strerror">g_strerror</a>            (<a href="glib-Basic-Types.html#gint">gint</a> errnum);
G_CONST_RETURN <a href="glib-Basic-Types.html#gchar">gchar</a>* <a href="glib-String-Utility-Functions.html#g-strsignal">g_strsignal</a>           (<a href="glib-Basic-Types.html#gint">gint</a> signum);

</pre></div><div class="refsect1" lang="en"><a name="id3098042"></a><h2>Description</h2><p>
This section describes a number of utility functions for creating,
duplicating, and manipulating strings.
</p><p>
Note that the functions <a href="glib-String-Utility-Functions.html#g-printf"><tt class="function">g_printf()</tt></a>, <a href="glib-String-Utility-Functions.html#g-fprintf"><tt class="function">g_fprintf()</tt></a>, <a href="glib-String-Utility-Functions.html#g-sprintf"><tt class="function">g_sprintf()</tt></a>, <a href="glib-String-Utility-Functions.html#g-snprintf"><tt class="function">g_snprintf()</tt></a>,
<a href="glib-String-Utility-Functions.html#g-vprintf"><tt class="function">g_vprintf()</tt></a>, <a href="glib-String-Utility-Functions.html#g-vfprintf"><tt class="function">g_vfprintf()</tt></a>, <a href="glib-String-Utility-Functions.html#g-vsprintf"><tt class="function">g_vsprintf()</tt></a> and <a href="glib-String-Utility-Functions.html#g-vsnprintf"><tt class="function">g_vsnprintf()</tt></a> are declared in 
the header <tt class="filename">gprintf.h</tt> which is <span class="emphasis"><em>not</em></span>
included in <tt class="filename">glib.h</tt> (otherwise using 
<tt class="filename">glib.h</tt> would drag in <tt class="filename">stdio.h</tt>), so
you'll have to explicitly include <tt class="literal">&lt;glib/gprintf.h&gt;</tt> 
in order to use the GLib <tt class="function">printf()</tt> functions. 
</p><p><a name="string-precision"></a>
While you may use the <tt class="function">printf()</tt> functions to format UTF-8 strings, notice that
the precision of a <tt class="literal">%Ns</tt> parameter is interpreted as the
number of <span class="emphasis"><em>bytes</em></span>, not <span class="emphasis"><em>characters</em></span> to print.
On top of that, the GNU libc implementation of the <tt class="function">printf()</tt> functions has the "feature"
that it checks that the string given for the <tt class="literal">%Ns</tt> parameter
consists of a whole number of characters in the current encoding. So, unless you
are sure you are always going to be in an UTF-8 locale or your know your text is restricted 
to ASCII, avoid using <tt class="literal">%Ns</tt>.
If your intention is to format strings for a certain number of columns, then 
<tt class="literal">%Ns</tt> is not a correct solution anyway, since it fails to take 
wide characters (see <a href="glib-Unicode-Manipulation.html#g-unichar-iswide"><tt class="function">g_unichar_iswide()</tt></a>) into account.
</p></div><div class="refsect1" lang="en"><a name="id3098265"></a><h2>Details</h2><div class="refsect2" lang="en"><a name="id3098271"></a><h3><a name="g-strdup"></a>g_strdup ()</h3><a class="indexterm" name="id3098281"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_strdup                        (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str);</pre><p>
Duplicates a string.
If <i class="parameter"><tt>str</tt></i> is <tt class="literal">NULL</tt> it returns <tt class="literal">NULL</tt>.
The returned string should be freed when no longer needed.
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>str</tt></i> :</span></td><td>the string to duplicate.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>a newly-allocated copy of <i class="parameter"><tt>str</tt></i>.


</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3098363"></a><h3><a name="g-strndup"></a>g_strndup ()</h3><a class="indexterm" name="id3098374"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_strndup                       (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str,
                                             <a href="glib-Basic-Types.html#gsize">gsize</a> n);</pre><p>
Duplicates the first <i class="parameter"><tt>n</tt></i> characters of a string, returning a newly-allocated
buffer <i class="parameter"><tt>n</tt></i> + 1 characters long which will always be nul-terminated.
If <i class="parameter"><tt>str</tt></i> is less than <i class="parameter"><tt>n</tt></i> characters long the buffer is padded with nuls.
If <i class="parameter"><tt>str</tt></i> is <tt class="literal">NULL</tt> it returns <tt class="literal">NULL</tt>.
The returned value should be freed when no longer needed.
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>str</tt></i> :</span></td><td>the string to duplicate part of.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>n</tt></i> :</span></td><td>the maximum number of characters to copy from <i class="parameter"><tt>str</tt></i>.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>a newly-allocated buffer containing the first <i class="parameter"><tt>n</tt></i> characters of <i class="parameter"><tt>str</tt></i>,
nul-terminated.


</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3098515"></a><h3><a name="g-strdupv"></a>g_strdupv ()</h3><a class="indexterm" name="id3098526"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>**     g_strdupv                       (<a href="glib-Basic-Types.html#gchar">gchar</a> **str_array);</pre><p>
Copies <tt class="literal">NULL</tt>-terminated array of strings. The copy is a deep copy;
the new array should be freed by first freeing each string, then
the array itself. <a href="glib-String-Utility-Functions.html#g-strfreev"><tt class="function">g_strfreev()</tt></a> does this for you. If called
on a <tt class="literal">NULL</tt> value, <a href="glib-String-Utility-Functions.html#g-strdupv"><tt class="function">g_strdupv()</tt></a> simply returns <tt class="literal">NULL</tt>.</p><p>
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>str_array</tt></i> :</span></td><td> <tt class="literal">NULL</tt>-terminated array of strings.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a new <tt class="literal">NULL</tt>-terminated array of strings.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3098639"></a><h3><a name="g-strnfill"></a>g_strnfill ()</h3><a class="indexterm" name="id3098650"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_strnfill                      (<a href="glib-Basic-Types.html#gsize">gsize</a> length,
                                             <a href="glib-Basic-Types.html#gchar">gchar</a> fill_char);</pre><p>
Creates a new string <i class="parameter"><tt>length</tt></i> characters long filled with <i class="parameter"><tt>fill_char</tt></i>.
The returned string should be freed when no longer needed.
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>length</tt></i> :</span></td><td>the length of the new string.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>fill_char</tt></i> :</span></td><td>the character to fill the string with.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>a newly-allocated string filled the <i class="parameter"><tt>fill_char</tt></i>.


</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3098749"></a><h3><a name="g-stpcpy"></a>g_stpcpy ()</h3><a class="indexterm" name="id3098760"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_stpcpy                        (<a href="glib-Basic-Types.html#gchar">gchar</a> *dest,
                                             const char *src);</pre><p>
Copies a nul-terminated string into the dest buffer, include the
trailing nul, and return a pointer to the trailing nul byte.
This is useful for concatenating multiple strings together
without having to repeatedly scan for the end.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>dest</tt></i> :</span></td><td> destination buffer.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>src</tt></i> :</span></td><td> source string.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a pointer to trailing nul byte.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3098845"></a><h3><a name="g-strstr-len"></a>g_strstr_len ()</h3><a class="indexterm" name="id3098856"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_strstr_len                    (const <a href="glib-Basic-Types.html#gchar">gchar</a> *haystack,
                                             <a href="glib-Basic-Types.html#gssize">gssize</a> haystack_len,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *needle);</pre><p>
Searches the string <i class="parameter"><tt>haystack</tt></i> for the first occurrence
of the string <i class="parameter"><tt>needle</tt></i>, limiting the length of the search
to <i class="parameter"><tt>haystack_len</tt></i>.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>haystack</tt></i> :</span></td><td> a string.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>haystack_len</tt></i> :</span></td><td> the maximum length of <i class="parameter"><tt>haystack</tt></i>.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>needle</tt></i> :</span></td><td> the string to search for.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a pointer to the found occurrence, or
   <tt class="literal">NULL</tt> if not found.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3098991"></a><h3><a name="g-strrstr"></a>g_strrstr ()</h3><a class="indexterm" name="id3099002"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_strrstr                       (const <a href="glib-Basic-Types.html#gchar">gchar</a> *haystack,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *needle);</pre><p>
Searches the string <i class="parameter"><tt>haystack</tt></i> for the last occurrence
of the string <i class="parameter"><tt>needle</tt></i>.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>haystack</tt></i> :</span></td><td> a nul-terminated string.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>needle</tt></i> :</span></td><td> the nul-terminated string to search for.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a pointer to the found occurrence, or
   <tt class="literal">NULL</tt> if not found.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3099103"></a><h3><a name="g-strrstr-len"></a>g_strrstr_len ()</h3><a class="indexterm" name="id3099114"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_strrstr_len                   (const <a href="glib-Basic-Types.html#gchar">gchar</a> *haystack,
                                             <a href="glib-Basic-Types.html#gssize">gssize</a> haystack_len,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *needle);</pre><p>
Searches the string <i class="parameter"><tt>haystack</tt></i> for the last occurrence
of the string <i class="parameter"><tt>needle</tt></i>, limiting the length of the search
to <i class="parameter"><tt>haystack_len</tt></i>.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>haystack</tt></i> :</span></td><td> a nul-terminated string.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>haystack_len</tt></i> :</span></td><td> the maximum length of <i class="parameter"><tt>haystack</tt></i>.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>needle</tt></i> :</span></td><td> the nul-terminated string to search for.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a pointer to the found occurrence, or
   <tt class="literal">NULL</tt> if not found.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3099250"></a><h3><a name="g-str-has-prefix"></a>g_str_has_prefix ()</h3><a class="indexterm" name="id3099261"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a>    g_str_has_prefix                (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *prefix);</pre><p>
Looks whether the string <i class="parameter"><tt>str</tt></i> begins with <i class="parameter"><tt>prefix</tt></i>.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>str</tt></i> :</span></td><td> a nul-terminated string.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>prefix</tt></i> :</span></td><td> the nul-terminated prefix to look for.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <tt class="literal">TRUE</tt> if <i class="parameter"><tt>str</tt></i> begins with <i class="parameter"><tt>prefix</tt></i>, <tt class="literal">FALSE</tt> otherwise.

</td></tr></tbody></table></div><p>Since  2.2
</p></div><hr><div class="refsect2" lang="en"><a name="id3099382"></a><h3><a name="g-str-has-suffix"></a>g_str_has_suffix ()</h3><a class="indexterm" name="id3099393"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a>    g_str_has_suffix                (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *suffix);</pre><p>
Looks whether the string <i class="parameter"><tt>str</tt></i> ends with <i class="parameter"><tt>suffix</tt></i>.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>str</tt></i> :</span></td><td> a nul-terminated string.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>suffix</tt></i> :</span></td><td> the nul-terminated suffix to look for.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <tt class="literal">TRUE</tt> if <i class="parameter"><tt>str</tt></i> end with <i class="parameter"><tt>suffix</tt></i>, <tt class="literal">FALSE</tt> otherwise.

</td></tr></tbody></table></div><p>Since  2.2
</p></div><hr><div class="refsect2" lang="en"><a name="id3099514"></a><h3><a name="g-strlcpy"></a>g_strlcpy ()</h3><a class="indexterm" name="id3099525"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gsize">gsize</a>       g_strlcpy                       (<a href="glib-Basic-Types.html#gchar">gchar</a> *dest,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *src,
                                             <a href="glib-Basic-Types.html#gsize">gsize</a> dest_size);</pre><p>
Portability wrapper that calls <tt class="function">strlcpy()</tt> on systems which have it, and emulates
<tt class="function">strlcpy()</tt> otherwise. Copies <i class="parameter"><tt>src</tt></i> to <i class="parameter"><tt>dest</tt></i>; <i class="parameter"><tt>dest</tt></i> is guaranteed to be
nul-terminated; <i class="parameter"><tt>src</tt></i> must be nul-terminated; <i class="parameter"><tt>dest_size</tt></i> is the buffer size, not
the number of chars to copy. Caveat: <tt class="function">strlcpy()</tt> is supposedly more secure than
<tt class="function">strcpy()</tt> or <tt class="function">strncpy()</tt>, but if you really want to avoid screwups, <a href="glib-String-Utility-Functions.html#g-strdup"><tt class="function">g_strdup()</tt></a> is
an even better idea.
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>dest</tt></i> :</span></td><td>destination buffer
</td></tr><tr><td><span class="term"><i class="parameter"><tt>src</tt></i> :</span></td><td>source buffer
</td></tr><tr><td><span class="term"><i class="parameter"><tt>dest_size</tt></i> :</span></td><td>length of <i class="parameter"><tt>dest</tt></i> in bytes
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>length of <i class="parameter"><tt>src</tt></i>


</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3099734"></a><h3><a name="g-strlcat"></a>g_strlcat ()</h3><a class="indexterm" name="id3099745"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gsize">gsize</a>       g_strlcat                       (<a href="glib-Basic-Types.html#gchar">gchar</a> *dest,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *src,
                                             <a href="glib-Basic-Types.html#gsize">gsize</a> dest_size);</pre><p>
Portability wrapper that calls <tt class="function">strlcat()</tt> on systems which have it, and emulates it otherwise. 
Appends nul-terminated <i class="parameter"><tt>src</tt></i> string to <i class="parameter"><tt>dest</tt></i>, guaranteeing
nul-termination for <i class="parameter"><tt>dest</tt></i>. The total size of <i class="parameter"><tt>dest</tt></i> won't exceed
<i class="parameter"><tt>dest_size</tt></i>. Caveat: this is supposedly a more secure alternative to <tt class="function">strcat()</tt> or
<tt class="function">strncat()</tt>, but for real security <a href="glib-String-Utility-Functions.html#g-strconcat"><tt class="function">g_strconcat()</tt></a> is harder to mess up.
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>dest</tt></i> :</span></td><td>destination buffer, already containing one nul-terminated string
</td></tr><tr><td><span class="term"><i class="parameter"><tt>src</tt></i> :</span></td><td>source buffer
</td></tr><tr><td><span class="term"><i class="parameter"><tt>dest_size</tt></i> :</span></td><td>length of <i class="parameter"><tt>dest</tt></i> buffer in bytes (not length of existing string inside <i class="parameter"><tt>dest</tt></i>)
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>length of <i class="parameter"><tt>src</tt></i> plus initial length of string in <i class="parameter"><tt>dest</tt></i>


</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3099948"></a><h3><a name="g-strdup-printf"></a>g_strdup_printf ()</h3><a class="indexterm" name="id3099959"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_strdup_printf                 (const <a href="glib-Basic-Types.html#gchar">gchar</a> *format,
                                             ...);</pre><p>
Similar to the standard C <tt class="function">sprintf()</tt> function
but safer, since it calculates the maximum space required and allocates
memory to hold the result.
The returned string should be freed when no longer needed.
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>format</tt></i> :</span></td><td>a standard <tt class="function">printf()</tt> format string, but notice 
  <a href="glib-String-Utility-Functions.html#string-precision">string precision pitfalls</a>.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>...</tt></i> :</span></td><td>the parameters to insert into the format string.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>a newly-allocated string holding the result.


</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3100065"></a><h3><a name="g-strdup-vprintf"></a>g_strdup_vprintf ()</h3><a class="indexterm" name="id3100076"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_strdup_vprintf                (const <a href="glib-Basic-Types.html#gchar">gchar</a> *format,
                                             va_list args);</pre><p>
Similar to the standard C <tt class="function">vsprintf()</tt> function
but safer, since it calculates the maximum space required and allocates
memory to hold the result.
The returned string should be freed when no longer needed.
</p><p>
See also <a href="glib-String-Utility-Functions.html#g-vasprintf"><tt class="function">g_vasprintf()</tt></a>, which offers the same functionality, but additionally
returns the length of the allocated string. 
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>format</tt></i> :</span></td><td>a standard <tt class="function">printf()</tt> format string, but notice 
  <a href="glib-String-Utility-Functions.html#string-precision">string precision pitfalls</a>.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>args</tt></i> :</span></td><td>the list of parameters to insert into the format string.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>a newly-allocated string holding the result.


</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3100203"></a><h3><a name="g-printf"></a>g_printf ()</h3><a class="indexterm" name="id3100214"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gint">gint</a>        g_printf                        (<a href="glib-Basic-Types.html#gchar">gchar</a> const *format,
                                             ...);</pre><p>
An implementation of the standard <tt class="function">printf()</tt> function which supports 
positional parameters, as specified in the Single Unix Specification.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>format</tt></i> :</span></td><td> a standard <tt class="function">printf()</tt> format string, but notice 
         <a href="glib-String-Utility-Functions.html#string-precision">string precision pitfalls</a>.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>...</tt></i> :</span></td><td> the arguments to insert in the output.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the number of characters printed.

</td></tr></tbody></table></div><p>Since  2.2
</p></div><hr><div class="refsect2" lang="en"><a name="id3100324"></a><h3><a name="g-vprintf"></a>g_vprintf ()</h3><a class="indexterm" name="id3100334"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gint">gint</a>        g_vprintf                       (<a href="glib-Basic-Types.html#gchar">gchar</a> const *format,
                                             va_list args);</pre><p>
An implementation of the standard <tt class="function">vprintf()</tt> function which supports 
positional parameters, as specified in the Single Unix Specification.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>format</tt></i> :</span></td><td> a standard <tt class="function">printf()</tt> format string, but notice 
         <a href="glib-String-Utility-Functions.html#string-precision">string precision pitfalls</a>.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>args</tt></i> :</span></td><td> the list of arguments to insert in the output.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the number of characters printed.

</td></tr></tbody></table></div><p>Since  2.2
</p></div><hr><div class="refsect2" lang="en"><a name="id3100453"></a><h3><a name="g-fprintf"></a>g_fprintf ()</h3><a class="indexterm" name="id3100463"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gint">gint</a>        g_fprintf                       (FILE *file,
                                             <a href="glib-Basic-Types.html#gchar">gchar</a> const *format,
                                             ...);</pre><p>
An implementation of the standard <tt class="function">fprintf()</tt> function which supports 
positional parameters, as specified in the Single Unix Specification.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>file</tt></i> :</span></td><td> the stream to write to.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>format</tt></i> :</span></td><td> a standard <tt class="function">printf()</tt> format string, but notice 
         <a href="glib-String-Utility-Functions.html#string-precision">string precision pitfalls</a>.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>...</tt></i> :</span></td><td> the arguments to insert in the output.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the number of characters printed.

</td></tr></tbody></table></div><p>Since  2.2
</p></div><hr><div class="refsect2" lang="en"><a name="id3100596"></a><h3><a name="g-vfprintf"></a>g_vfprintf ()</h3><a class="indexterm" name="id3100607"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gint">gint</a>        g_vfprintf                      (FILE *file,
                                             <a href="glib-Basic-Types.html#gchar">gchar</a> const *format,
                                             va_list args);</pre><p>
An implementation of the standard <tt class="function">fprintf()</tt> function which supports 
positional parameters, as specified in the Single Unix Specification.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>file</tt></i> :</span></td><td> the stream to write to.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>format</tt></i> :</span></td><td> a standard <tt class="function">printf()</tt> format string, but notice 
         <a href="glib-String-Utility-Functions.html#string-precision">string precision pitfalls</a>.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>args</tt></i> :</span></td><td> the list of arguments to insert in the output.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the number of characters printed.

</td></tr></tbody></table></div><p>Since  2.2
</p></div><hr><div class="refsect2" lang="en"><a name="id3100746"></a><h3><a name="g-sprintf"></a>g_sprintf ()</h3><a class="indexterm" name="id3100756"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gint">gint</a>        g_sprintf                       (<a href="glib-Basic-Types.html#gchar">gchar</a> *string,
                                             <a href="glib-Basic-Types.html#gchar">gchar</a> const *format,
                                             ...);</pre><p>
An implementation of the standard <tt class="function">sprintf()</tt> function which supports 
positional parameters, as specified in the Single Unix Specification.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>string</tt></i> :</span></td><td> the buffer to hold the output.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>format</tt></i> :</span></td><td> a standard <tt class="function">printf()</tt> format string, but notice 
         <a href="glib-String-Utility-Functions.html#string-precision">string precision pitfalls</a>.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>...</tt></i> :</span></td><td> the arguments to insert in the output.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the number of characters printed.

</td></tr></tbody></table></div><p>Since  2.2
</p></div><hr><div class="refsect2" lang="en"><a name="id3100888"></a><h3><a name="g-vsprintf"></a>g_vsprintf ()</h3><a class="indexterm" name="id3100899"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gint">gint</a>        g_vsprintf                      (<a href="glib-Basic-Types.html#gchar">gchar</a> *string,
                                             <a href="glib-Basic-Types.html#gchar">gchar</a> const *format,
                                             va_list args);</pre><p>
An implementation of the standard <tt class="function">vsprintf()</tt> function which supports 
positional parameters, as specified in the Single Unix Specification.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>string</tt></i> :</span></td><td> the buffer to hold the output.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>format</tt></i> :</span></td><td> a standard <tt class="function">printf()</tt> format string, but notice 
         <a href="glib-String-Utility-Functions.html#string-precision">string precision pitfalls</a>.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>args</tt></i> :</span></td><td> the list of arguments to insert in the output.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the number of characters printed.

</td></tr></tbody></table></div><p>Since  2.2
</p></div><hr><div class="refsect2" lang="en"><a name="id3101038"></a><h3><a name="g-snprintf"></a>g_snprintf ()</h3><a class="indexterm" name="id3101048"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gint">gint</a>        g_snprintf                      (<a href="glib-Basic-Types.html#gchar">gchar</a> *string,
                                             <a href="glib-Basic-Types.html#gulong">gulong</a> n,
                                             <a href="glib-Basic-Types.html#gchar">gchar</a> const *format,
                                             ...);</pre><p>
A safer form of the standard <tt class="function">sprintf()</tt> function. The output is guaranteed
to not exceed <i class="parameter"><tt>n</tt></i> characters (including the terminating nul character), so 
it is easy to ensure that a buffer overflow cannot occur.
</p><p>
See also <a href="glib-String-Utility-Functions.html#g-strdup-printf"><tt class="function">g_strdup_printf()</tt></a>.
</p><p>
In versions of GLib prior to 1.2.3, this function may return -1 if the 
output was truncated, and the truncated string may not be nul-terminated. 
In versions prior to 1.3.12, this function returns the length of the output 
string.
</p><p>
The return value of <a href="glib-String-Utility-Functions.html#g-snprintf"><tt class="function">g_snprintf()</tt></a> conforms to the <tt class="function">snprintf()</tt>
function as standardized in ISO C99. Note that this is different from 
traditional <tt class="function">snprintf()</tt>, which returns the length of the output string.
</p><p>
The format string may contain positional parameters, as specified in 
the Single Unix Specification.</p><p>
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>string</tt></i> :</span></td><td> the buffer to hold the output.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>n</tt></i> :</span></td><td> the maximum number of characters to produce (including the 
    terminating nul character).
</td></tr><tr><td><span class="term"><i class="parameter"><tt>format</tt></i> :</span></td><td> a standard <tt class="function">printf()</tt> format string, but notice 
         <a href="glib-String-Utility-Functions.html#string-precision">string precision pitfalls</a>.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>...</tt></i> :</span></td><td> the arguments to insert in the output.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the number of characters which would be produced if the buffer 
    was large enough.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3101270"></a><h3><a name="g-vsnprintf"></a>g_vsnprintf ()</h3><a class="indexterm" name="id3101280"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gint">gint</a>        g_vsnprintf                     (<a href="glib-Basic-Types.html#gchar">gchar</a> *string,
                                             <a href="glib-Basic-Types.html#gulong">gulong</a> n,
                                             <a href="glib-Basic-Types.html#gchar">gchar</a> const *format,
                                             va_list args);</pre><p>
A safer form of the standard <tt class="function">vsprintf()</tt> function. The output is guaranteed
to not exceed <i class="parameter"><tt>n</tt></i> characters (including the terminating nul character), so 
it is easy to ensure that a buffer overflow cannot occur.
</p><p>
See also <a href="glib-String-Utility-Functions.html#g-strdup-vprintf"><tt class="function">g_strdup_vprintf()</tt></a>.
</p><p>
In versions of GLib prior to 1.2.3, this function may return -1 if the 
output was truncated, and the truncated string may not be nul-terminated.
In versions prior to 1.3.12, this function returns the length of the output 
string.
</p><p>
The return value of <a href="glib-String-Utility-Functions.html#g-vsnprintf"><tt class="function">g_vsnprintf()</tt></a> conforms to the <tt class="function">vsnprintf()</tt> function 
as standardized in ISO C99. Note that this is different from traditional 
<tt class="function">vsnprintf()</tt>, which returns the length of the output string.
</p><p>
The format string may contain positional parameters, as specified in 
the Single Unix Specification.</p><p>
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>string</tt></i> :</span></td><td> the buffer to hold the output.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>n</tt></i> :</span></td><td> the maximum number of characters to produce (including the 
    terminating nul character).
</td></tr><tr><td><span class="term"><i class="parameter"><tt>format</tt></i> :</span></td><td> a standard <tt class="function">printf()</tt> format string, but notice 
         <a href="glib-String-Utility-Functions.html#string-precision">string precision pitfalls</a>.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>args</tt></i> :</span></td><td> the list of arguments to insert in the output.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the number of characters which would be produced if the buffer 
 was large enough.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3101510"></a><h3><a name="g-vasprintf"></a>g_vasprintf ()</h3><a class="indexterm" name="id3101520"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gint">gint</a>        g_vasprintf                     (<a href="glib-Basic-Types.html#gchar">gchar</a> **string,
                                             <a href="glib-Basic-Types.html#gchar">gchar</a> const *format,
                                             va_list args);</pre><p>
An implementation of the GNU <tt class="function">vasprintf()</tt> function which supports 
positional parameters, as specified in the Single Unix Specification.
This function is similar to <a href="glib-String-Utility-Functions.html#g-vsprintf"><tt class="function">g_vsprintf()</tt></a>, except that it allocates a 
string to hold the output, instead of putting the output in a buffer 
you allocate in advance.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>string</tt></i> :</span></td><td> the return location for the newly-allocated string.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>format</tt></i> :</span></td><td> a standard <tt class="function">printf()</tt> format string, but notice
         <a href="glib-String-Utility-Functions.html#string-precision">string precision pitfalls</a>.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>args</tt></i> :</span></td><td> the list of arguments to insert in the output.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the number of characters printed.

</td></tr></tbody></table></div><p>Since  2.4
</p></div><hr><div class="refsect2" lang="en"><a name="id3101674"></a><h3><a name="g-printf-string-upper-bound"></a>g_printf_string_upper_bound ()</h3><a class="indexterm" name="id3101686"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gsize">gsize</a>       g_printf_string_upper_bound     (const <a href="glib-Basic-Types.html#gchar">gchar</a> *format,
                                             va_list args);</pre><p>
Calculates the maximum space needed to store the output of the <tt class="function">sprintf()</tt> function.
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>format</tt></i> :</span></td><td>the format string. See the <tt class="function">printf()</tt> documentation.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>args</tt></i> :</span></td><td>the parameters to be inserted into the format string.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the maximum space needed to store the formatted string.


</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3101786"></a><h3><a name="g-ascii-isalnum"></a>g_ascii_isalnum ()</h3><a class="indexterm" name="id3101797"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a>    g_ascii_isalnum                 (<a href="glib-Basic-Types.html#gchar">gchar</a> c);</pre><p>
Determines whether a character is alphanumeric.
</p><p>
Unlike the standard C library <tt class="function">isalnum()</tt> function, this only
recognizes standard ASCII letters and ignores the locale, returning
<tt class="literal">FALSE</tt> for all non-ASCII characters. Also unlike the standard
library function, this takes a <span class="type">char</span>, not an <span class="type">int</span>, 
so don't call it on <tt class="literal">EOF</tt> but no need to cast to <a href="glib-Basic-Types.html#guchar"><span class="type">guchar</span></a> before passing a 
possibly non-ASCII character in.
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>c</tt></i> :</span></td><td>any character
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td><tt class="literal">TRUE</tt> if <i class="parameter"><tt>c</tt></i> is an ASCII alphanumeric character


</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3101913"></a><h3><a name="g-ascii-isalpha"></a>g_ascii_isalpha ()</h3><a class="indexterm" name="id3101924"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a>    g_ascii_isalpha                 (<a href="glib-Basic-Types.html#gchar">gchar</a> c);</pre><p>
Determines whether a character is alphabetic (i.e. a letter).
</p><p>
Unlike the standard C library <tt class="function">isalpha()</tt> function, this only
recognizes standard ASCII letters and ignores the locale, returning
<tt class="literal">FALSE</tt> for all non-ASCII characters. Also unlike the standard
library function, this takes a <span class="type">char</span>, not an <span class="type">int</span>, 
so don't call it on <tt class="literal">EOF</tt> but no need to cast to <a href="glib-Basic-Types.html#guchar"><span class="type">guchar</span></a> before passing a 
possibly non-ASCII character in.
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>c</tt></i> :</span></td><td>any character
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td><tt class="literal">TRUE</tt> if <i class="parameter"><tt>c</tt></i> is an ASCII alphabetic character


</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3102038"></a><h3><a name="g-ascii-iscntrl"></a>g_ascii_iscntrl ()</h3><a class="indexterm" name="id3102049"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a>    g_ascii_iscntrl                 (<a href="glib-Basic-Types.html#gchar">gchar</a> c);</pre><p>
Determines whether a character is a control character.
</p><p>
Unlike the standard C library <tt class="function">iscntrl()</tt> function, this only
recognizes standard ASCII control characters and ignores the locale,
returning <tt class="literal">FALSE</tt> for all non-ASCII characters. Also unlike the standard
library function, this takes a <span class="type">char</span>, not an <span class="type">int</span>, 
so don't call it on <tt class="literal">EOF</tt> but no need to cast to <a href="glib-Basic-Types.html#guchar"><span class="type">guchar</span></a> before passing a 
possibly non-ASCII character in.
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>c</tt></i> :</span></td><td>any character
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td><tt class="literal">TRUE</tt> if <i class="parameter"><tt>c</tt></i> is an ASCII control character.


</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3102164"></a><h3><a name="g-ascii-isdigit"></a>g_ascii_isdigit ()</h3><a class="indexterm" name="id3102175"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a>    g_ascii_isdigit                 (<a href="glib-Basic-Types.html#gchar">gchar</a> c);</pre><p>
Determines whether a character is digit (0-9).
</p><p>
Unlike the standard C library <tt class="function">isdigit()</tt> function,
this takes a <span class="type">char</span>, not an <span class="type">int</span>, so don't call it
on <tt class="literal">EOF</tt> but no need to cast to <a href="glib-Basic-Types.html#guchar"><span class="type">guchar</span></a> before passing a possibly
non-ASCII character in.
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>c</tt></i> :</span></td><td>any character
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td><tt class="literal">TRUE</tt> if <i class="parameter"><tt>c</tt></i> is an ASCII digit.


</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3102281"></a><h3><a name="g-ascii-isgraph"></a>g_ascii_isgraph ()</h3><a class="indexterm" name="id3102291"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a>    g_ascii_isgraph                 (<a href="glib-Basic-Types.html#gchar">gchar</a> c);</pre><p>
Determines whether a character is a printing character and not a space.
</p><p>
Unlike the standard C library <tt class="function">isgraph()</tt> function, 
this only recognizes standard ASCII characters and ignores the locale, 
returning <tt class="literal">FALSE</tt> for all non-ASCII characters. Also unlike the standard
library function, this takes a <span class="type">char</span>, not an <span class="type">int</span>, 
so don't call it on <tt class="literal">EOF</tt> but no need to cast to <a href="glib-Basic-Types.html#guchar"><span class="type">guchar</span></a> before passing a 
possibly non-ASCII character in.
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>c</tt></i> :</span></td><td>any character
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td><tt class="literal">TRUE</tt> if <i class="parameter"><tt>c</tt></i> is an ASCII printing character other than space.


</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3102406"></a><h3><a name="g-ascii-islower"></a>g_ascii_islower ()</h3><a class="indexterm" name="id3102418"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a>    g_ascii_islower                 (<a href="glib-Basic-Types.html#gchar">gchar</a> c);</pre><p>
Determines whether a character is an ASCII lower case letter.
</p><p>
Unlike the standard C library <tt class="function">islower()</tt> function, 
this only recognizes standard ASCII letters and ignores the locale,
returning <tt class="literal">FALSE</tt> for all non-ASCII characters. Also unlike the standard
library function, this takes a <span class="type">char</span>, not an <span class="type">int</span>, 
so don't call it on <tt class="literal">EOF</tt> but no need to worry about casting to <a href="glib-Basic-Types.html#guchar"><span class="type">guchar</span></a> 
before passing a possibly non-ASCII character in.
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>c</tt></i> :</span></td><td>any character
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td><tt class="literal">TRUE</tt> if <i class="parameter"><tt>c</tt></i> is an ASCII lower case letter


</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3102532"></a><h3><a name="g-ascii-isprint"></a>g_ascii_isprint ()</h3><a class="indexterm" name="id3102543"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a>    g_ascii_isprint                 (<a href="glib-Basic-Types.html#gchar">gchar</a> c);</pre><p>
Determines whether a character is a printing character.
</p><p>
Unlike the standard C library <tt class="function">isprint()</tt> function, 
this only recognizes standard ASCII characters and ignores the locale, 
returning <tt class="literal">FALSE</tt> for all non-ASCII characters. Also unlike the standard
library function, this takes a <span class="type">char</span>, not an <span class="type">int</span>, 
so don't call it on <tt class="literal">EOF</tt> but no need to cast to <a href="glib-Basic-Types.html#guchar"><span class="type">guchar</span></a> before passing a 
possibly non-ASCII character in.
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>c</tt></i> :</span></td><td>any character
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td><tt class="literal">TRUE</tt> if <i class="parameter"><tt>c</tt></i> is an ASCII printing character.


</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3102658"></a><h3><a name="g-ascii-ispunct"></a>g_ascii_ispunct ()</h3><a class="indexterm" name="id3102669"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a>    g_ascii_ispunct                 (<a href="glib-Basic-Types.html#gchar">gchar</a> c);</pre><p>
Determines whether a character is a punctuation character.
</p><p>
Unlike the standard C library <tt class="function">ispunct()</tt> function, 
this only recognizes standard ASCII letters and ignores the locale, 
returning <tt class="literal">FALSE</tt> for all non-ASCII characters. Also unlike the standard
library function, this takes a <span class="type">char</span>, not an <span class="type">int</span>, 
so don't call it on <tt class="literal">EOF</tt> but no need to cast to <a href="glib-Basic-Types.html#guchar"><span class="type">guchar</span></a> before passing a 
possibly non-ASCII character in.
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>c</tt></i> :</span></td><td>any character
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td><tt class="literal">TRUE</tt> if <i class="parameter"><tt>c</tt></i> is an ASCII punctuation character.


</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3102784"></a><h3><a name="g-ascii-isspace"></a>g_ascii_isspace ()</h3><a class="indexterm" name="id3102795"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a>    g_ascii_isspace                 (<a href="glib-Basic-Types.html#gchar">gchar</a> c);</pre><p>
Determines whether a character is a white-space character.
</p><p>
Unlike the standard C library <tt class="function">isspace()</tt> function, 
this only recognizes standard ASCII white-space and ignores the locale, 
returning <tt class="literal">FALSE</tt> for all non-ASCII characters. Also unlike the standard
library function, this takes a <span class="type">char</span>, not an <span class="type">int</span>, 
so don't call it on <tt class="literal">EOF</tt> but no need to cast to <a href="glib-Basic-Types.html#guchar"><span class="type">guchar</span></a> before passing a 
possibly non-ASCII character in.
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>c</tt></i> :</span></td><td>any character
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td><tt class="literal">TRUE</tt> if <i class="parameter"><tt>c</tt></i> is an ASCII white-space character


</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3102910"></a><h3><a name="g-ascii-isupper"></a>g_ascii_isupper ()</h3><a class="indexterm" name="id3102921"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a>    g_ascii_isupper                 (<a href="glib-Basic-Types.html#gchar">gchar</a> c);</pre><p>
Determines whether a character is an ASCII upper case letter.
</p><p>
Unlike the standard C library <tt class="function">isupper()</tt> function, 
this only recognizes standard ASCII letters and ignores the locale, 
returning <tt class="literal">FALSE</tt> for all non-ASCII characters. Also unlike the standard
library function, this takes a <span class="type">char</span>, not an <span class="type">int</span>, 
so don't call it on <tt class="literal">EOF</tt> but no need to worry about casting to <a href="glib-Basic-Types.html#guchar"><span class="type">guchar</span></a> 
before passing a possibly non-ASCII character in.
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>c</tt></i> :</span></td><td>any character
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td><tt class="literal">TRUE</tt> if <i class="parameter"><tt>c</tt></i> is an ASCII upper case letter


</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3103035"></a><h3><a name="g-ascii-isxdigit"></a>g_ascii_isxdigit ()</h3><a class="indexterm" name="id3103046"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a>    g_ascii_isxdigit                (<a href="glib-Basic-Types.html#gchar">gchar</a> c);</pre><p>
Determines whether a character is a hexadecimal-digit character.
</p><p>
Unlike the standard C library <tt class="function">isxdigit()</tt> function,
this takes a <span class="type">char</span>, not an <span class="type">int</span>, so
don't call it on <tt class="literal">EOF</tt> but no need to cast to <a href="glib-Basic-Types.html#guchar"><span class="type">guchar</span></a> before passing a
possibly non-ASCII character in.
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>c</tt></i> :</span></td><td>any character
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td><tt class="literal">TRUE</tt> if <i class="parameter"><tt>c</tt></i> is an ASCII hexadecimal-digit character.


</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3103152"></a><h3><a name="g-ascii-digit-value"></a>g_ascii_digit_value ()</h3><a class="indexterm" name="id3103164"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gint">gint</a>        g_ascii_digit_value             (<a href="glib-Basic-Types.html#gchar">gchar</a> c);</pre><p>
Determines the numeric value of a character as a decimal
digit. Differs from <a href="glib-Unicode-Manipulation.html#g-unichar-digit-value"><tt class="function">g_unichar_digit_value()</tt></a> because it takes
a char, so there's no worry about sign extension if characters
are signed.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>c</tt></i> :</span></td><td> an ASCII character.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> If <i class="parameter"><tt>c</tt></i> is a decimal digit (according to
<a href="glib-String-Utility-Functions.html#g-ascii-isdigit"><tt class="function">g_ascii_isdigit()</tt></a>), its numeric value. Otherwise, -1.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3103256"></a><h3><a name="g-ascii-xdigit-value"></a>g_ascii_xdigit_value ()</h3><a class="indexterm" name="id3103267"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gint">gint</a>        g_ascii_xdigit_value            (<a href="glib-Basic-Types.html#gchar">gchar</a> c);</pre><p>
Determines the numeric value of a character as a hexidecimal
digit. Differs from <a href="glib-Unicode-Manipulation.html#g-unichar-xdigit-value"><tt class="function">g_unichar_xdigit_value()</tt></a> because it takes
a char, so there's no worry about sign extension if characters
are signed.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>c</tt></i> :</span></td><td> an ASCII character.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> If <i class="parameter"><tt>c</tt></i> is a hex digit (according to
<a href="glib-String-Utility-Functions.html#g-ascii-isxdigit"><tt class="function">g_ascii_isxdigit()</tt></a>), its numeric value. Otherwise, -1.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3103360"></a><h3><a name="g-ascii-strcasecmp"></a>g_ascii_strcasecmp ()</h3><a class="indexterm" name="id3103372"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gint">gint</a>        g_ascii_strcasecmp              (const <a href="glib-Basic-Types.html#gchar">gchar</a> *s1,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *s2);</pre><p>
Compare two strings, ignoring the case of ASCII characters.
</p><p>
Unlike the BSD <tt class="function">strcasecmp()</tt> function, this only recognizes standard
ASCII letters and ignores the locale, treating all non-ASCII
characters as if they are not letters.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>s1</tt></i> :</span></td><td> string to compare with <i class="parameter"><tt>s2</tt></i>.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>s2</tt></i> :</span></td><td> string to compare with <i class="parameter"><tt>s1</tt></i>.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> an integer less than, equal to, or greater than
              zero if <i class="parameter"><tt>s1</tt></i> is found, respectively, to be less than,
              to match, or to be greater than <i class="parameter"><tt>s2</tt></i>.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3103496"></a><h3><a name="g-ascii-strncasecmp"></a>g_ascii_strncasecmp ()</h3><a class="indexterm" name="id3103508"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gint">gint</a>        g_ascii_strncasecmp             (const <a href="glib-Basic-Types.html#gchar">gchar</a> *s1,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *s2,
                                             <a href="glib-Basic-Types.html#gsize">gsize</a> n);</pre><p>
Compare <i class="parameter"><tt>s1</tt></i> and <i class="parameter"><tt>s2</tt></i>, ignoring the case of ASCII characters and any
characters after the first <i class="parameter"><tt>n</tt></i> in each string.
</p><p>
Unlike the BSD <tt class="function">strcasecmp()</tt> function, this only recognizes standard
ASCII letters and ignores the locale, treating all non-ASCII
characters as if they are not letters.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>s1</tt></i> :</span></td><td> string to compare with <i class="parameter"><tt>s2</tt></i>.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>s2</tt></i> :</span></td><td> string to compare with <i class="parameter"><tt>s1</tt></i>.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>n</tt></i> :</span></td><td>  number of characters to compare.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> an integer less than, equal to, or greater than zero
              if the first <i class="parameter"><tt>n</tt></i> bytes of <i class="parameter"><tt>s1</tt></i> is found, respectively,
              to be less than, to match, or to be greater than the
              first <i class="parameter"><tt>n</tt></i> bytes of <i class="parameter"><tt>s2</tt></i>.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3103682"></a><h3><a name="g-ascii-strup"></a>g_ascii_strup ()</h3><a class="indexterm" name="id3103693"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_ascii_strup                   (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str,
                                             <a href="glib-Basic-Types.html#gssize">gssize</a> len);</pre><p>
Converts all lower case ASCII letters to upper case ASCII letters.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>str</tt></i> :</span></td><td> a string.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>len</tt></i> :</span></td><td> length of <i class="parameter"><tt>str</tt></i> in bytes, or -1 if <i class="parameter"><tt>str</tt></i> is nul-terminated.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a newly allocated string, with all the lower case
              characters in <i class="parameter"><tt>str</tt></i> converted to upper case, with
              semantics that exactly match <a href="glib-String-Utility-Functions.html#g-ascii-toupper"><tt class="function">g_ascii_toupper()</tt></a>. (Note
              that this is unlike the old <a href="glib-String-Utility-Functions.html#g-strup"><tt class="function">g_strup()</tt></a>, which modified
              the string in place.)
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3103817"></a><h3><a name="g-ascii-strdown"></a>g_ascii_strdown ()</h3><a class="indexterm" name="id3103828"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_ascii_strdown                 (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str,
                                             <a href="glib-Basic-Types.html#gssize">gssize</a> len);</pre><p>
Converts all upper case ASCII letters to lower case ASCII letters.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>str</tt></i> :</span></td><td> a string.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>len</tt></i> :</span></td><td> length of <i class="parameter"><tt>str</tt></i> in bytes, or -1 if <i class="parameter"><tt>str</tt></i> is nul-terminated.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a newly-allocated string, with all the upper case
              characters in <i class="parameter"><tt>str</tt></i> converted to lower case, with
              semantics that exactly match <a href="glib-String-Utility-Functions.html#g-ascii-tolower"><tt class="function">g_ascii_tolower()</tt></a>. (Note
              that this is unlike the old <a href="glib-String-Utility-Functions.html#g-strdown"><tt class="function">g_strdown()</tt></a>, which modified
              the string in place.)
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3103952"></a><h3><a name="g-ascii-tolower"></a>g_ascii_tolower ()</h3><a class="indexterm" name="id3103963"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>       g_ascii_tolower                 (<a href="glib-Basic-Types.html#gchar">gchar</a> c);</pre><p>
Convert a character to ASCII lower case.
</p><p>
Unlike the standard C library <tt class="function">tolower()</tt> function, this only
recognizes standard ASCII letters and ignores the locale, returning
all non-ASCII characters unchanged, even if they are lower case
letters in a particular character set. Also unlike the standard
library function, this takes and returns a char, not an int, so
don't call it on <tt class="literal">EOF</tt> but no need to worry about casting to <a href="glib-Basic-Types.html#guchar"><span class="type">guchar</span></a>
before passing a possibly non-ASCII character in.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>c</tt></i> :</span></td><td> any character.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the result of converting <i class="parameter"><tt>c</tt></i> to lower case.
              If <i class="parameter"><tt>c</tt></i> is not an ASCII upper case letter,
              <i class="parameter"><tt>c</tt></i> is returned unchanged.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3104078"></a><h3><a name="g-ascii-toupper"></a>g_ascii_toupper ()</h3><a class="indexterm" name="id3104089"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>       g_ascii_toupper                 (<a href="glib-Basic-Types.html#gchar">gchar</a> c);</pre><p>
Convert a character to ASCII upper case.
</p><p>
Unlike the standard C library <tt class="function">toupper()</tt> function, this only
recognizes standard ASCII letters and ignores the locale, returning
all non-ASCII characters unchanged, even if they are upper case
letters in a particular character set. Also unlike the standard
library function, this takes and returns a char, not an int, so
don't call it on <tt class="literal">EOF</tt> but no need to worry about casting to <a href="glib-Basic-Types.html#guchar"><span class="type">guchar</span></a>
before passing a possibly non-ASCII character in.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>c</tt></i> :</span></td><td> any character.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the result of converting <i class="parameter"><tt>c</tt></i> to upper case.
              If <i class="parameter"><tt>c</tt></i> is not an ASCII lower case letter,
              <i class="parameter"><tt>c</tt></i> is returned unchanged.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3104203"></a><h3><a name="g-string-ascii-up"></a>g_string_ascii_up ()</h3><a class="indexterm" name="id3104214"></a><pre class="programlisting"><a href="glib-Strings.html#GString">GString</a>*    g_string_ascii_up               (<a href="glib-Strings.html#GString">GString</a> *string);</pre><p>
Converts all lower case ASCII letters to upper case ASCII letters.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>string</tt></i> :</span></td><td> a GString
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> passed-in <i class="parameter"><tt>string</tt></i> pointer, with all the lower case
              characters converted to upper case in place, with
              semantics that exactly match g_ascii_toupper.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3104283"></a><h3><a name="g-string-ascii-down"></a>g_string_ascii_down ()</h3><a class="indexterm" name="id3104295"></a><pre class="programlisting"><a href="glib-Strings.html#GString">GString</a>*    g_string_ascii_down             (<a href="glib-Strings.html#GString">GString</a> *string);</pre><p>
Converts all upper case ASCII letters to lower case ASCII letters.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>string</tt></i> :</span></td><td> a GString
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> passed-in <i class="parameter"><tt>string</tt></i> pointer, with all the upper case
              characters converted to lower case in place, with
              semantics that exactly match g_ascii_tolower.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3104364"></a><h3><a name="g-strup"></a>g_strup ()</h3><a class="indexterm" name="id3104374"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_strup                         (<a href="glib-Basic-Types.html#gchar">gchar</a> *string);</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><tt class="literal">g_strup</tt> is deprecated and should not be used in newly-written code. This function is totally broken for the reasons discussed in 
the <a href="glib-String-Utility-Functions.html#g-strncasecmp"><tt class="function">g_strncasecmp()</tt></a> docs - use <a href="glib-String-Utility-Functions.html#g-ascii-strup"><tt class="function">g_ascii_strup()</tt></a> or <a href="glib-Unicode-Manipulation.html#g-utf8-strup"><tt class="function">g_utf8_strup()</tt></a> instead.</p></div><p>
Converts a string to upper case.</p><p>
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>string</tt></i> :</span></td><td> the string to convert.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the string

</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3104482"></a><h3><a name="g-strdown"></a>g_strdown ()</h3><a class="indexterm" name="id3104492"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_strdown                       (<a href="glib-Basic-Types.html#gchar">gchar</a> *string);</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><tt class="literal">g_strdown</tt> is deprecated and should not be used in newly-written code. This function is totally broken for the reasons discussed in 
the <a href="glib-String-Utility-Functions.html#g-strncasecmp"><tt class="function">g_strncasecmp()</tt></a> docs - use <a href="glib-String-Utility-Functions.html#g-ascii-strdown"><tt class="function">g_ascii_strdown()</tt></a> or <a href="glib-Unicode-Manipulation.html#g-utf8-strdown"><tt class="function">g_utf8_strdown()</tt></a> 
instead.</p></div><p>
Converts a string to lower case.</p><p>
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>string</tt></i> :</span></td><td> the string to convert.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the string 

</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3104600"></a><h3><a name="g-strcasecmp"></a>g_strcasecmp ()</h3><a class="indexterm" name="id3104611"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gint">gint</a>        g_strcasecmp                    (const <a href="glib-Basic-Types.html#gchar">gchar</a> *s1,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *s2);</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><tt class="literal">g_strcasecmp</tt> is deprecated and should not be used in newly-written code. See <a href="glib-String-Utility-Functions.html#g-strncasecmp"><tt class="function">g_strncasecmp()</tt></a> for a discussion of why this function is 
  deprecated and how to replace it.</p></div><p>
A case-insensitive string comparison, corresponding to the standard
<tt class="function">strcasecmp()</tt> function on platforms which support it.</p><p>
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>s1</tt></i> :</span></td><td> a string.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>s2</tt></i> :</span></td><td> a string to compare with <i class="parameter"><tt>s1</tt></i>.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> 0 if the strings match, a negative value if <i class="parameter"><tt>s1</tt></i> &lt; <i class="parameter"><tt>s2</tt></i>, 
  or a positive value if <i class="parameter"><tt>s1</tt></i> &gt; <i class="parameter"><tt>s2</tt></i>.

</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3104757"></a><h3><a name="g-strncasecmp"></a>g_strncasecmp ()</h3><a class="indexterm" name="id3104768"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gint">gint</a>        g_strncasecmp                   (const <a href="glib-Basic-Types.html#gchar">gchar</a> *s1,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *s2,
                                             <a href="glib-Basic-Types.html#guint">guint</a> n);</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><tt class="literal">g_strncasecmp</tt> is deprecated and should not be used in newly-written code. The problem with <a href="glib-String-Utility-Functions.html#g-strncasecmp"><tt class="function">g_strncasecmp()</tt></a> is that it does the 
comparison by calling <tt class="function">toupper()</tt>/<tt class="function">tolower()</tt>. These functions are
locale-specific and operate on single bytes. However, it is impossible
to handle things correctly from an I18N standpoint by operating on
bytes, since characters may be multibyte. Thus <a href="glib-String-Utility-Functions.html#g-strncasecmp"><tt class="function">g_strncasecmp()</tt></a> is
broken if your string is guaranteed to be ASCII, since it's
locale-sensitive, and it's broken if your string is localized, since
it doesn't work on many encodings at all, including UTF-8, EUC-JP,
etc.
</p><p>
There are therefore two replacement functions: <a href="glib-String-Utility-Functions.html#g-ascii-strncasecmp"><tt class="function">g_ascii_strncasecmp()</tt></a>,
which only works on ASCII and is not locale-sensitive, and
<a href="glib-Unicode-Manipulation.html#g-utf8-casefold"><tt class="function">g_utf8_casefold()</tt></a>, which is good for case-insensitive sorting of UTF-8.</p></div><p>
A case-insensitive string comparison, corresponding to the standard
<tt class="function">strncasecmp()</tt> function on platforms which support it.
It is similar to <a href="glib-String-Utility-Functions.html#g-strcasecmp"><tt class="function">g_strcasecmp()</tt></a> except it only compares the first <i class="parameter"><tt>n</tt></i> 
characters of the strings.</p><p>
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>s1</tt></i> :</span></td><td> a string.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>s2</tt></i> :</span></td><td> a string to compare with <i class="parameter"><tt>s1</tt></i>.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>n</tt></i> :</span></td><td> the maximum number of characters to compare.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> 0 if the strings match, a negative value if <i class="parameter"><tt>s1</tt></i> &lt; <i class="parameter"><tt>s2</tt></i>, 
  or a positive value if <i class="parameter"><tt>s1</tt></i> &gt; <i class="parameter"><tt>s2</tt></i>.

</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3105021"></a><h3><a name="g-strreverse"></a>g_strreverse ()</h3><a class="indexterm" name="id3105032"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_strreverse                    (<a href="glib-Basic-Types.html#gchar">gchar</a> *string);</pre><p>
Reverses all of the bytes in a string.
For example, <tt class="literal">g_strreverse ("abcdef")</tt> will result in "fedcba".
</p><p>
Note that <a href="glib-String-Utility-Functions.html#g-strreverse"><tt class="function">g_strreverse()</tt></a> doesn't work on UTF-8 strings containing multibyte characters. 
For that purpose, use <a href="glib-Unicode-Manipulation.html#g-utf8-strreverse"><tt class="function">g_utf8_strreverse()</tt></a>.
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>string</tt></i> :</span></td><td>the string to reverse.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the same pointer passed in as <i class="parameter"><tt>string</tt></i>.


</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3105130"></a><h3><a name="g-ascii-strtoull"></a>g_ascii_strtoull ()</h3><a class="indexterm" name="id3105141"></a><pre class="programlisting"><a href="glib-Basic-Types.html#guint64">guint64</a>     g_ascii_strtoull                (const <a href="glib-Basic-Types.html#gchar">gchar</a> *nptr,
                                             <a href="glib-Basic-Types.html#gchar">gchar</a> **endptr,
                                             <a href="glib-Basic-Types.html#guint">guint</a> base);</pre><p>
Converts a string to a <a href="glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> value.
This function behaves like the standard <tt class="function">strtoull()</tt> function
does in the C locale. It does this without actually
changing the current locale, since that would not be
thread-safe.
</p><p>
This function is typically used when reading configuration
files or other non-user input that should be locale independent.
To handle input from the user you should normally use the
locale-sensitive system <tt class="function">strtoull()</tt> function.
</p><p>
If the correct value would cause overflow, <tt class="literal">G_MAXUINT64</tt>
is returned, and <tt class="literal">ERANGE</tt> is stored in <tt class="literal">errno</tt>.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>nptr</tt></i> :</span></td><td>    the string to convert to a numeric value.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>endptr</tt></i> :</span></td><td>  if non-<tt class="literal">NULL</tt>, it returns the character after
          the last character used in the conversion.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>base</tt></i> :</span></td><td>    to be used for the conversion, 2..36 or 0
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the <a href="glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> value.

</td></tr></tbody></table></div><p>Since  2.2
</p></div><hr><div class="refsect2" lang="en"><a name="id3105326"></a><h3><a name="G-ASCII-DTOSTR-BUF-SIZE-CAPS"></a>G_ASCII_DTOSTR_BUF_SIZE</h3><a class="indexterm" name="id3105339"></a><pre class="programlisting">#define G_ASCII_DTOSTR_BUF_SIZE (29 + 10)
</pre><p>
A good size for a buffer to be passed into <a href="glib-String-Utility-Functions.html#g-ascii-dtostr"><tt class="function">g_ascii_dtostr()</tt></a>.
It is guaranteed to be enough for all output of that function on systems with
 64bit IEEE-compatible doubles.
</p><p>
The typical usage would be something like:
</p><div class="informalexample"><pre class="programlisting">
  char buf[G_ASCII_DTOSTR_BUF_SIZE];

  fprintf (out, "value=%s\n", g_ascii_dtostr (buf, sizeof (buf), value));
</pre></div><p>
</p></div><hr><div class="refsect2" lang="en"><a name="id3105382"></a><h3><a name="g-ascii-strtod"></a>g_ascii_strtod ()</h3><a class="indexterm" name="id3105393"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gdouble">gdouble</a>     g_ascii_strtod                  (const <a href="glib-Basic-Types.html#gchar">gchar</a> *nptr,
                                             <a href="glib-Basic-Types.html#gchar">gchar</a> **endptr);</pre><p>
Converts a string to a <a href="glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> value.
This function behaves like the standard <tt class="function">strtod()</tt> function
does in the C locale. It does this without actually
changing the current locale, since that would not be
thread-safe.
</p><p>
This function is typically used when reading configuration
files or other non-user input that should be locale independent.
To handle input from the user you should normally use the
locale-sensitive system <tt class="function">strtod()</tt> function.
</p><p>
To convert from a <a href="glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> to a string in a locale-insensitive
way, use <a href="glib-String-Utility-Functions.html#g-ascii-dtostr"><tt class="function">g_ascii_dtostr()</tt></a>.
</p><p>
If the correct value would cause overflow, plus or minus <tt class="literal">HUGE_VAL</tt>
is returned (according to the sign of the value), and <tt class="literal">ERANGE</tt> is
stored in <tt class="literal">errno</tt>. If the correct value would cause underflow,
zero is returned and <tt class="literal">ERANGE</tt> is stored in <tt class="literal">errno</tt>.
</p><p>
This function resets <tt class="literal">errno</tt> before calling <tt class="function">strtod()</tt> so that
you can reliably detect overflow and underflow.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>nptr</tt></i> :</span></td><td>    the string to convert to a numeric value.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>endptr</tt></i> :</span></td><td>  if non-<tt class="literal">NULL</tt>, it returns the character after
          the last character used in the conversion.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the <a href="glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> value.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3105608"></a><h3><a name="g-ascii-dtostr"></a>g_ascii_dtostr ()</h3><a class="indexterm" name="id3105619"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_ascii_dtostr                  (<a href="glib-Basic-Types.html#gchar">gchar</a> *buffer,
                                             <a href="glib-Basic-Types.html#gint">gint</a> buf_len,
                                             <a href="glib-Basic-Types.html#gdouble">gdouble</a> d);</pre><p>
Converts a <a href="glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> to a string, using the '.' as
decimal point. 
</p><p>
This functions generates enough precision that converting
the string back using <a href="glib-String-Utility-Functions.html#g-ascii-strtod"><tt class="function">g_ascii_strtod()</tt></a> gives the same machine-number
(on machines with IEEE compatible 64bit doubles). It is
guaranteed that the size of the resulting string will never
be larger than <i class="parameter"><tt>G_ASCII_DTOSTR_BUF_SIZE</tt></i> bytes.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>buffer</tt></i> :</span></td><td> A buffer to place the resulting string in
</td></tr><tr><td><span class="term"><i class="parameter"><tt>buf_len</tt></i> :</span></td><td> The length of the buffer.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>d</tt></i> :</span></td><td> The <a href="glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> to convert
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> The pointer to the buffer with the converted string.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3105764"></a><h3><a name="g-ascii-formatd"></a>g_ascii_formatd ()</h3><a class="indexterm" name="id3105776"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_ascii_formatd                 (<a href="glib-Basic-Types.html#gchar">gchar</a> *buffer,
                                             <a href="glib-Basic-Types.html#gint">gint</a> buf_len,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *format,
                                             <a href="glib-Basic-Types.html#gdouble">gdouble</a> d);</pre><p>
Converts a <a href="glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> to a string, using the '.' as
decimal point. To format the number you pass in
a <tt class="function">printf()</tt>-style format string. Allowed conversion
specifiers are 'e', 'E', 'f', 'F', 'g' and 'G'. 
</p><p>
If you just want to want to serialize the value into a
string, use <a href="glib-String-Utility-Functions.html#g-ascii-dtostr"><tt class="function">g_ascii_dtostr()</tt></a>.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>buffer</tt></i> :</span></td><td> A buffer to place the resulting string in
</td></tr><tr><td><span class="term"><i class="parameter"><tt>buf_len</tt></i> :</span></td><td> The length of the buffer.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>format</tt></i> :</span></td><td> The <tt class="function">printf()</tt>-style format to use for the
         code to use for converting. 
</td></tr><tr><td><span class="term"><i class="parameter"><tt>d</tt></i> :</span></td><td> The <a href="glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> to convert
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> The pointer to the buffer with the converted string.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3105956"></a><h3><a name="g-strtod"></a>g_strtod ()</h3><a class="indexterm" name="id3105967"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gdouble">gdouble</a>     g_strtod                        (const <a href="glib-Basic-Types.html#gchar">gchar</a> *nptr,
                                             <a href="glib-Basic-Types.html#gchar">gchar</a> **endptr);</pre><p>
Converts a string to a <a href="glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> value.
It calls the standard <tt class="function">strtod()</tt> function to handle the conversion, but
if the string is not completely converted it attempts the conversion
again with <a href="glib-String-Utility-Functions.html#g-ascii-strtod"><tt class="function">g_ascii_strtod()</tt></a>, and returns the best match.
</p><p>
This function should seldomly be used. The normal situation when reading
numbers not for human consumption is to use <a href="glib-String-Utility-Functions.html#g-ascii-strtod"><tt class="function">g_ascii_strtod()</tt></a>. Only when
you know that you must expect both locale formatted and C formatted numbers
should you use this. Make sure that you don't pass strings such as comma
separated lists of values, since the commas may be interpreted as a decimal
point in some locales, causing unexpected results.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>nptr</tt></i> :</span></td><td>    the string to convert to a numeric value.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>endptr</tt></i> :</span></td><td>  if non-<tt class="literal">NULL</tt>, it returns the character after
          the last character used in the conversion.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the <a href="glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> value.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3106116"></a><h3><a name="g-strchug"></a>g_strchug ()</h3><a class="indexterm" name="id3106127"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_strchug                       (<a href="glib-Basic-Types.html#gchar">gchar</a> *string);</pre><p>
Removes leading whitespace from a string, by moving the rest of the
characters forward.
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>string</tt></i> :</span></td><td>a string to remove the leading whitespace from.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td><i class="parameter"><tt>string</tt></i>.


</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3106190"></a><h3><a name="g-strchomp"></a>g_strchomp ()</h3><a class="indexterm" name="id3106201"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_strchomp                      (<a href="glib-Basic-Types.html#gchar">gchar</a> *string);</pre><p>
Removes trailing whitespace from a string.
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>string</tt></i> :</span></td><td>a string to remove the trailing whitespace from.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td><i class="parameter"><tt>string</tt></i>.


</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3106263"></a><h3><a name="g-strstrip"></a>g_strstrip()</h3><a class="indexterm" name="id3106274"></a><pre class="programlisting">#define     g_strstrip( string )</pre><p>
Removes leading and trailing whitespace from a string.
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>string</tt></i> :</span></td><td>a string to remove the leading and trailing whitespace from.


</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3106309"></a><h3><a name="g-strdelimit"></a>g_strdelimit ()</h3><a class="indexterm" name="id3106320"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_strdelimit                    (<a href="glib-Basic-Types.html#gchar">gchar</a> *string,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *delimiters,
                                             <a href="glib-Basic-Types.html#gchar">gchar</a> new_delimiter);</pre><p>
Converts any delimiter characters in <i class="parameter"><tt>string</tt></i> to <i class="parameter"><tt>new_delimiter</tt></i>.
Any characters in <i class="parameter"><tt>string</tt></i> which are found in <i class="parameter"><tt>delimiters</tt></i> are changed
to the <i class="parameter"><tt>new_delimiter</tt></i> character. Modifies <i class="parameter"><tt>string</tt></i> in place, and returns 
<i class="parameter"><tt>string</tt></i> itself, not a copy. The return value is to allow nesting such as
<tt class="literal">g_ascii_strup (g_strdelimit (str, "abc", '?'))</tt>.
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>string</tt></i> :</span></td><td>the string to convert.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>delimiters</tt></i> :</span></td><td>a string containing the current delimiters, or <tt class="literal">NULL</tt> to use the
standard delimiters defined in <a href="glib-String-Utility-Functions.html#G-STR-DELIMITERS-CAPS"><span class="type">G_STR_DELIMITERS</span></a>.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>new_delimiter</tt></i> :</span></td><td>the new delimiter character.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td><i class="parameter"><tt>string</tt></i>.


</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3106493"></a><h3><a name="G-STR-DELIMITERS-CAPS"></a>G_STR_DELIMITERS</h3><a class="indexterm" name="id3106504"></a><pre class="programlisting">#define	 G_STR_DELIMITERS	"_-|&gt; &lt;."
</pre><p>
The standard delimiters, used in <a href="glib-String-Utility-Functions.html#g-strdelimit"><tt class="function">g_strdelimit()</tt></a>.
</p></div><hr><div class="refsect2" lang="en"><a name="id3106531"></a><h3><a name="g-strescape"></a>g_strescape ()</h3><a class="indexterm" name="id3106541"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_strescape                     (const <a href="glib-Basic-Types.html#gchar">gchar</a> *source,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *exceptions);</pre><p>
Escapes the special characters '\b', '\f', '\n', '\r', '\t', '\' and
'"' in the string <i class="parameter"><tt>source</tt></i> by inserting a '\' before
them. Additionally all characters in the range 0x01-0x1F (everything
below SPACE) and in the range 0x7F-0xFF (all non-ASCII chars) are
replaced with a '\' followed by their octal representation. Characters
supplied in <i class="parameter"><tt>exceptions</tt></i> are not escaped.
</p><p>
<a href="glib-String-Utility-Functions.html#g-strcompress"><tt class="function">g_strcompress()</tt></a> does the reverse conversion.
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>source</tt></i> :</span></td><td>a string to escape.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>exceptions</tt></i> :</span></td><td>a string of characters not to escape in <i class="parameter"><tt>source</tt></i>.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>a newly-allocated copy of <i class="parameter"><tt>source</tt></i> with certain
characters escaped. See above.


</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3106666"></a><h3><a name="g-strcompress"></a>g_strcompress ()</h3><a class="indexterm" name="id3106677"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_strcompress                   (const <a href="glib-Basic-Types.html#gchar">gchar</a> *source);</pre><p>
Replaces all escaped characters with their one byte equivalent. It
does the reverse conversion of <a href="glib-String-Utility-Functions.html#g-strescape"><tt class="function">g_strescape()</tt></a>. 
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>source</tt></i> :</span></td><td>a string to compress.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>a newly-allocated copy of <i class="parameter"><tt>source</tt></i> with all escaped 
character compressed.


</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3106752"></a><h3><a name="g-strcanon"></a>g_strcanon ()</h3><a class="indexterm" name="id3106763"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_strcanon                      (<a href="glib-Basic-Types.html#gchar">gchar</a> *string,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *valid_chars,
                                             <a href="glib-Basic-Types.html#gchar">gchar</a> substitutor);</pre><p>
For each character in <i class="parameter"><tt>string</tt></i>, if the character is not in <i class="parameter"><tt>valid_chars</tt></i>,
replaces the character with <i class="parameter"><tt>substitutor</tt></i>. Modifies <i class="parameter"><tt>string</tt></i> in place, 
and return <i class="parameter"><tt>string</tt></i> itself, not a copy. The return value is to allow
nesting such as <tt class="literal">g_ascii_strup (g_strcanon (str, "abc", '?'))</tt>.
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>string</tt></i> :</span></td><td>a nul-terminated array of bytes.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>valid_chars</tt></i> :</span></td><td>bytes permitted in <i class="parameter"><tt>string</tt></i>.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>substitutor</tt></i> :</span></td><td>replacement character for disallowed bytes.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td><i class="parameter"><tt>string</tt></i>.


</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3106913"></a><h3><a name="g-strsplit"></a>g_strsplit ()</h3><a class="indexterm" name="id3106924"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>**     g_strsplit                      (const <a href="glib-Basic-Types.html#gchar">gchar</a> *string,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *delimiter,
                                             <a href="glib-Basic-Types.html#gint">gint</a> max_tokens);</pre><p>
Splits a string into a maximum of <i class="parameter"><tt>max_tokens</tt></i> pieces, using the given
<i class="parameter"><tt>delimiter</tt></i>. If <i class="parameter"><tt>max_tokens</tt></i> is reached, the remainder of <i class="parameter"><tt>string</tt></i> is appended
to the last token. 
</p><p>
As a special case, the result of splitting the empty string "" is an empty
vector, not a vector containing a single string. The reason for this
special case is that being able to represent a empty vector is typically
more useful than consistent handling of empty elements. If you do need
to represent empty elements, you'll need to check for the empty string
before calling <a href="glib-String-Utility-Functions.html#g-strsplit"><tt class="function">g_strsplit()</tt></a>.</p><p>
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>string</tt></i> :</span></td><td> a string to split.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>delimiter</tt></i> :</span></td><td> a string which specifies the places at which to split the string.
    The delimiter is not included in any of the resulting strings, unless
    <i class="parameter"><tt>max_tokens</tt></i> is reached.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>max_tokens</tt></i> :</span></td><td> the maximum number of pieces to split <i class="parameter"><tt>string</tt></i> into. If this is
             less than 1, the string is split completely.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a newly-allocated <tt class="literal">NULL</tt>-terminated array of strings. Use 
   <a href="glib-String-Utility-Functions.html#g-strfreev"><tt class="function">g_strfreev()</tt></a> to free it.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3107105"></a><h3><a name="g-strsplit-set"></a>g_strsplit_set ()</h3><a class="indexterm" name="id3107116"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>**     g_strsplit_set                  (const <a href="glib-Basic-Types.html#gchar">gchar</a> *string,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *delimiters,
                                             <a href="glib-Basic-Types.html#gint">gint</a> max_tokens);</pre><p>
Splits <i class="parameter"><tt>string</tt></i> into a number of tokens not containing any of the characters
in <i class="parameter"><tt>delimiter</tt></i>. A token is the (possibly empty) longest string that does not
contain any of the characters in <i class="parameter"><tt>delimiters</tt></i>. If <i class="parameter"><tt>max_tokens</tt></i> is reached, the
remainder is appended to the last token.
</p><p>
For example the result of g_strsplit_set ("abc:def/ghi", ":/", -1) is a
<tt class="literal">NULL</tt>-terminated vector containing the three strings "abc", "def", 
and "ghi".
</p><p>
The result if g_strsplit_set (":def/ghi:", ":/", -1) is a <tt class="literal">NULL</tt>-terminated
vector containing the four strings "", "def", "ghi", and "".
</p><p>
As a special case, the result of splitting the empty string "" is an empty
vector, not a vector containing a single string. The reason for this
special case is that being able to represent a empty vector is typically
more useful than consistent handling of empty elements. If you do need
to represent empty elements, you'll need to check for the empty string
before calling <a href="glib-String-Utility-Functions.html#g-strsplit"><tt class="function">g_strsplit()</tt></a>.
</p><p>
Note that this function works on bytes not characters, so it can't be used 
to delimit UTF-8 strings for anything but ASCII characters.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>string</tt></i> :</span></td><td> The string to be tokenized
</td></tr><tr><td><span class="term"><i class="parameter"><tt>delimiters</tt></i> :</span></td><td> A nul-terminated string containing bytes that are used
             to split the string.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>max_tokens</tt></i> :</span></td><td> The maximum number of tokens to split <i class="parameter"><tt>string</tt></i> into. 
             If this is less than 1, the string is split completely
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a newly-allocated <tt class="literal">NULL</tt>-terminated array of strings. Use 
   <a href="glib-String-Utility-Functions.html#g-strfreev"><tt class="function">g_strfreev()</tt></a> to free it.

</td></tr></tbody></table></div><p>Since  2.4
</p></div><hr><div class="refsect2" lang="en"><a name="id3107326"></a><h3><a name="g-strfreev"></a>g_strfreev ()</h3><a class="indexterm" name="id3107337"></a><pre class="programlisting">void        g_strfreev                      (<a href="glib-Basic-Types.html#gchar">gchar</a> **str_array);</pre><p>
Frees a <tt class="literal">NULL</tt>-terminated array of strings, and the array itself.
If called on a <tt class="literal">NULL</tt> value, <a href="glib-String-Utility-Functions.html#g-strfreev"><tt class="function">g_strfreev()</tt></a> simply returns.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>str_array</tt></i> :</span></td><td> a <tt class="literal">NULL</tt>-terminated array of strings to free.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3107416"></a><h3><a name="g-strconcat"></a>g_strconcat ()</h3><a class="indexterm" name="id3107427"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_strconcat                     (const <a href="glib-Basic-Types.html#gchar">gchar</a> *string1,
                                             ...);</pre><p>
Concatenates all of the given strings into one long string.  The returned string
should be freed when no longer needed.  
</p><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>
The variable argument list <span class="emphasis"><em>must</em></span> end with <tt class="literal">NULL</tt>. 
If you forget the <tt class="literal">NULL</tt>, <a href="glib-String-Utility-Functions.html#g-strconcat"><tt class="function">g_strconcat()</tt></a> will start appending
random memory junk to your string.
</p></div><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>string1</tt></i> :</span></td><td>The first string to add, which must not be <tt class="literal">NULL</tt>.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>...</tt></i> :</span></td><td>a <tt class="literal">NULL</tt>-terminated list of strings to append to the string.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>a newly-allocated string containing all the string arguments.


</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3107545"></a><h3><a name="g-strjoin"></a>g_strjoin ()</h3><a class="indexterm" name="id3107556"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_strjoin                       (const <a href="glib-Basic-Types.html#gchar">gchar</a> *separator,
                                             ...);</pre><p>
Joins a number of strings together to form one long string, with the optional
<i class="parameter"><tt>separator</tt></i> inserted between each of them.
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>separator</tt></i> :</span></td><td>a string to insert between each of the strings, or <tt class="literal">NULL</tt>.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>...</tt></i> :</span></td><td>a <tt class="literal">NULL</tt>-terminated list of strings to join.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>a newly-allocated string containing all of the strings joined
together, with <i class="parameter"><tt>separator</tt></i> between them.


</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3107654"></a><h3><a name="g-strjoinv"></a>g_strjoinv ()</h3><a class="indexterm" name="id3107665"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_strjoinv                      (const <a href="glib-Basic-Types.html#gchar">gchar</a> *separator,
                                             <a href="glib-Basic-Types.html#gchar">gchar</a> **str_array);</pre><p>
Joins a number of strings together to form one long string, with the optional
<i class="parameter"><tt>separator</tt></i> inserted between each of them.
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>separator</tt></i> :</span></td><td>a string to insert between each of the strings, or <tt class="literal">NULL</tt>.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>str_array</tt></i> :</span></td><td>a <tt class="literal">NULL</tt>-terminated array of strings to join.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>a newly-allocated string containing all of the strings joined
together, with <i class="parameter"><tt>separator</tt></i> between them.


</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3107770"></a><h3><a name="g-strerror"></a>g_strerror ()</h3><a class="indexterm" name="id3107781"></a><pre class="programlisting">G_CONST_RETURN <a href="glib-Basic-Types.html#gchar">gchar</a>* g_strerror            (<a href="glib-Basic-Types.html#gint">gint</a> errnum);</pre><p>
Returns a string corresponding to the given error code, e.g. "no such process".
This function is included since not all platforms support the 
<tt class="function">strerror()</tt> function.
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>errnum</tt></i> :</span></td><td>the system error number. See the standard C <tt class="literal">errno</tt>
documentation.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>a string describing the error code.
If the error code is unknown, it returns "unknown error (&lt;code&gt;)".
The string can only be used until the next call to <a href="glib-String-Utility-Functions.html#g-strerror"><tt class="function">g_strerror()</tt></a>.


</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3107872"></a><h3><a name="g-strsignal"></a>g_strsignal ()</h3><a class="indexterm" name="id3107883"></a><pre class="programlisting">G_CONST_RETURN <a href="glib-Basic-Types.html#gchar">gchar</a>* g_strsignal           (<a href="glib-Basic-Types.html#gint">gint</a> signum);</pre><p>
Returns a string describing the given signal, e.g. "Segmentation fault".
This function is included since not all platforms support the
<tt class="function">strsignal()</tt> function.
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>signum</tt></i> :</span></td><td>the signal number. See the <tt class="literal">signal</tt>
documentation.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>a string describing the signal.
If the signal is unknown, it returns "unknown signal (&lt;signum&gt;)".
The string can only be used until the next call to <a href="glib-String-Utility-Functions.html#g-strsignal"><tt class="function">g_strsignal()</tt></a>.


</td></tr></tbody></table></div></div></div></div><table class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle"><td align="left"><a accesskey="p" href="glib-utilities.html"><b>&lt;&lt; GLib Utilities</b></a></td><td align="right"><a accesskey="n" href="glib-Character-Set-Conversion.html"><b>Character Set Conversion &gt;&gt;</b></a></td></tr></table></body></html>