Change the format of the revprops block sent in svnserve for
[svn.git] / subversion / libsvn_subr / utf_impl.h
blob61474981bb4ec78c20cb6be347a6c188b848168b
1 /*
2 * utf_impl.h : private header for the charset converstion functions.
4 * ====================================================================
5 * Copyright (c) 2000-2004 CollabNet. All rights reserved.
7 * This software is licensed as described in the file COPYING, which
8 * you should have received as part of this distribution. The terms
9 * are also available at http://subversion.tigris.org/license-1.html.
10 * If newer versions of this license are posted there, you may use a
11 * newer version instead, at your option.
13 * This software consists of voluntary contributions made by many
14 * individuals. For exact contribution history, see the revision
15 * history and logs, available at http://subversion.tigris.org/.
16 * ====================================================================
21 #ifndef SVN_LIBSVN_SUBR_UTF_IMPL_H
22 #define SVN_LIBSVN_SUBR_UTF_IMPL_H
25 #include <apr_pools.h>
26 #include "svn_types.h"
28 #ifdef __cplusplus
29 extern "C" {
30 #endif /* __cplusplus */
33 const char *svn_utf__cstring_from_utf8_fuzzy(const char *src,
34 apr_pool_t *pool,
35 svn_error_t *(*convert_from_utf8)
36 (const char **,
37 const char *,
38 apr_pool_t *));
41 /* Return a pointer to the first character after the last valid UTF-8
42 * multi-byte character in the string SRC of length LEN. If SRC is a valid
43 * UTF-8 the return value will point to the byte after SRC+LEN, otherwise
44 * it will point to the start of the first invalid multi-byte character.
45 * In either case all the characters between SRC and the return pointer are
46 * valid UTF-8.
48 const char *svn_utf__last_valid(const char *src, apr_size_t len);
50 /* Return TRUE if the string SRC of length LEN is a valid UTF-8 encoding
51 * according to the rules laid down by the Unicode 4.0 standard, FALSE
52 * otherwise. This function is faster than svn_utf__last_valid.
54 svn_boolean_t svn_utf__is_valid(const char *src, apr_size_t len);
56 /* As for svn_utf__is_valid but SRC is NULL terminated. */
57 svn_boolean_t svn_utf__cstring_is_valid(const char *src);
59 /* As for svn_utf__last_valid but uses a different implementation without
60 lookup tables. It avoids the table memory use (about 400 bytes) but the
61 function is longer (about 200 bytes extra) and likely to be slower when
62 the string is valid. If the string is invalid this function may be
63 faster since it returns immediately rather than continuing to the end of
64 the string. The main reason this function exists is to test the table
65 driven implementation. */
66 const char *svn_utf__last_valid2(const char *src, apr_size_t len);
68 #ifdef __cplusplus
70 #endif /* __cplusplus */
72 #endif /* SVN_LIBSVN_SUBR_UTF_IMPL_H */