~ubuntu-branches/ubuntu/quantal/ruby1.9.1/quantal

« back to all changes in this revision

Viewing changes to ext/json/parser/parser.h

  • Committer: Bazaar Package Importer
  • Author(s): Lucas Nussbaum
  • Date: 2011-09-24 19:16:17 UTC
  • mfrom: (1.1.8 upstream) (13.1.7 experimental)
  • Revision ID: james.westby@ubuntu.com-20110924191617-o1qz4rcmqjot8zuy
Tags: 1.9.3~rc1-1
* New upstream release: 1.9.3 RC1.
  + Includes load.c fixes. Closes: #639959.
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 
10
10
#ifdef HAVE_RUBY_ENCODING_H
11
11
#include "ruby/encoding.h"
12
 
#define FORCE_UTF8(obj) rb_enc_associate((obj), rb_utf8_encoding())
 
12
#define FORCE_UTF8(obj) ((obj) = rb_enc_associate(rb_str_dup(obj), rb_utf8_encoding()))
13
13
#else
14
14
#define FORCE_UTF8(obj)
15
15
#endif
 
16
#ifdef HAVE_RUBY_ST_H
 
17
#include "ruby/st.h"
 
18
#else
 
19
#include "st.h"
 
20
#endif
16
21
 
17
22
#define option_given_p(opts, key) RTEST(rb_funcall(opts, i_key_p, 1, key))
18
23
 
19
24
/* unicode */
20
25
 
21
 
typedef unsigned long   UTF32;  /* at least 32 bits */
22
 
typedef unsigned short UTF16;   /* at least 16 bits */
23
 
typedef unsigned char   UTF8;     /* typically 8 bits */
 
26
typedef unsigned long UTF32;  /* at least 32 bits */
 
27
typedef unsigned short UTF16; /* at least 16 bits */
 
28
typedef unsigned char UTF8;   /* typically 8 bits */
24
29
 
25
30
#define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD
26
31
#define UNI_SUR_HIGH_START  (UTF32)0xD800
39
44
    int allow_nan;
40
45
    int parsing_name;
41
46
    int symbolize_names;
 
47
    int quirks_mode;
42
48
    VALUE object_class;
43
49
    VALUE array_class;
 
50
    int create_additions;
 
51
    VALUE match_string;
44
52
} JSON_Parser;
45
53
 
46
54
#define GET_PARSER                          \