| 1 |
#ifndef RUBY_INTERNAL_ENCODING_RE_H /*-*-C++-*-vi:se ft=cpp:*/ |
| 2 |
#define RUBY_INTERNAL_ENCODING_RE_H |
| 3 |
/** |
| 4 |
* @file |
| 5 |
* @author Ruby developers <[email protected]> |
| 6 |
* @copyright This file is a part of the programming language Ruby. |
| 7 |
* Permission is hereby granted, to either redistribute and/or |
| 8 |
* modify this file, provided that the conditions mentioned in the |
| 9 |
* file COPYING are met. Consult the file for details. |
| 10 |
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are |
| 11 |
* implementation details. Don't take them as canon. They could |
| 12 |
* rapidly appear then vanish. The name (path) of this header file |
| 13 |
* is also an implementation detail. Do not expect it to persist |
| 14 |
* at the place it is now. Developers are free to move it anywhere |
| 15 |
* anytime at will. |
| 16 |
* @note To ruby-core: remember that this header can be possibly |
| 17 |
* recursively included from extension libraries written in C++. |
| 18 |
* Do not expect for instance `__VA_ARGS__` is always available. |
| 19 |
* We assume C99 for ruby itself but we don't assume languages of |
| 20 |
* extension libraries. They could be written in C++98. |
| 21 |
* @brief Routines to manipulate encodings of symbols. |
| 22 |
*/ |
| 23 |
|
| 24 |
#include "ruby/internal/dllexport.h" |
| 25 |
#include "ruby/internal/encoding/encoding.h" |
| 26 |
#include "ruby/internal/value.h" |
| 27 |
|
| 28 |
RBIMPL_SYMBOL_EXPORT_BEGIN() |
| 29 |
|
| 30 |
/** |
| 31 |
* Identical to rb_reg_new(), except it additionally takes an encoding. |
| 32 |
* |
| 33 |
* @param[in] ptr A memory region of `len` bytes length. |
| 34 |
* @param[in] len Length of `ptr`, in bytes, not including the |
| 35 |
* terminating NUL character. |
| 36 |
* @param[in] enc Encoding of `ptr`. |
| 37 |
* @param[in] opts Options e.g. ONIG_OPTION_MULTILINE. |
| 38 |
* @exception rb_eRegexpError Failed to compile `ptr`. |
| 39 |
* @return An allocated new instance of ::rb_cRegexp, of `enc` encoding, |
| 40 |
* whose expression is compiled according to `ptr`. |
| 41 |
*/ |
| 42 |
VALUE rb_enc_reg_new(const char *ptr, long len, rb_encoding *enc, int opts); |
| 43 |
|
| 44 |
RBIMPL_SYMBOL_EXPORT_END() |
| 45 |
|
| 46 |
#endif /* RUBY_INTERNAL_ENCODING_RE_H */ |