~ubuntu-branches/debian/sid/glib2.0/sid

« back to all changes in this revision

Viewing changes to glib/gconvert.c

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2013-05-08 06:25:57 UTC
  • mfrom: (1.27.14) (3.1.181 experimental)
  • Revision ID: package-import@ubuntu.com-20130508062557-i7gbku66mls70gi2
Tags: 2.36.1-2
Merge experimental branch, upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
 
44
44
#include "gconvert.h"
45
45
 
46
 
#include "gcharset.h"
 
46
#include "gcharsetprivate.h"
47
47
#include "gslist.h"
48
48
#include "gstrfuncs.h"
49
49
#include "gtestutils.h"
194
194
 */
195
195
#define NUL_TERMINATOR_LENGTH 4
196
196
 
197
 
GQuark 
198
 
g_convert_error_quark (void)
199
 
{
200
 
  return g_quark_from_static_string ("g_convert_error");
201
 
}
 
197
G_DEFINE_QUARK (g_convert_error, g_convert_error)
202
198
 
203
199
static gboolean
204
200
try_conversion (const char *to_codeset,
233
229
  return FALSE;
234
230
}
235
231
 
236
 
G_GNUC_INTERNAL extern const char ** 
 
232
extern const char **
237
233
_g_charset_get_aliases (const char *canonical_name);
238
234
 
239
235
/**
1500
1496
 * @utf8string:    a UTF-8 encoded string.
1501
1497
 * @len:           the length of the string, or -1 if the string is
1502
1498
 *                 nul-terminated.
1503
 
 * @bytes_read:    location to store the number of bytes in the
1504
 
 *                 input string that were successfully converted, or %NULL.
 
1499
 * @bytes_read:    (out) (allow-none): location to store the number of bytes in
 
1500
 *                 the input string that were successfully converted, or %NULL.
1505
1501
 *                 Even if the conversion was successful, this may be 
1506
1502
 *                 less than @len if there were partial characters
1507
1503
 *                 at the end of the input. If the error
1508
1504
 *                 #G_CONVERT_ERROR_ILLEGAL_SEQUENCE occurs, the value
1509
1505
 *                 stored will the byte offset after the last valid
1510
1506
 *                 input sequence.
1511
 
 * @bytes_written: the number of bytes stored in the output buffer (not 
 
1507
 * @bytes_written: (out): the number of bytes stored in the output buffer (not 
1512
1508
 *                 including the terminating nul).
1513
1509
 * @error:         location to store the error occurring, or %NULL to ignore
1514
1510
 *                 errors. Any of the errors in #GConvertError may occur.
1518
1514
 * on other platforms, this function indirectly depends on the 
1519
1515
 * <link linkend="setlocale">current locale</link>.
1520
1516
 * 
1521
 
 * Return value: The converted string, or %NULL on an error.
 
1517
 * Return value: (array length=bytes_written) (element-type guint8) (transfer full):
 
1518
 *               The converted string, or %NULL on an error.
1522
1519
 **/
1523
1520
gchar*
1524
1521
g_filename_from_utf8 (const gchar *utf8string,
1838
1835
/**
1839
1836
 * g_filename_from_uri:
1840
1837
 * @uri: a uri describing a filename (escaped, encoded in ASCII).
1841
 
 * @hostname: (allow-none): Location to store hostname for the URI, or %NULL.
 
1838
 * @hostname: (out) (allow-none): Location to store hostname for the URI, or %NULL.
1842
1839
 *            If there is no hostname in the URI, %NULL will be
1843
1840
 *            stored in this location.
1844
1841
 * @error: location to store the error occurring, or %NULL to ignore
1847
1844
 * Converts an escaped ASCII-encoded URI to a local filename in the
1848
1845
 * encoding used for filenames. 
1849
1846
 * 
1850
 
 * Return value: a newly-allocated string holding the resulting
1851
 
 *               filename, or %NULL on an error.
 
1847
 * Return value: (type filename): a newly-allocated string holding
 
1848
 *               the resulting filename, or %NULL on an error.
1852
1849
 **/
1853
1850
gchar *
1854
1851
g_filename_from_uri (const gchar *uri,
2079
2076
 * mime type defined in RFC 2483 into individual URIs,
2080
2077
 * discarding any comments. The URIs are not validated.
2081
2078
 *
2082
 
 * Returns: a newly allocated %NULL-terminated list of
2083
 
 *   strings holding the individual URIs. The array should
2084
 
 *   be freed with g_strfreev().
 
2079
 * Returns: (transfer full): a newly allocated %NULL-terminated list
 
2080
 *   of strings holding the individual URIs. The array should be freed
 
2081
 *   with g_strfreev().
2085
2082
 *
2086
2083
 * Since: 2.6
2087
2084
 */