Sha256: c38344ad598602372c1cbd808f31d9e69e0b7372744d4b5cd1411e7fa94d3e18

Contents?: true

Size: 1.47 KB

Versions: 182

Compression:

Stored size: 1.47 KB

Contents

#include "ruby.h"

#ifndef _GENERATOR_UNICODE_H_
#define _GENERATOR_UNICODE_H_

typedef enum {
	conversionOK = 0, 	/* conversion successful */
	sourceExhausted,	/* partial character in source, but hit end */
	targetExhausted,	/* insuff. room in target for conversion */
	sourceIllegal		/* source sequence is illegal/malformed */
} ConversionResult;

typedef enum {
	strictConversion = 0,
	lenientConversion
} ConversionFlags;

typedef unsigned long	UTF32;	/* at least 32 bits */
typedef unsigned short	UTF16;	/* at least 16 bits */
typedef unsigned char	UTF8;	/* typically 8 bits */

#define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD
#define UNI_MAX_BMP (UTF32)0x0000FFFF
#define UNI_MAX_UTF16 (UTF32)0x0010FFFF
#define UNI_MAX_UTF32 (UTF32)0x7FFFFFFF
#define UNI_MAX_LEGAL_UTF32 (UTF32)0x0010FFFF

#define UNI_SUR_HIGH_START  (UTF32)0xD800
#define UNI_SUR_HIGH_END    (UTF32)0xDBFF
#define UNI_SUR_LOW_START   (UTF32)0xDC00
#define UNI_SUR_LOW_END     (UTF32)0xDFFF

static const int halfShift  = 10; /* used for shifting by 10 bits */

static const UTF32 halfBase = 0x0010000UL;
static const UTF32 halfMask = 0x3FFUL;

void JSON_convert_UTF8_to_JSON(VALUE buffer, VALUE string, ConversionFlags flags);

#ifndef RARRAY_PTR
#define RARRAY_PTR(ARRAY) RARRAY(ARRAY)->ptr
#endif
#ifndef RARRAY_LEN
#define RARRAY_LEN(ARRAY) RARRAY(ARRAY)->len
#endif
#ifndef RSTRING_PTR
#define RSTRING_PTR(string) RSTRING(string)->ptr
#endif
#ifndef RSTRING_LEN
#define RSTRING_LEN(string) RSTRING(string)->len
#endif

#endif

Version data entries

182 entries across 161 versions & 20 rubygems

Version Path
poolparty-1.4.5 vendor/gems/json/ext/json/ext/generator/unicode.h
poolparty-1.4.4 vendor/gems/json/ext/json/ext/generator/unicode.h
poolparty-1.4.3 vendor/gems/json/ext/json/ext/generator/unicode.h
poolparty-1.4.2 vendor/gems/json/ext/json/ext/generator/unicode.h
poolparty-1.4.1 vendor/gems/json/ext/json/ext/generator/unicode.h
crazy_ivan-0.3.3 lib/crazy_ivan/vendor/json-1.1.7/ext/json/ext/generator/unicode.h
crazy_ivan-0.3.2 vendor/json-1.1.7/ext/json/ext/generator/unicode.h
middleman-0.12.0.pre lib/middleman/vendor/gems/gems/json_pure-1.2.0/ext/json/ext/generator/unicode.h
middleman-0.12.0.pre lib/middleman/vendor/gems/gems/json-1.2.0/ext/json/ext/generator/unicode.h
merb-core-1.1.0.pre spec10/public/webrat/test_app/gems/gems/json_pure-1.1.3/ext/json/ext/generator/unicode.h
merb-core-1.1.0.pre spec10/public/core_ext/fixtures/gems/gems/json_pure-1.1.3/ext/json/ext/generator/unicode.h
middleman-0.10.17 vendor/gems/gems/json-1.2.0/ext/json/ext/generator/unicode.h
middleman-0.10.16 vendor/gems/gems/json-1.2.0/ext/json/ext/generator/unicode.h
middleman-0.10.15 vendor/gems/gems/json-1.2.0/ext/json/ext/generator/unicode.h
middleman-0.10.14 vendor/gems/gems/json-1.2.0/ext/json/ext/generator/unicode.h
json_pure-1.2.0 ext/json/ext/generator/unicode.h
json-1.2.0 ext/json/ext/generator/unicode.h
poolparty-1.4.0 vendor/gems/json/ext/json/ext/generator/unicode.h
scout-4.0.2 vendor/json_pure/ext/json/ext/generator/unicode.h
scout-4.0.1 vendor/json_pure/ext/json/ext/generator/unicode.h