Sha256: 626ff03c73a45894ab4156e7d7ca43ab7787251e67ff622fab0983b4015fe0ce

Contents?: true

Size: 1.81 KB

Versions: 5

Compression:

Stored size: 1.81 KB

Contents

#ifndef CMARK_HOUDINI_H
#define CMARK_HOUDINI_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>
#include "config.h"
#include "buffer.h"

#ifdef HAVE___BUILTIN_EXPECT
#	define likely(x)	__builtin_expect((x),1)
#	define unlikely(x)	__builtin_expect((x),0)
#else
#	define likely(x)	(x)
#	define unlikely(x)	(x)
#endif

#ifdef HOUDINI_USE_LOCALE
#	define _isxdigit(c) isxdigit(c)
#	define _isdigit(c) isdigit(c)
#else
/*
 * Helper _isdigit methods -- do not trust the current locale
 * */
#	define _isxdigit(c) (strchr("0123456789ABCDEFabcdef", (c)) != NULL)
#	define _isdigit(c) ((c) >= '0' && (c) <= '9')
#endif

#define HOUDINI_ESCAPED_SIZE(x) (((x) * 12) / 10)
#define HOUDINI_UNESCAPED_SIZE(x) (x)

extern size_t houdini_unescape_ent(cmark_strbuf *ob, const uint8_t *src, size_t size);
extern int houdini_escape_html(cmark_strbuf *ob, const uint8_t *src, size_t size);
extern int houdini_escape_html0(cmark_strbuf *ob, const uint8_t *src, size_t size, int secure);
extern int houdini_unescape_html(cmark_strbuf *ob, const uint8_t *src, size_t size);
extern void houdini_unescape_html_f(cmark_strbuf *ob, const uint8_t *src, size_t size);
extern int houdini_escape_xml(cmark_strbuf *ob, const uint8_t *src, size_t size);
extern int houdini_escape_uri(cmark_strbuf *ob, const uint8_t *src, size_t size);
extern int houdini_escape_url(cmark_strbuf *ob, const uint8_t *src, size_t size);
extern int houdini_escape_href(cmark_strbuf *ob, const uint8_t *src, size_t size);
extern int houdini_unescape_uri(cmark_strbuf *ob, const uint8_t *src, size_t size);
extern int houdini_unescape_url(cmark_strbuf *ob, const uint8_t *src, size_t size);
extern int houdini_escape_js(cmark_strbuf *ob, const uint8_t *src, size_t size);
extern int houdini_unescape_js(cmark_strbuf *ob, const uint8_t *src, size_t size);

#ifdef __cplusplus
}
#endif

#endif

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
commonmarker-0.1.3 ext/commonmarker/cmark/src/houdini.h
commonmarker-0.1.2 ext/commonmarker/cmark/src/houdini.h
commonmarker-0.1.1 ext/commonmarker/cmark/src/houdini.h
commonmarker-0.1.0 ext/commonmarker/cmark/src/houdini.h
commonmarker-0.0.1 ext/commonmarker/cmark/src/houdini.h