summaryrefslogtreecommitdiff
path: root/encindex.h
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-09-15 05:49:20 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-09-15 05:49:20 +0000
commit078b6c98383ed2acb912866f4ac2b47e86cd0805 (patch)
tree627cc166887023d42b9fbaedb54af660c50a3f0f /encindex.h
parentca5c9084dcc0e683457c9bdc99e316fcbbf26f4a (diff)
encindex.h: ENCINDEX
* encindex.h: separate encoding index constants from internal.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'encindex.h')
-rw-r--r--encindex.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/encindex.h b/encindex.h
new file mode 100644
index 0000000000..32e103925a
--- /dev/null
+++ b/encindex.h
@@ -0,0 +1,67 @@
+/**********************************************************************
+
+ encindex.h -
+
+ $Author$
+ created at: Tue Sep 15 13:21:14 JST 2015
+
+ Copyright (C) 2015 Yukihiro Matsumoto
+
+**********************************************************************/
+
+#ifndef RUBY_ENCINDEX_H
+#define RUBY_ENCINDEX_H 1
+#if defined(__cplusplus)
+extern "C" {
+#if 0
+} /* satisfy cc-mode */
+#endif
+#endif
+
+enum ruby_preserved_encindex {
+ RUBY_ENCINDEX_ASCII,
+ RUBY_ENCINDEX_UTF_8,
+ RUBY_ENCINDEX_US_ASCII,
+
+ /* preserved indexes */
+ RUBY_ENCINDEX_UTF_16BE,
+ RUBY_ENCINDEX_UTF_16LE,
+ RUBY_ENCINDEX_UTF_32BE,
+ RUBY_ENCINDEX_UTF_32LE,
+ RUBY_ENCINDEX_UTF_16,
+ RUBY_ENCINDEX_UTF_32,
+ RUBY_ENCINDEX_UTF8_MAC,
+
+ /* for old options of regexp */
+ RUBY_ENCINDEX_EUC_JP,
+ RUBY_ENCINDEX_Windows_31J,
+
+ RUBY_ENCINDEX_BUILTIN_MAX
+};
+
+#define ENCINDEX_ASCII RUBY_ENCINDEX_ASCII
+#define ENCINDEX_UTF_8 RUBY_ENCINDEX_UTF_8
+#define ENCINDEX_US_ASCII RUBY_ENCINDEX_US_ASCII
+#define ENCINDEX_UTF_16BE RUBY_ENCINDEX_UTF_16BE
+#define ENCINDEX_UTF_16LE RUBY_ENCINDEX_UTF_16LE
+#define ENCINDEX_UTF_32BE RUBY_ENCINDEX_UTF_32BE
+#define ENCINDEX_UTF_32LE RUBY_ENCINDEX_UTF_32LE
+#define ENCINDEX_UTF_16 RUBY_ENCINDEX_UTF_16
+#define ENCINDEX_UTF_32 RUBY_ENCINDEX_UTF_32
+#define ENCINDEX_UTF8_MAC RUBY_ENCINDEX_UTF8_MAC
+#define ENCINDEX_EUC_JP RUBY_ENCINDEX_EUC_JP
+#define ENCINDEX_Windows_31J RUBY_ENCINDEX_Windows_31J
+#define ENCINDEX_BUILTIN_MAX RUBY_ENCINDEX_BUILTIN_MAX
+
+#define rb_ascii8bit_encindex() RUBY_ENCINDEX_ASCII
+#define rb_utf8_encindex() RUBY_ENCINDEX_UTF_8
+#define rb_usascii_encindex() RUBY_ENCINDEX_US_ASCII
+
+#if defined(__cplusplus)
+#if 0
+{ /* satisfy cc-mode */
+#endif
+} /* extern "C" { */
+#endif
+
+#endif /* RUBY_INTERNAL_H */