/* {{{ Common functions shared by extensions */
+int php_libxml_xmlCheckUTF8(const unsigned char *s)
+{
+ int i;
+ unsigned char c;
+
+ for (i = 0; (c = s[i++]);) {
+ if ((c & 0x80) == 0) {
+ } else if ((c & 0xe0) == 0xc0) {
+ if ((s[i++] & 0xc0) != 0x80) {
+ return 0;
+ }
+ } else if ((c & 0xf0) == 0xe0) {
+ if ((s[i++] & 0xc0) != 0x80 || (s[i++] & 0xc0) != 0x80) {
+ return 0;
+ }
+ } else if ((c & 0xf8) == 0xf0) {
+ if ((s[i++] & 0xc0) != 0x80 || (s[i++] & 0xc0) != 0x80 || (s[i++] & 0xc0) != 0x80) {
+ return 0;
+ }
+ } else {
+ return 0;
+ }
+ }
+ return 1;
+}
+
int php_libxml_register_export(zend_class_entry *ce, php_libxml_export_node export_function)
{
php_libxml_func_handler export_hnd;
PHP_LIBXML_API void php_libxml_error_handler(void *ctx, const char *msg, ...);
void php_libxml_ctx_warning(void *ctx, const char *msg, ...);
void php_libxml_ctx_error(void *ctx, const char *msg, ...);
+PHP_LIBXML_API int php_libxml_xmlCheckUTF8(const unsigned char *s);
#endif /* HAVE_LIBXML */