Ruby 3.5.0dev (2025-01-10 revision 5fab31b15e32622c4b71d1d347a41937e9f9c212)
encindex.h (5fab31b15e32622c4b71d1d347a41937e9f9c212)
1#ifndef RUBY_ENCINDEX_H
2#define RUBY_ENCINDEX_H 1
3/**********************************************************************
4
5 encindex.h -
6
7 $Author$
8 created at: Tue Sep 15 13:21:14 JST 2015
9
10 Copyright (C) 2015 Yukihiro Matsumoto
11
12**********************************************************************/
13
14#include "ruby/encoding.h" /* rb_ascii8bit_encindex etc. */
15#if defined(__cplusplus)
16extern "C" {
17#if 0
18} /* satisfy cc-mode */
19#endif
20#endif
21
22enum ruby_preserved_encindex {
23 RUBY_ENCINDEX_ASCII_8BIT,
24 RUBY_ENCINDEX_UTF_8,
25 RUBY_ENCINDEX_US_ASCII,
26
27 /* preserved indexes */
28 RUBY_ENCINDEX_UTF_16BE,
29 RUBY_ENCINDEX_UTF_16LE,
30 RUBY_ENCINDEX_UTF_32BE,
31 RUBY_ENCINDEX_UTF_32LE,
32 RUBY_ENCINDEX_UTF_16,
33 RUBY_ENCINDEX_UTF_32,
34 RUBY_ENCINDEX_UTF8_MAC,
35
36 /* for old options of regexp */
37 RUBY_ENCINDEX_EUC_JP,
38 RUBY_ENCINDEX_Windows_31J,
39
40 RUBY_ENCINDEX_BUILTIN_MAX
41};
42
43#define ENCINDEX_ASCII_8BIT RUBY_ENCINDEX_ASCII_8BIT
44#define ENCINDEX_UTF_8 RUBY_ENCINDEX_UTF_8
45#define ENCINDEX_US_ASCII RUBY_ENCINDEX_US_ASCII
46#define ENCINDEX_UTF_16BE RUBY_ENCINDEX_UTF_16BE
47#define ENCINDEX_UTF_16LE RUBY_ENCINDEX_UTF_16LE
48#define ENCINDEX_UTF_32BE RUBY_ENCINDEX_UTF_32BE
49#define ENCINDEX_UTF_32LE RUBY_ENCINDEX_UTF_32LE
50#define ENCINDEX_UTF_16 RUBY_ENCINDEX_UTF_16
51#define ENCINDEX_UTF_32 RUBY_ENCINDEX_UTF_32
52#define ENCINDEX_UTF8_MAC RUBY_ENCINDEX_UTF8_MAC
53#define ENCINDEX_EUC_JP RUBY_ENCINDEX_EUC_JP
54#define ENCINDEX_Windows_31J RUBY_ENCINDEX_Windows_31J
55#define ENCINDEX_BUILTIN_MAX RUBY_ENCINDEX_BUILTIN_MAX
56
57#define rb_ascii8bit_encindex() RUBY_ENCINDEX_ASCII_8BIT
58#define rb_utf8_encindex() RUBY_ENCINDEX_UTF_8
59#define rb_usascii_encindex() RUBY_ENCINDEX_US_ASCII
60
61int rb_enc_find_index2(const char *name, long len);
62
63#if defined(__cplusplus)
64#if 0
65{ /* satisfy cc-mode */
66#endif
67} /* extern "C" { */
68#endif
69
70#endif /* RUBY_ENCINDEX_H */
Encoding relates APIs.
int len
Length of the buffer.
Definition io.h:8