10#define RUBY_NKF_REVISION "$Revision$"
11#define RUBY_NKF_VERSION NKF_VERSION " (" NKF_RELEASE_DATE ")"
21#define getc(f) (input_ctr>=i_len?-1:input[input_ctr++])
22#define ungetc(c,f) input_ctr--
28#define putchar(c) rb_nkf_putchar(c)
32static unsigned char *output;
33static unsigned char *
input;
43rb_nkf_putchar(
unsigned int c)
45 if (output_ctr >= o_len) {
51 output[output_ctr++] = c;
80 unsigned char option[256];
82 int is_escaped =
FALSE;
83 int is_single_quoted =
FALSE;
84 int is_double_quoted =
FALSE;
88 }
else if(is_single_quoted){
90 is_single_quoted =
FALSE;
97 }
else if(
arg[
i] ==
'\\'){
99 }
else if(is_double_quoted){
101 is_double_quoted =
FALSE;
103 option[j++] =
arg[
i];
105 }
else if(
arg[
i] ==
'\''){
106 is_single_quoted =
TRUE;
107 }
else if(
arg[
i] ==
'"'){
108 is_double_quoted =
TRUE;
109 }
else if(
arg[
i] ==
' '){
114 option[j++] =
arg[
i];
144 case UTF_8_BOM: output_encoding = nkf_enc_from_index(
UTF_8);
break;
150 output_bom_f =
FALSE;
199 kanji_convert(
NULL );
VALUE rb_enc_associate(VALUE obj, rb_encoding *enc)
rb_encoding * rb_utf8_encoding(void)
rb_encoding * rb_enc_from_index(int index)
int rb_define_dummy_encoding(const char *name)
rb_encoding * rb_usascii_encoding(void)
VALUE rb_enc_from_encoding(rb_encoding *encoding)
int rb_enc_find_index(const char *name)
VALUE rb_singleton_class(VALUE)
Returns the singleton class of obj.
VALUE rb_define_module(const char *)
void rb_define_alias(VALUE, const char *, const char *)
Defines an alias of a method.
void rb_raise(VALUE exc, const char *fmt,...)
#define nkf_enc_to_base_encoding(enc)
#define nkf_enc_to_index(enc)
#define nkf_enc_name(enc)
int nkf_split_options(const char *arg)
rb_encoding * rb_nkf_enc_get(const char *name)