diff options
author | Alex Larsson <alexl@redhat.com> | 2001-10-24 18:00:11 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2001-10-24 18:00:11 +0000 |
commit | 3c39c8fcd01dd9929477488ac9dd713fd0311e9b (patch) | |
tree | 4bbd3634747e13473c531101a38a3ac4f0864d08 /docs | |
parent | b0facb386351269c29cb7afaf8325668f3c3dd01 (diff) |
Add g_strtod & co.
2001-10-24 Alex Larsson <alexl@redhat.com>
* docs/reference/glib/glib-sections.txt:
Add g_strtod & co.
* docs/reference/glib/tmpl/string_utils.sgml:
Add docs for G_ASCII_DTOSTR_BUF_SIZE.
* glib/gstrfuncs.[ch]:
Added g_ascii_strtod, g_ascii_dtostr and g_ascii_formatd.
* tests/Makefile.am:
* tests/strtod-test.c:
Add tests for g_ascii_strtod & co.
Diffstat (limited to 'docs')
-rw-r--r-- | docs/reference/glib/glib-sections.txt | 6 | ||||
-rw-r--r-- | docs/reference/glib/tmpl/string_utils.sgml | 67 |
2 files changed, 64 insertions, 9 deletions
diff --git a/docs/reference/glib/glib-sections.txt b/docs/reference/glib/glib-sections.txt index d42467a79..34d511207 100644 --- a/docs/reference/glib/glib-sections.txt +++ b/docs/reference/glib/glib-sections.txt @@ -922,6 +922,12 @@ g_strncasecmp <SUBSECTION> g_strreverse + +<SUBSECTION> +G_ASCII_DTOSTR_BUF_SIZE +g_ascii_strtod +g_ascii_dtostr +g_ascii_formatd g_strtod <SUBSECTION> diff --git a/docs/reference/glib/tmpl/string_utils.sgml b/docs/reference/glib/tmpl/string_utils.sgml index 065b0b4ec..0135b3bcd 100644 --- a/docs/reference/glib/tmpl/string_utils.sgml +++ b/docs/reference/glib/tmpl/string_utils.sgml @@ -562,19 +562,68 @@ For example, g_strreverse ("abcdef") will result in "fedcba". @Returns: the same pointer passed in as @string. +<!-- ##### MACRO G_ASCII_DTOSTR_BUF_SIZE ##### --> +<para> +A good size for a buffer to be passed into <function>g_ascii_dtostr</function>. +It is guaranteed to be enough for all output of that function on systems with + 64bit IEEE compatible doubles. +</para> +<para> +The typical usage would be something like: +</para> +<para> +<literal> + char buf[G_ASCII_DTOSTR_BUF_SIZE]; + + fprintf (out, "value=%s\n", g_ascii_dtostr (buf, sizeof (buf), value)); +</literal> +</para> + + + +<!-- ##### FUNCTION g_ascii_strtod ##### --> +<para> + +</para> + +@nptr: +@endptr: +@Returns: + + +<!-- ##### FUNCTION g_ascii_dtostr ##### --> +<para> + +</para> + +@buffer: +@buf_len: +@d: +@Returns: +<!-- # Unused Parameters # --> +@format: + + +<!-- ##### FUNCTION g_ascii_formatd ##### --> +<para> + +</para> + +@buffer: +@buf_len: +@format: +@d: +@Returns: + + <!-- ##### FUNCTION g_strtod ##### --> <para> -Converts a string to a gdouble value. -It calls the standard <function>strtod()</function> function -to handle the conversion, but if the string is not completely converted -it attempts the conversion again in the "C" locale, and returns the best -match. + </para> -@nptr: the string to convert to a numeric value. -@endptr: if non-NULL, it returns the character after the last character used -in the conversion. -@Returns: the gdouble value. +@nptr: +@endptr: +@Returns: <!-- ##### FUNCTION g_strchug ##### --> |