14 Commits

Author SHA1 Message Date
e3fc5323df Cleanup 2026-02-02 10:45:22 +00:00
15cef855d6 Update installer 2026-02-01 20:49:38 +00:00
59fe554259 Fix bar dead code 2026-02-01 20:47:41 +00:00
8b93b955e8 Fix parsing bugs and add better indentation support 2026-02-01 20:40:52 +00:00
f77caf604f Post release cleanup 2026-02-01 17:06:27 +00:00
8b49ab6085 Update mruby api. 2026-02-01 17:01:57 +00:00
154e557339 Fix memory leaks 2026-01-31 23:23:08 +00:00
04cce4224e Embed mruby and better clipboard support 2026-01-31 17:19:08 +00:00
410222b82a Fix minor bugs 2026-01-31 10:54:03 +00:00
f93afc0d14 Make binary portable and other fixes 2026-01-31 10:25:39 +00:00
86d5b7a021 Fix dependancies and precompile ruby module 2026-01-29 23:21:47 +00:00
78949bc770 Remove unneccesary dependancy
Signed-off-by: Syed Daanish <me@syedm.dev>
2026-01-29 15:00:57 +00:00
17a04bdddc Fix url 2026-01-29 13:59:55 +00:00
eafed64bea Use embedded mruby for portablity 2026-01-29 13:52:46 +00:00
246 changed files with 2754 additions and 41823 deletions

10
.clangd
View File

@@ -1,7 +1,9 @@
CompileFlags: CompileFlags:
Add: [-I/home/syed/main/crib/include, -I/home/syed/main/crib/libs, -I/home/syed/main/crib/libs/libruby, c++20] Add: [
-I/home/syed/main/crib/include,
-I/home/syed/main/crib/libs,
-I/home/syed/main/crib/libs/mruby/include,
-std=c++23
]
Remove: [] Remove: []
Compiler: clang++ Compiler: clang++
HeaderInsertion:
Policy: Never

2
.gitignore vendored
View File

@@ -17,4 +17,6 @@ bin
Gemfile* Gemfile*
.ruby-lsp/ .ruby-lsp/
include/scripting/ruby_compiled.h
__old__ __old__

6
.gitmodules vendored
View File

@@ -2,7 +2,7 @@
path = libs/libgrapheme path = libs/libgrapheme
url = git://git.suckless.org/libgrapheme url = git://git.suckless.org/libgrapheme
ignore = dirty ignore = dirty
[submodule "libs/utfcpp"] [submodule "libs/mruby"]
path = libs/utfcpp path = libs/mruby
url = https://github.com/nemtrif/utfcpp.git url = https://github.com/mruby/mruby.git
ignore = dirty ignore = dirty

View File

@@ -4,56 +4,35 @@ OBJ_DIR := build
INCLUDE_DIR := include INCLUDE_DIR := include
TARGET_DEBUG := $(BIN_DIR)/crib-dbg TARGET_DEBUG := $(BIN_DIR)/crib-dbg
TARGET_RELEASE_32 := $(BIN_DIR)/crib-ruby3.2 TARGET_RELEASE := $(BIN_DIR)/crib
TARGET_RELEASE_34 := $(BIN_DIR)/crib-ruby3.4
PCH_DEBUG := $(OBJ_DIR)/debug/pch.h.gch PCH_DEBUG := $(OBJ_DIR)/debug/pch.h.gch
PCH_RELEASE := $(OBJ_DIR)/release/pch.h.gch PCH_RELEASE := $(OBJ_DIR)/release/pch.h.gch
GENERATED_HEADER := $(INCLUDE_DIR)/scripting/ruby_compiled.h
CCACHE := ccache CCACHE := ccache
CXX := $(CCACHE) clang++ CXX := $(CCACHE) clang++
CC := $(CCACHE) musl-clang
RUBY32_INC := -I./libs/libruby
RUBY32_LIB := libs/libruby/libruby.so
RUBY32_PATCH := patchelf --replace-needed libruby-3.2.so.3.2 libruby.so
RUBY34_INC := \
-I/usr/include/ruby-3.4.0 \
-I/usr/include/ruby-3.4.0/x86_64-linux
RUBY34_LIB := -lruby
CFLAGS_DEBUG :=\ CFLAGS_DEBUG :=\
-std=c++23 -Wall -Wextra -Wno-c23-extensions \ -std=c++20 -Wall -Wextra \
-O0 -fno-inline -gsplit-dwarf\ -O0 -fno-inline -gsplit-dwarf \
-g -fno-omit-frame-pointer\ -g -fno-omit-frame-pointer \
-fsanitize=address \
-Wno-unused-command-line-argument \ -Wno-unused-command-line-argument \
-I./include -I./libs -I./libs/libruby -I./include -I./libs -I/home/syed/main/crib/libs/mruby/include
CFLAGS_RELEASE :=\ CFLAGS_RELEASE :=\
-std=c++23 -O3 -march=native \ -static --target=x86_64-linux-musl \
-fno-rtti -fstrict-aliasing \ -std=c++20 -O3 -march=x86-64 -mtune=generic \
-fno-rtti \
-ffast-math -flto=thin \ -ffast-math -flto=thin \
-fvisibility=hidden -fuse-ld=lld \ -fvisibility=hidden \
-fomit-frame-pointer -DNDEBUG -s \ -fomit-frame-pointer -DNDEBUG -s \
-mllvm -vectorize-loops \ -mllvm -vectorize-loops \
-fno-unwind-tables -fno-asynchronous-unwind-tables\
-Wno-unused-command-line-argument \ -Wno-unused-command-line-argument \
-Wno-c23-extensions \ -I./include -I./libs -I/home/syed/main/crib/libs/mruby/include
-I./include -I./libs -I./libs/libruby
CFLAGS_RELEASE_32 := $(CFLAGS_RELEASE) $(RUBY32_INC)
CFLAGS_RELEASE_34 := $(CFLAGS_RELEASE) $(RUBY34_INC)
LIBS_32 := \
libs/libgrapheme/libgrapheme.a \
$(RUBY32_LIB) \
-Wl,-Bstatic -lpcre2-8 -Wl,-Bdynamic -lmagic
LIBS_34 := \
libs/libgrapheme/libgrapheme.a \
$(RUBY34_LIB) \
-Wl,-Bstatic -lpcre2-8 -Wl,-Bdynamic -lmagic
PCH_CFLAGS_DEBUG := $(CFLAGS_DEBUG) -x c++-header PCH_CFLAGS_DEBUG := $(CFLAGS_DEBUG) -x c++-header
PCH_CFLAGS_RELEASE := $(CFLAGS_RELEASE) -x c++-header PCH_CFLAGS_RELEASE := $(CFLAGS_RELEASE) -x c++-header
@@ -63,6 +42,14 @@ UNICODE_SRC := $(wildcard libs/unicode_width/*.c)
UNICODE_OBJ_DEBUG := $(patsubst libs/unicode_width/%.c,$(OBJ_DIR)/debug/unicode_width/%.o,$(UNICODE_SRC)) UNICODE_OBJ_DEBUG := $(patsubst libs/unicode_width/%.c,$(OBJ_DIR)/debug/unicode_width/%.o,$(UNICODE_SRC))
UNICODE_OBJ_RELEASE := $(patsubst libs/unicode_width/%.c,$(OBJ_DIR)/release/unicode_width/%.o,$(UNICODE_SRC)) UNICODE_OBJ_RELEASE := $(patsubst libs/unicode_width/%.c,$(OBJ_DIR)/release/unicode_width/%.o,$(UNICODE_SRC))
LIBS_RELEASE := \
libs/libgrapheme/libgrapheme.a ./libs/mruby/build/host/lib/libmruby.a \
-Wl,-Bstatic,--gc-sections -lpcre2-8
LIBS_DEBUG := \
libs/libgrapheme/libgrapheme.a ./libs/mruby/build/host/lib/libmruby.a \
-Wl,-Bdynamic -lpcre2-8
SRC := $(wildcard $(SRC_DIR)/**/*.cc) $(wildcard $(SRC_DIR)/*.cc) SRC := $(wildcard $(SRC_DIR)/**/*.cc) $(wildcard $(SRC_DIR)/*.cc)
OBJ_DEBUG := $(patsubst $(SRC_DIR)/%.cc,$(OBJ_DIR)/debug/%.o,$(SRC)) OBJ_DEBUG := $(patsubst $(SRC_DIR)/%.cc,$(OBJ_DIR)/debug/%.o,$(SRC))
OBJ_RELEASE := $(patsubst $(SRC_DIR)/%.cc,$(OBJ_DIR)/release/%.o,$(SRC)) OBJ_RELEASE := $(patsubst $(SRC_DIR)/%.cc,$(OBJ_DIR)/release/%.o,$(SRC))
@@ -76,7 +63,10 @@ all: debug
test: $(TARGET_DEBUG) test: $(TARGET_DEBUG)
release: $(TARGET_RELEASE_32) $(TARGET_RELEASE_34) release: $(TARGET_RELEASE)
$(GENERATED_HEADER): $(INCLUDE_DIR)/syntax/tokens.def $(INCLUDE_DIR)/ruby/libcrib.rb src/ruby_compile.sh
src/ruby_compile.sh
$(PCH_DEBUG): $(INCLUDE_DIR)/pch.h $(PCH_DEBUG): $(INCLUDE_DIR)/pch.h
mkdir -p $(dir $@) mkdir -p $(dir $@)
@@ -88,33 +78,27 @@ $(PCH_RELEASE): $(INCLUDE_DIR)/pch.h
$(TARGET_DEBUG): $(PCH_DEBUG) $(OBJ_DEBUG) $(UNICODE_OBJ_DEBUG) $(TARGET_DEBUG): $(PCH_DEBUG) $(OBJ_DEBUG) $(UNICODE_OBJ_DEBUG)
mkdir -p $(BIN_DIR) mkdir -p $(BIN_DIR)
$(CXX) $(CFLAGS_DEBUG) -o $@ $(OBJ_DEBUG) $(UNICODE_OBJ_DEBUG) $(LIBS) $(CXX) $(CFLAGS_DEBUG) -o $@ $(OBJ_DEBUG) $(UNICODE_OBJ_DEBUG) $(LIBS_DEBUG)
patchelf --replace-needed libruby-3.2.so.3.2 libruby.so $@
$(TARGET_RELEASE_32): $(PCH_RELEASE) $(OBJ_RELEASE) $(UNICODE_OBJ_RELEASE) $(TARGET_RELEASE): $(PCH_RELEASE) $(OBJ_RELEASE) $(UNICODE_OBJ_RELEASE)
mkdir -p $(BIN_DIR) mkdir -p $(BIN_DIR)
$(CXX) $(CFLAGS_RELEASE_32) -o $@ $(OBJ_RELEASE) $(UNICODE_OBJ_RELEASE) $(LIBS_32) $(CXX) $(CFLAGS_RELEASE) -o $@ $(OBJ_RELEASE) $(UNICODE_OBJ_RELEASE) $(LIBS_RELEASE)
$(RUBY32_PATCH) $@
$(TARGET_RELEASE_34): $(PCH_RELEASE) $(OBJ_RELEASE) $(UNICODE_OBJ_RELEASE) $(OBJ_DIR)/debug/%.o: $(SRC_DIR)/%.cc $(PCH_DEBUG) $(GENERATED_HEADER)
mkdir -p $(BIN_DIR)
$(CXX) $(CFLAGS_RELEASE_34) -o $@ $(OBJ_RELEASE) $(UNICODE_OBJ_RELEASE) $(LIBS_34)
$(OBJ_DIR)/debug/%.o: $(SRC_DIR)/%.cc $(PCH_DEBUG)
mkdir -p $(dir $@) mkdir -p $(dir $@)
$(CXX) $(CFLAGS_DEBUG) -include $(INCLUDE_DIR)/pch.h -MMD -MP -c $< -o $@ $(CXX) $(CFLAGS_DEBUG) -include $(INCLUDE_DIR)/pch.h -MMD -MP -c $< -o $@
$(OBJ_DIR)/release/%.o: $(SRC_DIR)/%.cc $(PCH_RELEASE) $(OBJ_DIR)/release/%.o: $(SRC_DIR)/%.cc $(PCH_RELEASE) $(GENERATED_HEADER)
mkdir -p $(dir $@) mkdir -p $(dir $@)
$(CXX) $(CFLAGS_RELEASE) -include $(INCLUDE_DIR)/pch.h -MMD -MP -c $< -o $@ $(CXX) $(CFLAGS_RELEASE) -include $(INCLUDE_DIR)/pch.h -MMD -MP -c $< -o $@
$(OBJ_DIR)/debug/unicode_width/%.o: libs/unicode_width/%.c $(OBJ_DIR)/debug/unicode_width/%.o: libs/unicode_width/%.c
mkdir -p $(dir $@) mkdir -p $(dir $@)
$(CXX) $(CFLAGS_DEBUG) -MMD -MP -c $< -o $@ $(CC) -MMD -MP -c $< -o $@
$(OBJ_DIR)/release/unicode_width/%.o: libs/unicode_width/%.c $(OBJ_DIR)/release/unicode_width/%.o: libs/unicode_width/%.c
mkdir -p $(dir $@) mkdir -p $(dir $@)
$(CXX) $(CFLAGS_RELEASE) -MMD -MP -c $< -o $@ $(CC) -MMD -MP -c $< -o $@
DEP_DEBUG += $(UNICODE_OBJ_DEBUG:.o=.d) DEP_DEBUG += $(UNICODE_OBJ_DEBUG:.o=.d)
DEP_RELEASE += $(UNICODE_OBJ_RELEASE:.o=.d) DEP_RELEASE += $(UNICODE_OBJ_RELEASE:.o=.d)

View File

@@ -20,10 +20,8 @@ Binary can be installed with the following command:
curl https://syedm.dev/crib | sh curl https://syedm.dev/crib | sh
``` ```
It requires `libruby-3.2.so` or `libruby.so.3.4` to be installed in the system.<br>
It also requires `libmagic` to be installed (most systems have it preinstalled).<br>
Currently only for Linux.<br> Currently only for Linux.<br>
*Tested with arch linux and ubuntu*<br> *Tested with arch linux and ubuntu and void*<br>
## Building ## Building
@@ -53,12 +51,6 @@ Make sure you have the following dependencies installed (apart from the standard
#include <pcre2.h> #include <pcre2.h>
``` ```
* **libmagic**
Install it so that you can include it in your code (most *nix systems have it installed):
```cpp
#include <magic.h>
```
It also uses `xclip` at runtime for copying/pasting *(TODO: make it os portable)*. It also uses `xclip` at runtime for copying/pasting *(TODO: make it os portable)*.
And any modern terminal should work fine - preferably `kitty` or `wezterm`.<br> And any modern terminal should work fine - preferably `kitty` or `wezterm`.<br>
@@ -67,11 +59,32 @@ And any modern terminal should work fine - preferably `kitty` or `wezterm`.<br>
Some other dependancies are added as submodules or copied.<br> Some other dependancies are added as submodules or copied.<br>
- `unicode_width` is compiled by the makefile so nothing to do there.<br> - `unicode_width` is compiled by the makefile so nothing to do there.<br>
- `libgrapheme` needs to be compiled using `make` in it's folder.<br> - `libgrapheme` needs to be compiled using `make` in it's folder.<br>
- `` - `mruby` needs to be compiled using `rake` in it's folder (needs ruby).<br>
- Need to add the following lines to the `build_config/default.rb` file (in the `MRuby::Build.new` block)
```ruby
conf.gem :mgem => 'pure-regexp'
conf.gem :mgem => 'env'
conf.gem :mgem => 'process'
conf.gem :mgem => 'marshal-c'
```
#### config file
The config file is a ruby file placed in one of these places (in order, first one found will be used):
- `$CRIB_CONFIG`
- `$CRIB_CONFIG_DIR/crib.rb`
- `$CRIB_CONFIG_DIR/main.rb`
- `./crib.rb`
- `$XDG_CONFIG_HOME/crib/crib.rb`
- `$XDG_CONFIG_HOME/crib/main.rb`
- `$XDG_CONFIG_HOME/crib.rb`
- `$HOME/.config/crib/crib.rb`
- `$HOME/.config/crib/main.rb`
- `$HOME/.config/crib.rb`
#### LSPs #### LSPs
Lsp's are defined in the `libcrib.rb` file and you can use your `config/main.rb` file to add more.<br> Lsp's are defined in the `libcrib.rb` file and you can use your config file to add more.<br>
The following lsp's are added by default and can be installed anywhere in your `$PATH`<br> The following lsp's are added by default and can be installed anywhere in your `$PATH`<br>
@@ -101,7 +114,7 @@ The following lsp's are added by default and can be installed anywhere in your `
#### Compiler #### Compiler
`clang++` should work fine but `c++23+` is required.<br> `g++` or `clang++` should work fine but `c++20+` is required.<br>
Can remove `ccache` if you want from the makefile.<br> Can remove `ccache` if you want from the makefile.<br>
#### Compliling #### Compliling
@@ -124,7 +137,7 @@ crib ./filename.ext
## Keybindings ## Keybindings
TODO: add keybind information on how to set in `config/main.rb` TODO: add keybind information on how to set in config file
and default / unchangeable keybinds and default / unchangeable keybinds
## Features Implemented ## Features Implemented
@@ -147,7 +160,7 @@ TODO: add keybind information on how to set in `config/main.rb`
- current line highlighting - current line highlighting
- all instances of current word under cursor highlighting - all instances of current word under cursor highlighting
#### syntax highlighting and filetype detection (using extention or libmagic) for: #### syntax highlighting and filetype detection for:
- ruby - ruby
<!-- TODO: --> <!-- TODO: -->
<!-- - bash --> <!-- - bash -->

127
TODO.md
View File

@@ -2,39 +2,87 @@ Copyright 2025 Syed Daanish
# TODO # TODO
##### BTW Check each lsp with each of the features implemented # memory usage for debug build (release build will be smaller by about 25%)
```
8K -> 13.2M
128K -> 13.2M (expected worst case 16.6M)
128M -> 412.0M (expected worst case 2.3G)
```
* Static link pcre2-8 and libmagic and add precompiled libmagic magic database for better file detection * Next few super long boring things to do
* redo lsp threads such that no mutex needed for any rope stuff
- Also make the classes own the methods in lsp
- This will mean that parsers/renderers and keystrokes will not need to be individually locked
- And so it will be much faster
- At which point the main thread can also be blocked on user input or lsp responses and still be fast
* Add a superclass for editor called Window (which can be popup or tiled)
* Add a recursive tiling class for windows
* Handled by a single renderer that calls and renders each window
- And a bg if no window open
* Make editor's functions into its own methods (classify it)
- While at it
- Seperate system functions into a class that branches to support local / ssh / server modes.
- Even lsp shouldnt be directly controlled because it can branch on local and server modes
- Redo hooks as a engine of its own.
- And factorize renderer into its own class (and make it just return an array of the render without knowing teh x,y)
- which is just managed by the renderer
- which is reused by scrollers/ensurers too
- this will then allow inlay hints to be possible
- and also make VAI easier to implement
* Allow keybinds to be set in ruby
* then the fun part:
* Then allow ruby code to create and handle windows as extentions
* Then 3 inbuilt extentions being file manager, theme picker, tab selector
* Extentions can also be used as file openers (for like databases . diffing . images . audio etc)
* Local cache for state management (like undo history, cursor positions etc) (location can be set in config)
* make sure to write inbuilt extentions in cpp and not ruby
* also move default bar and clipboard back into cpp
* all lsp popups are no longer their own classes but instead windows (extention like) in popup mode
* skip opening binary files
* apply themeing in bg log bar lsp popus etc. to keep visual consistency
* searching/replace/Multi-Cursor (for just one lsp command for all) with pcre2 with regex (started by a slash) (disabled for large files)
* add links support in xterm (kitty like clickable links)
* And preprocess markdown in popups to be more like styled than just highlighted
* In the ruby libcrib populate toplevel binding and file and dir and rubybuild stuff and other similar constants
* in require_relative allow requiring without appending .rb if possible.
* Possibly in the future limit memory usage by parser for larger files
* Add a file picker suggestion while typing a path (including stuff like ~ and .. and $HOME etc)
* allow opening directory after filemanger is sorted out.
* commands to:
change pwd
load a rb file
run a ruby command
close a window etc.
* [ ] Add mgems for most common things and a ruby library to allow combining true ruby with mruby
* add command to set and use a file type at runtime
* [ ] color alpha in ini files
* [ ] Make warning before ctrl+q for saving
* [ ] **LSP Bug:** Check why `fish-lsp` is behaving so off with completions filtering. * [ ] **LSP Bug:** Check why `fish-lsp` is behaving so off with completions filtering.
* [ ] **Critical Crash:** Fix bug where closing immediately while LSP is still loading hangs and then segfaults (especially on slow ones like fish-lsp where quick edits and exit can hang).
* [ ] **Line move:** fix the move line functions to work without the calculations from folds as folds are removed. * [ ] **Line move:** fix the move line functions to work without the calculations from folds as folds are removed.
* [ ] **Editor Indentation Fix:** - Main : merger indentation with the parser for more accurate results. * [ ] **Editor Indentation Fix:** - Main : merger indentation with the parser for more accurate results.
* [ ] Fix bug where enter at start of line with ending type crashes
* [ ] Keep cache of language maps in engine to reduce lookup time.
* [ ] In indents add function to support tab which indents if before any content and inserts a pure \t otherwise.
* [ ] And backspace which undents if before any content.
* [ ] Add block indentation support.
* [ ] Ignore comments/strings from parser when auto-indenting. * [ ] Ignore comments/strings from parser when auto-indenting.
* [ ] These will dedent when the block immediately after them is dedented * [ ] Support for stuff like bash \ and math operators in other languages and comma and line starting with a dot (like in ruby)
* [ ] Dont dedent if ending is valid starting is invalid but also empty etc.
* [ ] Just leave asis if starting is empty * [ ] **Readme:** Update readme to show ruby based config in detail.
* [ ] **Readme:** Update readme to show ruby based config.
* [ ] **UI Refinement:** * [ ] **UI Refinement:**
* [ ] Allow completion list to be scrolled; show only `x` max items.
* [ ] Finish autocomplete box style functions. * [ ] Finish autocomplete box style functions.
* [ ] **Documentation UI:** Capture `Ctrl+h` / `Ctrl+l` for scrolling documentation windows. * [ ] **Documentation UI:** Capture `Ctrl+h` / `Ctrl+l` for scrolling documentation windows.
* [ ] Redo hooks as a struct. * Cap line_tree data limit for large files and just store about a thousand previous lines maybe? (lazily loaded)
* [ ] breakdown the render function into smaller functions.
* Try to make all functions better now that folds have been purged * add `:j<n>` command to jump to line \<n> in the current file
* Cleanup syntax and renderer files * and give warning for invalid commands
* and upon escape clear the current command
* allow multiline logging which captures the input entirely and y will copy the log and anything else will exit
* it will then collapse to being the first line from the log only
* Add a thing called view which is a rect with speacial type editor . but otherwise a ruby or c++ view
* can be used for stuff like file manager/git manager/theme picker.
* allow flushing functions in ruby to tell c++ to refresh keybinds/themes etc. * allow flushing functions in ruby to tell c++ to refresh keybinds/themes etc.
* allow keybinds to be set in ruby
check:: * [ ] **LSP:**
support snippets in completion properly
check::
pull diagnostics for ruby-lsp pull diagnostics for ruby-lsp
lsp selection range - use to highlight start / end of range maybe? lsp selection range - use to highlight start / end of range maybe?
goto definiton goto definiton
@@ -45,18 +93,20 @@ check::
Quick fixes Quick fixes
Rename symbols Rename symbols
probably remove solargraph support and use ruby-lsp (or sorbet?) instead because it is a pain for utf stuff * Allow ruby to config lsp capabilities
ruby-lsp also supports erb so thats a plus
move lsp configs to json and also allow configs for windows-style vs unix-style line endings and utf-8 vs utf-16 * also try to fix why solargraph is the only one breaking on edits near emojis
* ruby-lsp also supports erb so thats a plus
* the ruby should have an api to be able to draw windows and add mappings to them * the ruby should have an api to be able to draw windows and add mappings to them
* **Syntax highlighting**
* ruby done!!
* finish bash then do all the directive-like ones like jsonc (first to help with theme files) / toml / yaml / ini / nginx * finish bash then do all the directive-like ones like jsonc (first to help with theme files) / toml / yaml / ini / nginx
* then [ch](++)? then gdscript and python then erb then php
* then markdown / html * then markdown / html
* then gitignore / gitattributes * then gitignore / gitattributes
* then fish then sql then css and [jt]sx? then python then lua (make with type annotations for lsp results) * then fish then sql then css and [jt]sx? then lua (make with type annotations for lsp results)
* then [ch](++)? then gdscript then erb then php
* then haskell then gomod then go then rust * then haskell then gomod then go then rust
* [ ] **Undo/Redo:** Add support for undo/redo history. * [ ] **Undo/Redo:** Add support for undo/redo history.
@@ -65,23 +115,12 @@ move lsp configs to json and also allow configs for windows-style vs unix-style
* [ ] **Tree-sitter Indent:** Attempt to allow Tree-sitter to handle indentation if possible. * [ ] **Tree-sitter Indent:** Attempt to allow Tree-sitter to handle indentation if possible.
* [ ] **Scrolling:** Add logic where selecting at the end of the screen scrolls down (and vice versa).
* *Implementation:* Update `main.cc` to send drag events to the selected editor even if coordinates are out of bounds.
### UX ### UX
* [ ] **Editor word highlighter:** Do not recompute word under cursor if not changed.
* [ ] **Completion Filtering:** * [ ] **Completion Filtering:**
* [ ] Stop filtering case-sensitive. * [ ] Stop filtering case-sensitive.
* [ ] Normalize completion edits if local filtering is used. * [ ] Normalize completion edits if local filtering is used.
* [ ] **LSP Features:**
* [ ] Add LSP jumping support (Go to Definition, Hover).
* [ ] Add LSP rename support.
* [ ] Handle snippets properly in autocomplete: use only the last word in signature when replacing and set cursor to the first one.
* [ ] **Basic Autocomplete:** Keep a list of words in the current buffer for non-LSP fallback. * [ ] **Basic Autocomplete:** Keep a list of words in the current buffer for non-LSP fallback.
### Major Features ### Major Features
@@ -97,28 +136,24 @@ move lsp configs to json and also allow configs for windows-style vs unix-style
* [ ] Allow search and place cursor at all matches. * [ ] Allow search and place cursor at all matches.
* [ ] **Block Selection:** * [ ] **Block Selection:**
* [ ] Double-clicking a bracket selects the whole block (first time only) and sets mode to `WORD`. * [ ] Double-clicking a bracket selects the whole block and sets mode to `WORD`.
### Visuals, UI & Extensions? ### Visuals, UI & Extensions?
* [ ] **Status Bar:** Complete status bar and command runner. * [ ] Add color picker/palette (as a floating extention).
* [ ] Add color picker/palette.
* [ ] **Git:** Add Git integration (status, diffs). * [ ] **Git:** Add Git integration (status, diffs).
* [ ] **AI/Snippets:** * [ ] **AI/Snippets:**
* [ ] Add snippets support (LuaSnip/VSnip style). * [ ] Add snippets support (LuaSnip/VSnip style).
* [ ] Add Codeium/Copilot support (using VAI virtual text) as a test phase. * [ ] Add Codeium/Copilot support (using VAI virtual text) as a test phase.
* [ ] **SQL:** Add SQL support (Viewer and Basic Editor). * [ ] **SQL:** Add SQL support (Viewer and Basic Editor) (as ruby extension).
* [ ] **Prolly?:** Add Splash Screen / Minigame. * [ ] **Prolly?:** Add Splash Screen / Minigame.
### Optimizations & Fluff ### Unimportant optimizations
* [ ] **Performance:** * [ ] **Performance:**
* [ ] Switch JSON parser to `RapidJSON` (or similar high-performance lib). * [ ] Switch JSON parser to `RapidJSON` (or similar high-performance lib).
* [ ] Decrease usage of `std::string` in UI, LSP, and warnings. * [ ] Decrease usage of `std::string` in UI, LSP, warnings etc.
* [ ] Also for vectors into managed memory especially for completions/lsp-stuff. * [ ] Also for vectors into managed memory especially for completions/lsp-stuff.

View File

@@ -1,7 +1,16 @@
# Files can be insluded using Kernel#require_relative
# but it can be called with binding as the second argument
# skipping it will call it with global binding which is usually fine
# Kernel#load can also be used
require_relative "theme"
# basic configuration # basic configuration
# This can also be used to do speacail configs for different projects. # This can also be used to do speacail configs for different projects.
# its ruby guys script whatever you want. # its ruby guys script whatever you want.
# puts "Loading main config..."
C.startup do C.startup do
puts "Starting crib..." puts "Starting crib..."
end end
@@ -10,67 +19,30 @@ C.shutdown do
puts "Exiting crib..." puts "Exiting crib..."
end end
# this can be modified by the user during runtime through keybindings # TODO: to be done once a proper api for binding and window drawing is made
# But i need to know how to ever read this value only when needed. # The binds will be connected to either `editor` or windows where editor can
# maybe i can write a function that notifies if theme maybe changed then reload # only use a preset set of stuff to bind while teh windows are purely custom
# It can also be scripted to load different theme formats into a hash usable by crib # # this part uses dsl bindings to define the bind function
C.theme = { # # Hopefully extend to give more context/power to bindings
:default => { fg: 0xEEEEEE }, # # but try to keep simple for performance
:shebang => { fg: 0x7DCFFF }, # # for default keybindings
:error => { fg: 0xEF5168 }, # C.bind [:normal, :select], :a => "insert_mode"
:comment => { fg: 0xAAAAAA, italic: true }, # # for custom keybindings
:string => { fg: 0xAAD94C }, # C.bind :select, [:x, :c] do
:escape => { fg: 0x7DCFFF }, # puts "cut"
:interpolation => { fg: 0x7DCFFF }, # end
:regexp => { fg: 0xD2A6FF }, # C.bind :jumper do
:number => { fg: 0xE6C08A }, # set [:x, :c] do
# rubocop:disable Lint/BooleanSymbol # puts "jump to first bookmark"
:true => { fg: 0x7AE93C }, # end
:false => { fg: 0xEF5168 }, # end
# rubocop:enable Lint/BooleanSymbol # # they can also be defined conditionally
:char => { fg: 0xFFAF70 }, # # This code is just an example and doesnt actually work
:keyword => { fg: 0xFF8F40 }, # if using_tmux?
:keywordoperator => { fg: 0xF07178 }, # bind :C-p do
:operator => { fg: 0xFFFFFF, italic: true }, # system("tmux select-pane -U")
:function => { fg: 0xFFAF70 }, # end
:type => { fg: 0xF07178 }, # end
:constant => { fg: 0x7DCFFF },
:variableinstance => { fg: 0x95E6CB },
:variableglobal => { fg: 0xF07178 },
:annotation => { fg: 0x7DCFFF },
:directive => { fg: 0xFF8F40 },
:label => { fg: 0xD2A6FF },
:brace1 => { fg: 0xD2A6FF },
:brace2 => { fg: 0xFFAFAF },
:brace3 => { fg: 0xFFFF00 },
:brace4 => { fg: 0x0FFF0F },
:brace5 => { fg: 0xFF0F0F }
}
# # TODO: to be done once a proper api for binding and window drawing is made
# # The binds will be connected to either `editor` or windows where editor can
# # only use a preset set of stuff to bind while teh windows are purely custom
# # # this part uses dsl bindings to define the bind function
# # # Hopefully extend to give more context/power to bindings
# # # but try to keep simple for performance
# # # for default keybindings
# # C.bind [:normal, :select], :a => "insert_mode"
# # # for custom keybindings
# # C.bind :select, [:x, :c] do
# # puts "cut"
# # end
# # C.bind :jumper do
# # set [:x, :c] do
# # puts "jump to first bookmark"
# # end
# # end
# # # they can also be defined conditionally
# # # This code is just an example and doesnt actually work
# # if using_tmux?
# # bind :C-p do
# # system("tmux select-pane -U")
# # end
# # end
# This can, for example, be modified by user bindings during runtime # This can, for example, be modified by user bindings during runtime
# TODO: dynamic registration to actually be implemented once keybinds and extentions are implemented # TODO: dynamic registration to actually be implemented once keybinds and extentions are implemented
@@ -82,23 +54,22 @@ C.theme = {
# symbol: "󰴭 ", # symbol: "󰴭 ",
# extensions: ["rb"], # extensions: ["rb"],
# filenames: ["Gemfile"], # filenames: ["Gemfile"],
# mimetypes: ["text/x-ruby"],
# lsp: "solargraph" # lsp: "solargraph"
# } # }
C.line_endings = :auto_unix # or :unix or :windows or :auto_windows C.line_endings = :auto_unix # or :unix or :windows or :auto_windows
# C.extra_highlights do |_line, _idx| C.extra_highlights do |_line, _idx|
# # the return can be an array of # the return can be an array of
# # [fg, bg. flags, start, end] # [fg, bg. flags, start, end]
# # where fg and bg are integers (using 24 bit color) # where fg and bg are integers (using 24 bit color)
# # and flags is a bitmask of bold/underline/italic etc # and flags is a bitmask of bold/underline/italic etc
# # and start and end are integers strictly inside the line # and start and end are integers strictly inside the line
# return [] return []
# end end
# The highlighter will be aplied to the language as long as the langauge is defined in C.languages # The highlighter will be aplied to the language as long as the langauge is defined in C.languages
C.highlighters[:ruby_n] = { C.highlighters[:string] = {
parser: ->(line, state, line_idx) { parser: ->(line, state, line_idx) {
# the return value is a hash # the return value is a hash
# it contains the state and the highlights # it contains the state and the highlights

36
config/theme.rb Normal file
View File

@@ -0,0 +1,36 @@
# this can be modified by the user during runtime through keybindings
# But i need to know how to ever read this value only when needed.
# maybe i can write a function that notifies if theme maybe changed then reload
# It can also be scripted to load different theme formats into a hash usable by crib
C.theme = {
:default => { fg: 0xEEEEEE },
:shebang => { fg: 0x7DCFFF },
:error => { fg: 0xEF5168 },
:comment => { fg: 0xAAAAAA, italic: true },
:string => { fg: 0xAAD94C },
:escape => { fg: 0x7DCFFF },
:interpolation => { fg: 0x7DCFFF },
:regexp => { fg: 0xD2A6FF },
:number => { fg: 0xE6C08A },
# rubocop:disable Lint/BooleanSymbol
:true => { fg: 0x7AE93C },
:false => { fg: 0xEF5168 },
# rubocop:enable Lint/BooleanSymbol
:char => { fg: 0xFFAF70 },
:keyword => { fg: 0xFF8F40 },
:keywordoperator => { fg: 0xF07178 },
:operator => { fg: 0xFFFFFF, italic: true },
:function => { fg: 0xFFAF70 },
:type => { fg: 0xF07178 },
:constant => { fg: 0x7DCFFF },
:variableinstance => { fg: 0x95E6CB },
:variableglobal => { fg: 0xF07178 },
:annotation => { fg: 0x7DCFFF },
:directive => { fg: 0xFF8F40 },
:label => { fg: 0xD2A6FF },
:brace1 => { fg: 0xD2A6FF },
:brace2 => { fg: 0xFFAFAF },
:brace3 => { fg: 0xFFFF00 },
:brace4 => { fg: 0x0FFF0F },
:brace5 => { fg: 0xFF0F0F }
}

View File

@@ -27,9 +27,10 @@ struct CompletionSession {
bool active = false; bool active = false;
Coord hook; Coord hook;
std::optional<std::string> prefix; std::optional<std::string> prefix;
uint8_t select = 0; uint32_t select = 0;
uint32_t scroll = 0;
std::vector<CompletionItem> items; std::vector<CompletionItem> items;
std::vector<uint8_t> visible; std::vector<uint32_t> visible;
bool complete = true; bool complete = true;
std::optional<char> trigger_char; std::optional<char> trigger_char;
uint8_t trigger = 0; uint8_t trigger = 0;

View File

@@ -11,17 +11,14 @@
#include "ui/diagnostics.h" #include "ui/diagnostics.h"
#include "ui/hover.h" #include "ui/hover.h"
#include "utils/utils.h" #include "utils/utils.h"
#include <cstdint>
#define CHAR 0 #define CHAR 0
#define WORD 1 #define WORD 1
#define LINE 2 #define LINE 2
#define EXTRA_META 4 #define EXTRA_META 2
#define INDENT_WIDTH 2 #define INDENT_WIDTH 2
// autocomplete lua// Bracket closing / tab on enter
struct Editor { struct Editor {
std::string filename; std::string filename;
std::string uri; std::string uri;
@@ -31,7 +28,7 @@ struct Editor {
uint32_t cursor_preffered; uint32_t cursor_preffered;
Coord selection; Coord selection;
bool selection_active; bool selection_active;
bool unix_eol; // false for windows bool unix_eol;
int selection_type; int selection_type;
Coord position; Coord position;
Coord size; Coord size;

View File

@@ -17,6 +17,8 @@ void fetch_lsp_hover(Editor *editor);
void handle_mouse(Editor *editor, KeyEvent event); void handle_mouse(Editor *editor, KeyEvent event);
void indent_current_line(Editor *editor); void indent_current_line(Editor *editor);
void dedent_current_line(Editor *editor); void dedent_current_line(Editor *editor);
void indent_selection(Editor *editor);
void dedent_selection(Editor *editor);
void paste(Editor *editor); void paste(Editor *editor);
void copy(Editor *editor); void copy(Editor *editor);
void cut(Editor *editor); void cut(Editor *editor);

View File

@@ -112,12 +112,18 @@ struct IndentationEngine {
uint32_t set_indent(uint32_t row, int64_t indent_level); uint32_t set_indent(uint32_t row, int64_t indent_level);
uint32_t indent_line(uint32_t row); uint32_t indent_line(uint32_t row);
uint32_t dedent_line(uint32_t row); uint32_t dedent_line(uint32_t row);
void indent_block(uint32_t start_row, uint32_t end_row, int delta);
void indent_block(uint32_t start, uint32_t end); void indent_block(uint32_t start, uint32_t end);
void dedent_block(uint32_t start, uint32_t end); void dedent_block(uint32_t start, uint32_t end);
// fixes a autocomplete block's indentation // fixes a autocomplete block's indentation
char *block_to_asis(Coord cursor, std::string source, uint32_t *out_len); char *block_to_asis(Coord cursor, std::string source, uint32_t *out_len);
private: private:
const std::vector<std::string> *start_end = nullptr;
const std::vector<std::string> *start_start = nullptr;
const std::vector<std::string> *end_full = nullptr;
const std::vector<std::string> *end_start = nullptr;
// TODO: Ignore comments/strings too // TODO: Ignore comments/strings too
// returns the indent level of the line itself or of the previous non-empty // returns the indent level of the line itself or of the previous non-empty
uint32_t indent_expected(uint32_t row); uint32_t indent_expected(uint32_t row);

View File

@@ -115,8 +115,8 @@ LineIterator *begin_l_iter(Knot *root, uint32_t start_line);
// Each subsequent call returns the next line as a null terminated string // Each subsequent call returns the next line as a null terminated string
// `it` is the iterator returned from begin_l_iter // `it` is the iterator returned from begin_l_iter
// After getting the necessary lines free the iterator (no need to go upto // After getting the necessary lines free the iterator (no need to go upto
// the end) returns null if there are no more lines All return strings // the end) returns null if there are no more lines
// `must` be freed by the caller // The string must not be freed
char *next_line(LineIterator *it, uint32_t *out_len); char *next_line(LineIterator *it, uint32_t *out_len);
// Returns the previous line as a null terminated string // Returns the previous line as a null terminated string

View File

@@ -6,12 +6,17 @@
#include "utils/utils.h" #include "utils/utils.h"
struct LSPPending { struct LSPPending {
std::string method;
Editor *editor = nullptr; Editor *editor = nullptr;
std::function<void(Editor *, const json &)> callback;
std::function<void(Editor *, std::string, json)> callback;
}; };
// TODO: Defer any editor mutation to main thread to get rid of
// all mutex locks on the editor rope.
// struct LSPPendingResponse {
// LSPPending *pending = nullptr;
// json message;
// };
struct LSPOpenRequest { struct LSPOpenRequest {
Language language; Language language;
Editor *editor; Editor *editor;
@@ -80,6 +85,7 @@ void lsp_worker();
std::shared_ptr<LSPInstance> get_or_init_lsp(std::string lsp_id); std::shared_ptr<LSPInstance> get_or_init_lsp(std::string lsp_id);
void clean_lsp(std::shared_ptr<LSPInstance> lsp, std::string lsp_id); void clean_lsp(std::shared_ptr<LSPInstance> lsp, std::string lsp_id);
void close_lsp(std::string lsp_id); void close_lsp(std::string lsp_id);
std::optional<json> read_lsp_message(int fd);
void open_editor(std::shared_ptr<LSPInstance> lsp, void open_editor(std::shared_ptr<LSPInstance> lsp,
std::pair<Language, Editor *> entry); std::pair<Language, Editor *> entry);

View File

@@ -2,6 +2,7 @@
#define MAIN_H #define MAIN_H
#include "pch.h" #include "pch.h"
#include "ui/bar.h"
#define NORMAL 0 #define NORMAL 0
#define INSERT 1 #define INSERT 1
@@ -13,5 +14,6 @@ extern std::atomic<bool> running;
extern std::atomic<uint8_t> mode; extern std::atomic<uint8_t> mode;
extern std::vector<struct Editor *> editors; extern std::vector<struct Editor *> editors;
extern uint8_t current_editor; extern uint8_t current_editor;
extern Bar bar;
#endif #endif

View File

@@ -4,11 +4,12 @@
#define PCRE2_CODE_UNIT_WIDTH 8 #define PCRE2_CODE_UNIT_WIDTH 8
#define PCRE_WORKSPACE_SIZE 512 #define PCRE_WORKSPACE_SIZE 512
#pragma clang diagnostic push #include "mruby.h"
#pragma clang diagnostic ignored "-Wunused-parameter" #include "mruby/array.h"
#include "ruby/ruby.h" #include "mruby/compile.h"
#pragma clang diagnostic pop #include "mruby/hash.h"
#include <magic.h> #include "mruby/irep.h"
#include "mruby/string.h"
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
#include <pcre2.h> #include <pcre2.h>
extern "C" { extern "C" {

53
include/ruby/decl.h Normal file
View File

@@ -0,0 +1,53 @@
#ifndef SCRIPTING_DECL_H
#define SCRIPTING_DECL_H
#include "syntax/decl.h"
#include "utils/utils.h"
namespace fs = std::filesystem;
extern std::unordered_map<std::string, std::pair<mrb_value, mrb_value>>
custom_highlighters;
extern mrb_state *mrb;
extern fs::path ruby_config_path;
struct BarLight {
uint32_t start;
uint32_t end;
Highlight highlight;
};
struct BarLine {
std::string line;
std::vector<BarLight> highlights;
Highlight get_highlight(uint32_t x) {
for (auto &hl : highlights) {
if (hl.start <= x && x <= hl.end)
return hl.highlight;
}
return {0xFFFFFF, 0, 0};
}
};
void setup_ruby_bindings(mrb_state *mrb, RClass *C_module);
void ruby_start();
void ruby_shutdown();
void ruby_copy(const char *text, size_t len);
std::string ruby_paste();
std::string ruby_file_detect(std::string filename);
void load_theme();
void load_languages_info();
uint8_t read_line_endings();
void load_custom_highlighters();
bool custom_compare(mrb_value match_block, std::string state1,
std::string state2);
std::string parse_custom(std::vector<Token> *tokens, mrb_value parser_block,
const char *line, uint32_t len, std::string state,
uint32_t c_line);
BarLine bar_contents(uint8_t mode, std::string lang_name, uint32_t warnings,
std::string lsp_name, std::string filename,
std::string foldername, uint32_t line, uint32_t max_line,
uint32_t width);
#endif

View File

@@ -1,3 +1,66 @@
def command_exists?(cmd)
system("command -v #{cmd} > /dev/null 2>&1")
end
module Clipboard
@clip = ""
@os = :os_name_placed_here
class << self
def copy(text)
if @os == :windows
IO.popen("clip", "w") { |f| f.write(text) }
elsif @os == :mac
IO.popen("pbcopy", "w") { |f| f.write(text) }
elsif @os == :linux
if ENV["XDG_SESSION_TYPE"]&.downcase == "wayland" || ENV["WAYLAND_DISPLAY"]
if command_exists?("wl-copy")
IO.popen("wl-copy", "w") { |f| f.write(text) }
else
osc52_copy(text)
end
elsif ENV["XDG_SESSION_TYPE"]&.downcase == "x11" || ENV["DISPLAY"]
if command_exists?("xsel")
IO.popen("xsel --clipboard --input", "w") { |f| f.write(text) }
elsif command_exists?("xclip")
IO.popen("xclip -selection clipboard", "w") { |f| f.write(text) }
else
osc52_copy(text)
end
end
end
@clip = text
end
def paste
if @os == :windows
return `powershell -NoProfile -Command Get-Clipboard`
elsif @os == :mac
return `pbpaste`
elsif @os == :linux
if ENV["XDG_SESSION_TYPE"]&.downcase == "wayland" || ENV["WAYLAND_DISPLAY"]
if command_exists?("wl-copy")
return `wl-paste`
end
elsif ENV["XDG_SESSION_TYPE"]&.downcase == "x11" || ENV["DISPLAY"]
if command_exists?("xsel")
return `xsel --clipboard --output`
elsif command_exists?("xclip")
return `xclip -selection clipboard -o`
else
return @clip
end
end
end
return ""
end
def osc52_copy(text)
encoded = [text].pack("m0")
print "\e]52;c;#{encoded}\a"
text
end
end
end
module C module C
@lsp_config = { @lsp_config = {
"clangd" => [ "clangd" => [
@@ -36,256 +99,186 @@ module C
color: 0x555555, color: 0x555555,
symbol: "", symbol: "",
extensions: ["c"], extensions: ["c"],
filenames: [],
mimetypes: ["text/x-c"],
lsp: "clangd" lsp: "clangd"
}, },
cpp: { cpp: {
color: 0x00599C, color: 0x00599C,
symbol: "", symbol: "",
extensions: ["cpp", "cc", "cxx"], extensions: ["cpp", "cc", "cxx"],
filenames: [],
mimetypes: ["text/x-cpp"],
lsp: "clangd" lsp: "clangd"
}, },
h: { h: {
color: 0xA8B9CC, color: 0xA8B9CC,
symbol: "", symbol: "",
extensions: ["h", "hpp"], extensions: ["h", "hpp"],
filenames: [],
mimetypes: ["text/x-c-header"],
lsp: "clangd" lsp: "clangd"
}, },
css: { css: {
color: 0x36a3d9, color: 0x36a3d9,
symbol: "", symbol: "",
extensions: ["css"], extensions: ["css"],
filenames: [],
mimetypes: ["text/css"],
lsp: "vscode-css-language-server" lsp: "vscode-css-language-server"
}, },
fish: { fish: {
color: 0x4d5a5e, color: 0x4d5a5e,
symbol: "", symbol: "",
extensions: ["fish"], extensions: ["fish"],
filenames: [],
mimetypes: ["application/x-fish"],
lsp: "fish-lsp" lsp: "fish-lsp"
}, },
go: { go: {
color: 0x00add8, color: 0x00add8,
symbol: "", symbol: "",
extensions: ["go"], extensions: ["go"],
filenames: [],
mimetypes: ["text/x-go"],
lsp: "gopls" lsp: "gopls"
}, },
gomod: { gomod: {
color: 0x00add8, color: 0x00add8,
symbol: "", symbol: "",
extensions: ["mod"], extensions: ["mod"],
filenames: [],
mimetypes: ["text/x-go-mod"],
lsp: "gopls" lsp: "gopls"
}, },
haskell: { haskell: {
color: 0xa074c4, color: 0xa074c4,
symbol: "", symbol: "",
extensions: ["hs", "lhs"], extensions: ["hs", "lhs"],
filenames: [],
mimetypes: ["text/x-haskell"],
lsp: "haskell-language-server" lsp: "haskell-language-server"
}, },
html: { html: {
color: 0xef8a91, color: 0xef8a91,
symbol: "", symbol: "",
extensions: ["html", "htm"], extensions: ["html", "htm"],
filenames: [],
mimetypes: ["text/html"],
lsp: "emmet-language-server" lsp: "emmet-language-server"
}, },
javascript: { javascript: {
color: 0xf0df8a, color: 0xf0df8a,
symbol: "", symbol: "",
extensions: ["js"], extensions: ["js"],
filenames: [],
mimetypes: ["application/javascript"],
lsp: "typescript-language-server" lsp: "typescript-language-server"
}, },
typescript: { typescript: {
color: 0x36a3d9, color: 0x36a3d9,
symbol: "", symbol: "",
extensions: ["ts"], extensions: ["ts"],
filenames: [],
mimetypes: ["application/typescript"],
lsp: "typescript-language-server" lsp: "typescript-language-server"
}, },
json: { json: {
color: 0xcbcb41, color: 0xcbcb41,
symbol: "{}", symbol: "{}",
extensions: ["json"], extensions: ["json"],
filenames: [],
mimetypes: ["application/json"],
lsp: "vscode-json-language-server" lsp: "vscode-json-language-server"
}, },
jsonc: { jsonc: {
color: 0xcbcb41, color: 0xcbcb41,
symbol: "{}", symbol: "{}",
extensions: ["jsonc"], extensions: ["jsonc"],
filenames: [],
mimetypes: ["application/json"],
lsp: "vscode-json-language-server" lsp: "vscode-json-language-server"
}, },
erb: { erb: {
color: 0x6e1516, color: 0x6e1516,
symbol: "", symbol: "",
extensions: ["erb"], extensions: ["erb"],
filenames: [],
mimetypes: ["text/x-erb"],
lsp: "ruby-lsp" lsp: "ruby-lsp"
}, },
lua: { lua: {
color: 0x36a3d9, color: 0x36a3d9,
symbol: "󰢱 ", symbol: "󰢱 ",
extensions: ["lua"], extensions: ["lua"],
filenames: [],
mimetypes: ["text/x-lua"],
lsp: "lua-language-server" lsp: "lua-language-server"
}, },
python: { python: {
color: 0x95e6cb, color: 0x95e6cb,
symbol: "󰌠 ", symbol: "󰌠 ",
extensions: ["py"], extensions: ["py"],
filenames: [],
mimetypes: ["text/x-python"],
lsp: "pyright" lsp: "pyright"
}, },
rust: { rust: {
color: 0xdea584, color: 0xdea584,
symbol: "󱘗 ", symbol: "󱘗 ",
extensions: ["rs"], extensions: ["rs"],
filenames: [],
mimetypes: ["text/x-rust"],
lsp: "rust-analyzer" lsp: "rust-analyzer"
}, },
php: { php: {
color: 0xa074c4, color: 0xa074c4,
symbol: "󰌟 ", symbol: "󰌟 ",
extensions: ["php"], extensions: ["php"],
filenames: [],
mimetypes: ["application/x-php"],
lsp: "intelephense" lsp: "intelephense"
}, },
markdown: { markdown: {
color: 0x36a3d9, color: 0x36a3d9,
symbol: "", symbol: "",
extensions: ["md", "markdown"], extensions: ["md", "markdown"],
filenames: [],
mimetypes: ["text/markdown"],
lsp: "marksman" lsp: "marksman"
}, },
nginx: { nginx: {
color: 0x6d8086, color: 0x6d8086,
symbol: "", symbol: "",
extensions: ["conf"], extensions: ["conf"],
filenames: [],
mimetypes: ["text/nginx"],
lsp: "nginx-language-server" lsp: "nginx-language-server"
}, },
toml: { toml: {
color: 0x36a3d9, color: 0x36a3d9,
symbol: "", symbol: "",
extensions: ["toml"], extensions: ["toml"],
filenames: [],
mimetypes: ["application/toml"],
lsp: "taplo" lsp: "taplo"
}, },
yaml: { yaml: {
color: 0x6d8086, color: 0x6d8086,
symbol: "", symbol: "",
extensions: ["yml", "yaml"], extensions: ["yml", "yaml"],
filenames: [],
mimetypes: ["text/yaml"],
lsp: "yaml-language-server" lsp: "yaml-language-server"
}, },
sql: { sql: {
color: 0xdad8d8, color: 0xdad8d8,
symbol: "", symbol: "",
extensions: ["sql"], extensions: ["sql"],
filenames: [],
mimetypes: ["text/x-sql"],
lsp: "sqls" lsp: "sqls"
}, },
make: { make: {
color: 0x4e5c61, color: 0x4e5c61,
symbol: "", symbol: "",
extensions: ["Makefile", "makefile"], extensions: ["Makefile", "makefile"],
filenames: [],
mimetypes: ["text/x-makefile"],
lsp: "make-language-server" lsp: "make-language-server"
}, },
gdscript: { gdscript: {
color: 0x6d8086, color: 0x6d8086,
symbol: "", symbol: "",
extensions: ["gd"], extensions: ["gd"]
filenames: [],
mimetypes: ["text/x-gdscript"],
lsp: nil
}, },
man: { man: {
color: 0xdad8d8, color: 0xdad8d8,
symbol: "", symbol: "",
extensions: ["man"], extensions: ["man"]
filenames: [],
mimetypes: ["application/x-troff-man"],
lsp: nil
}, },
diff: { diff: {
color: 0xDD4C35, color: 0xDD4C35,
symbol: "", symbol: "",
extensions: ["diff", "patch"], extensions: ["diff", "patch"]
filenames: [],
mimetypes: ["text/x-diff"],
lsp: nil
}, },
gitattributes: { gitattributes: {
color: 0xF05032, color: 0xF05032,
symbol: "", symbol: "",
extensions: ["gitattributes"], extensions: ["gitattributes"]
filenames: [],
mimetypes: [],
lsp: nil
}, },
gitignore: { gitignore: {
color: 0xF05032, color: 0xF05032,
symbol: "", symbol: "",
extensions: ["gitignore"], extensions: ["gitignore"]
filenames: [],
mimetypes: [],
lsp: nil
}, },
regex: { regex: {
color: 0x9E9E9E, color: 0x9E9E9E,
symbol: ".*", symbol: ".*",
extensions: ["regex"], extensions: ["regex"]
filenames: [],
mimetypes: [],
lsp: nil
}, },
ini: { ini: {
color: 0x6d8086, color: 0x6d8086,
symbol: "", symbol: "",
extensions: ["ini"], extensions: ["ini"]
filenames: [],
mimetypes: [],
lsp: nil
}, },
ruby: { ruby: {
color: 0xff8087, color: 0xff8087,
symbol: "󰴭 ", symbol: "󰴭 ",
extensions: ["rb"], extensions: ["rb"],
filenames: ["Gemfile"], filenames: ["Gemfile"],
mimetypes: ["text/x-ruby"],
lsp: "solargraph" lsp: "solargraph"
}, },
bash: { bash: {
@@ -293,8 +286,12 @@ module C
symbol: "", symbol: "",
extensions: ["sh"], extensions: ["sh"],
filenames: ["bash_profile", "bashrc"], filenames: ["bash_profile", "bashrc"],
mimetypes: ["text/x-sh"],
lsp: "bash-language-server" lsp: "bash-language-server"
},
default: {
color: 0x6d8086,
symbol: "󰈚 ",
extensions: []
} }
} }
@theme = { @theme = {
@@ -307,10 +304,8 @@ module C
:interpolation => { fg: 0x7DCFFF }, :interpolation => { fg: 0x7DCFFF },
:regexp => { fg: 0xD2A6FF }, :regexp => { fg: 0xD2A6FF },
:number => { fg: 0xE6C08A }, :number => { fg: 0xE6C08A },
# rubocop:disable Lint/BooleanSymbol
:true => { fg: 0x7AE93C }, :true => { fg: 0x7AE93C },
:false => { fg: 0xEF5168 }, :false => { fg: 0xEF5168 },
# rubocop:enable Lint/BooleanSymbol
:char => { fg: 0xFFAF70 }, :char => { fg: 0xFFAF70 },
:keyword => { fg: 0xFF8F40 }, :keyword => { fg: 0xFF8F40 },
:keywordoperator => { fg: 0xF07178 }, :keywordoperator => { fg: 0xF07178 },
@@ -333,14 +328,96 @@ module C
@key_handlers = {} @key_handlers = {}
@key_binds = {} @key_binds = {}
@highlighters = {} @highlighters = {}
@log_queue = []
@b_startup = nil @b_startup = nil
@b_shutdown = nil @b_shutdown = nil
@b_bar = proc do |info|
# mode, lang_name, warnings, lsp_name, filename, foldername, line, max_line, width
# puts info.inspect
mode_color = 0x82AAFF
mode_symbol = " "
case info[:mode]
when :normal
mode_color = 0x82AAFF
mode_symbol = ""
when :insert
mode_color = 0xFF8F40
mode_symbol = "󱓧 "
when :select
mode_color = 0x9ADE7A
mode_symbol = "󱩧 "
when :runner
mode_color = 0xFFD700
mode_symbol = ""
when :jumper
mode_color = 0xF29CC3
mode_symbol = ""
end
lang_info = C.languages[info[:lang_name]]
if lang_info.nil?
lang_info = C.languages[:default]
end
filename = File.basename(info[:filename])
starting = " #{mode_symbol} #{info[:mode].to_s.upcase}  #{lang_info[:symbol]} #{filename}"
highlights = []
highlights << { fg: 0x0b0e14, bg: mode_color, flags: 1 << 1, start: 0, length: 10 }
highlights << { fg: mode_color, bg: 0x33363c, start: 10, length: 1 }
highlights << { fg: 0x33363c, bg: 0x24272d, start: 11, length: 1 }
highlights << { fg: lang_info[:color], bg: 0x24272d, start: 13, length: 2 }
highlights << { fg: 0xced4df, bg: 0x24272d, start: 15, length: filename.length + 1 }
highlights << { fg: 0x24272d, bg: 0x000000, start: 15 + filename.length + 1, length: 1 }
next {
text: starting,
highlights: highlights
}
end
@b_copy = proc do |text|
Clipboard.copy(text)
end
@b_paste = proc do
next Clipboard.paste
end
@b_file_detect = proc do |filename|
type = :default
next type unless File.exist?(filename)
first_line = File.open(filename, &:readline).chomp
if first_line.start_with?("#!")
shebang = first_line[2..].downcase
type = case shebang
when /bash/, /sh/ then :bash
when /fish/ then :fish
when /python/ then :python
when /ruby/ then :ruby
when /lua/ then :lua
else :default
end
next type
end
next type if :os_name_placed_here != :linux || :os_name_placed_here != :mac
next type if !command_exists?("file")
mimetype = `file --mime-type -b #{filename}`.chomp
type = case mimetype
when /shellscript/ then :bash
when /ruby/ then :ruby
when /diff/ then :diff
when /html/ then :html
when /python/ then :python
when /javascript/ then :javascript
when /makefile/ then :makefile
when /-c$/ then :c
else :default
end
next type
end
class << self class << self
attr_accessor :theme, :lsp_config, :languages, attr_accessor :theme, :lsp_config, :languages,
:line_endings, :highlighters :line_endings, :highlighters
attr_reader :b_startup, :b_shutdown, :b_extra_highlights attr_reader :b_startup, :b_shutdown, :b_extra_highlights,
:b_bar, :b_copy, :b_paste, :b_file_detect
def bar=(&block)
@b_bar = block
end
def startup(&block) def startup(&block)
@b_startup = block @b_startup = block
@@ -350,15 +427,16 @@ module C
@b_shutdown = block @b_shutdown = block
end end
def queue_log(msg) def copy(&block)
@log_queue << msg @b_copy = block
end end
def log_all def paste(&block)
@log_queue.each do |msg| @b_paste = block
puts msg end
end
@log_queue = [] def file_detect(&block)
@b_file_detect = block
end end
def extra_highlights(&block) def extra_highlights(&block)
@@ -397,4 +475,22 @@ module C
end end
end end
at_exit { C.log_all } $LOADED ||= []
$BIND_TOP = binding
module Kernel
def require_relative(path, bind = nil)
path += ".rb" unless path.end_with?(".rb")
path = File.expand_path(path, File.dirname(C.config_file))
return if $LOADED.include?(path)
$LOADED << path
code = File.read(path)
eval(code, bind || $BIND_TOP, path)
end
def load(path, bind = nil)
path += ".rb" unless path.end_with?(".rb")
path = File.expand_path(path, File.dirname(C.config_file))
$LOADED.delete(path)
require_relative(path, bind)
end
end

View File

@@ -0,0 +1,938 @@
#pragma once
constexpr unsigned char _tmp___crib_precompiled_mrb[] = {
0x52, 0x49, 0x54, 0x45, 0x30, 0x34, 0x30, 0x30, 0x00, 0x00, 0x2b, 0xbe,
0x4d, 0x41, 0x54, 0x5a, 0x30, 0x30, 0x30, 0x30, 0x49, 0x52, 0x45, 0x50,
0x00, 0x00, 0x2a, 0x2a, 0x30, 0x34, 0x30, 0x30, 0x00, 0x00, 0x00, 0xa2,
0x00, 0x01, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a,
0x11, 0x01, 0x68, 0x01, 0x00, 0x69, 0x01, 0x00, 0x6b, 0x01, 0x01, 0x01,
0x11, 0x01, 0x68, 0x01, 0x02, 0x69, 0x01, 0x02, 0x11, 0x01, 0x68, 0x01,
0x03, 0x69, 0x01, 0x03, 0x15, 0x01, 0x04, 0x27, 0x01, 0x00, 0x06, 0x52,
0x01, 0x00, 0x16, 0x01, 0x04, 0x30, 0x01, 0x05, 0x16, 0x01, 0x06, 0x11,
0x01, 0x68, 0x01, 0x07, 0x69, 0x01, 0x04, 0x3d, 0x01, 0x76, 0x00, 0x00,
0x00, 0x08, 0x00, 0x06, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x00, 0x00,
0x0f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x5f, 0x65, 0x78, 0x69,
0x73, 0x74, 0x73, 0x3f, 0x00, 0x00, 0x09, 0x43, 0x6c, 0x69, 0x70, 0x62,
0x6f, 0x61, 0x72, 0x64, 0x00, 0x00, 0x01, 0x43, 0x00, 0x00, 0x07, 0x24,
0x4c, 0x4f, 0x41, 0x44, 0x45, 0x44, 0x00, 0x00, 0x07, 0x62, 0x69, 0x6e,
0x64, 0x69, 0x6e, 0x67, 0x00, 0x00, 0x09, 0x24, 0x42, 0x49, 0x4e, 0x44,
0x5f, 0x54, 0x4f, 0x50, 0x00, 0x00, 0x06, 0x4b, 0x65, 0x72, 0x6e, 0x65,
0x6c, 0x00, 0x00, 0x00, 0x03, 0xfc, 0x00, 0x01, 0x00, 0x03, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x3b, 0x06, 0x01, 0x1e, 0x01, 0x00, 0x07,
0x01, 0x1e, 0x01, 0x01, 0x08, 0x01, 0x1e, 0x01, 0x02, 0x09, 0x01, 0x1e,
0x01, 0x03, 0x0a, 0x01, 0x1e, 0x01, 0x04, 0x0b, 0x01, 0x1e, 0x01, 0x05,
0x0c, 0x01, 0x1e, 0x01, 0x06, 0x0d, 0x01, 0x1e, 0x01, 0x07, 0x03, 0x01,
0x08, 0x1e, 0x01, 0x08, 0x03, 0x01, 0x09, 0x1e, 0x01, 0x09, 0x03, 0x01,
0x0a, 0x1e, 0x01, 0x0a, 0x03, 0x01, 0x0b, 0x1e, 0x01, 0x0b, 0x03, 0x01,
0x0c, 0x1e, 0x01, 0x0c, 0x03, 0x01, 0x0d, 0x1e, 0x01, 0x0d, 0x03, 0x01,
0x0e, 0x1e, 0x01, 0x0e, 0x03, 0x01, 0x0f, 0x1e, 0x01, 0x0f, 0x03, 0x01,
0x10, 0x1e, 0x01, 0x10, 0x03, 0x01, 0x11, 0x1e, 0x01, 0x11, 0x03, 0x01,
0x12, 0x1e, 0x01, 0x12, 0x03, 0x01, 0x13, 0x1e, 0x01, 0x13, 0x03, 0x01,
0x14, 0x1e, 0x01, 0x14, 0x03, 0x01, 0x15, 0x1e, 0x01, 0x15, 0x03, 0x01,
0x16, 0x1e, 0x01, 0x16, 0x03, 0x01, 0x17, 0x1e, 0x01, 0x17, 0x03, 0x01,
0x18, 0x1e, 0x01, 0x18, 0x03, 0x01, 0x19, 0x1e, 0x01, 0x19, 0x03, 0x01,
0x1a, 0x1e, 0x01, 0x1a, 0x03, 0x01, 0x1b, 0x1e, 0x01, 0x1b, 0x03, 0x01,
0x1c, 0x1e, 0x01, 0x1c, 0x03, 0x01, 0x1d, 0x1e, 0x01, 0x1d, 0x03, 0x01,
0x1e, 0x1e, 0x01, 0x1e, 0x03, 0x01, 0x1f, 0x1e, 0x01, 0x1f, 0x03, 0x01,
0x20, 0x1e, 0x01, 0x20, 0x03, 0x01, 0x21, 0x1e, 0x01, 0x21, 0x03, 0x01,
0x22, 0x1e, 0x01, 0x22, 0x03, 0x01, 0x23, 0x1e, 0x01, 0x23, 0x03, 0x01,
0x24, 0x1e, 0x01, 0x24, 0x03, 0x01, 0x25, 0x1e, 0x01, 0x25, 0x03, 0x01,
0x26, 0x1e, 0x01, 0x26, 0x03, 0x01, 0x27, 0x1e, 0x01, 0x27, 0x03, 0x01,
0x28, 0x1e, 0x01, 0x28, 0x03, 0x01, 0x29, 0x1e, 0x01, 0x29, 0x03, 0x01,
0x2a, 0x1e, 0x01, 0x2a, 0x03, 0x01, 0x2b, 0x1e, 0x01, 0x2b, 0x03, 0x01,
0x2c, 0x1e, 0x01, 0x2c, 0x03, 0x01, 0x2d, 0x1e, 0x01, 0x2d, 0x03, 0x01,
0x2e, 0x1e, 0x01, 0x2e, 0x03, 0x01, 0x2f, 0x1e, 0x01, 0x2f, 0x03, 0x01,
0x30, 0x1e, 0x01, 0x30, 0x03, 0x01, 0x31, 0x1e, 0x01, 0x31, 0x03, 0x01,
0x32, 0x1e, 0x01, 0x32, 0x03, 0x01, 0x33, 0x1e, 0x01, 0x33, 0x03, 0x01,
0x34, 0x1e, 0x01, 0x34, 0x30, 0x01, 0x35, 0x3d, 0x00, 0x00, 0x00, 0x00,
0x36, 0x00, 0x06, 0x4b, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x00, 0x00, 0x09,
0x4b, 0x5f, 0x53, 0x48, 0x45, 0x42, 0x41, 0x4e, 0x47, 0x00, 0x00, 0x09,
0x4b, 0x5f, 0x43, 0x4f, 0x4d, 0x4d, 0x45, 0x4e, 0x54, 0x00, 0x00, 0x07,
0x4b, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x00, 0x00, 0x08, 0x4b, 0x5f,
0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x00, 0x00, 0x08, 0x4b, 0x5f, 0x45,
0x53, 0x43, 0x41, 0x50, 0x45, 0x00, 0x00, 0x0f, 0x4b, 0x5f, 0x49, 0x4e,
0x54, 0x45, 0x52, 0x50, 0x4f, 0x4c, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x00,
0x00, 0x08, 0x4b, 0x5f, 0x52, 0x45, 0x47, 0x45, 0x58, 0x50, 0x00, 0x00,
0x08, 0x4b, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x00, 0x00, 0x06,
0x4b, 0x5f, 0x54, 0x52, 0x55, 0x45, 0x00, 0x00, 0x07, 0x4b, 0x5f, 0x46,
0x41, 0x4c, 0x53, 0x45, 0x00, 0x00, 0x06, 0x4b, 0x5f, 0x43, 0x48, 0x41,
0x52, 0x00, 0x00, 0x09, 0x4b, 0x5f, 0x4b, 0x45, 0x59, 0x57, 0x4f, 0x52,
0x44, 0x00, 0x00, 0x11, 0x4b, 0x5f, 0x4b, 0x45, 0x59, 0x57, 0x4f, 0x52,
0x44, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x4f, 0x52, 0x00, 0x00, 0x0a,
0x4b, 0x5f, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x4f, 0x52, 0x00, 0x00,
0x0a, 0x4b, 0x5f, 0x46, 0x55, 0x4e, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x00,
0x00, 0x06, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x00, 0x00, 0x0a, 0x4b,
0x5f, 0x43, 0x4f, 0x4e, 0x53, 0x54, 0x41, 0x4e, 0x54, 0x00, 0x00, 0x12,
0x4b, 0x5f, 0x56, 0x41, 0x52, 0x49, 0x41, 0x42, 0x4c, 0x45, 0x49, 0x4e,
0x53, 0x54, 0x41, 0x4e, 0x43, 0x45, 0x00, 0x00, 0x10, 0x4b, 0x5f, 0x56,
0x41, 0x52, 0x49, 0x41, 0x42, 0x4c, 0x45, 0x47, 0x4c, 0x4f, 0x42, 0x41,
0x4c, 0x00, 0x00, 0x0c, 0x4b, 0x5f, 0x41, 0x4e, 0x4e, 0x4f, 0x54, 0x41,
0x54, 0x49, 0x4f, 0x4e, 0x00, 0x00, 0x0b, 0x4b, 0x5f, 0x44, 0x49, 0x52,
0x45, 0x43, 0x54, 0x49, 0x56, 0x45, 0x00, 0x00, 0x07, 0x4b, 0x5f, 0x4c,
0x41, 0x42, 0x45, 0x4c, 0x00, 0x00, 0x08, 0x4b, 0x5f, 0x42, 0x52, 0x41,
0x43, 0x45, 0x31, 0x00, 0x00, 0x08, 0x4b, 0x5f, 0x42, 0x52, 0x41, 0x43,
0x45, 0x32, 0x00, 0x00, 0x08, 0x4b, 0x5f, 0x42, 0x52, 0x41, 0x43, 0x45,
0x33, 0x00, 0x00, 0x08, 0x4b, 0x5f, 0x42, 0x52, 0x41, 0x43, 0x45, 0x34,
0x00, 0x00, 0x08, 0x4b, 0x5f, 0x42, 0x52, 0x41, 0x43, 0x45, 0x35, 0x00,
0x00, 0x0a, 0x4b, 0x5f, 0x48, 0x45, 0x41, 0x44, 0x49, 0x4e, 0x47, 0x31,
0x00, 0x00, 0x0a, 0x4b, 0x5f, 0x48, 0x45, 0x41, 0x44, 0x49, 0x4e, 0x47,
0x32, 0x00, 0x00, 0x0a, 0x4b, 0x5f, 0x48, 0x45, 0x41, 0x44, 0x49, 0x4e,
0x47, 0x33, 0x00, 0x00, 0x0a, 0x4b, 0x5f, 0x48, 0x45, 0x41, 0x44, 0x49,
0x4e, 0x47, 0x34, 0x00, 0x00, 0x0a, 0x4b, 0x5f, 0x48, 0x45, 0x41, 0x44,
0x49, 0x4e, 0x47, 0x35, 0x00, 0x00, 0x0a, 0x4b, 0x5f, 0x48, 0x45, 0x41,
0x44, 0x49, 0x4e, 0x47, 0x36, 0x00, 0x00, 0x0c, 0x4b, 0x5f, 0x42, 0x4c,
0x4f, 0x43, 0x4b, 0x51, 0x55, 0x4f, 0x54, 0x45, 0x00, 0x00, 0x06, 0x4b,
0x5f, 0x4c, 0x49, 0x53, 0x54, 0x00, 0x00, 0x0a, 0x4b, 0x5f, 0x4c, 0x49,
0x53, 0x54, 0x49, 0x54, 0x45, 0x4d, 0x00, 0x00, 0x06, 0x4b, 0x5f, 0x43,
0x4f, 0x44, 0x45, 0x00, 0x00, 0x0e, 0x4b, 0x5f, 0x4c, 0x41, 0x4e, 0x47,
0x55, 0x41, 0x47, 0x45, 0x4e, 0x41, 0x4d, 0x45, 0x00, 0x00, 0x0b, 0x4b,
0x5f, 0x4c, 0x49, 0x4e, 0x4b, 0x4c, 0x41, 0x42, 0x45, 0x4c, 0x00, 0x00,
0x0c, 0x4b, 0x5f, 0x49, 0x4d, 0x41, 0x47, 0x45, 0x4c, 0x41, 0x42, 0x45,
0x4c, 0x00, 0x00, 0x06, 0x4b, 0x5f, 0x4c, 0x49, 0x4e, 0x4b, 0x00, 0x00,
0x07, 0x4b, 0x5f, 0x54, 0x41, 0x42, 0x4c, 0x45, 0x00, 0x00, 0x0d, 0x4b,
0x5f, 0x54, 0x41, 0x42, 0x4c, 0x45, 0x48, 0x45, 0x41, 0x44, 0x45, 0x52,
0x00, 0x00, 0x08, 0x4b, 0x5f, 0x49, 0x54, 0x41, 0x4c, 0x49, 0x43, 0x00,
0x00, 0x06, 0x4b, 0x5f, 0x42, 0x4f, 0x4c, 0x44, 0x00, 0x00, 0x0b, 0x4b,
0x5f, 0x55, 0x4e, 0x44, 0x45, 0x52, 0x4c, 0x49, 0x4e, 0x45, 0x00, 0x00,
0x0f, 0x4b, 0x5f, 0x53, 0x54, 0x52, 0x49, 0x4b, 0x45, 0x54, 0x48, 0x52,
0x4f, 0x55, 0x47, 0x48, 0x00, 0x00, 0x10, 0x4b, 0x5f, 0x48, 0x4f, 0x52,
0x49, 0x58, 0x4f, 0x4e, 0x54, 0x41, 0x4c, 0x52, 0x55, 0x4c, 0x45, 0x00,
0x00, 0x05, 0x4b, 0x5f, 0x54, 0x41, 0x47, 0x00, 0x00, 0x0b, 0x4b, 0x5f,
0x41, 0x54, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x45, 0x00, 0x00, 0x0b,
0x4b, 0x5f, 0x43, 0x48, 0x45, 0x43, 0x4b, 0x44, 0x4f, 0x4e, 0x45, 0x00,
0x00, 0x0e, 0x4b, 0x5f, 0x43, 0x48, 0x45, 0x43, 0x4b, 0x4e, 0x4f, 0x54,
0x44, 0x4f, 0x4e, 0x45, 0x00, 0x00, 0x06, 0x66, 0x72, 0x65, 0x65, 0x7a,
0x65, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x39, 0x04, 0x00, 0x00, 0x5c, 0x04,
0x00, 0x01, 0x05, 0x01, 0x5d, 0x04, 0x5c, 0x05, 0x01, 0x5d, 0x04, 0x2f,
0x03, 0x00, 0x01, 0x3d, 0x03, 0x00, 0x02, 0x00, 0x00, 0x0b, 0x63, 0x6f,
0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x20, 0x2d, 0x76, 0x20, 0x00, 0x00, 0x00,
0x11, 0x20, 0x3e, 0x20, 0x2f, 0x64, 0x65, 0x76, 0x2f, 0x6e, 0x75, 0x6c,
0x6c, 0x20, 0x32, 0x3e, 0x26, 0x31, 0x00, 0x00, 0x01, 0x00, 0x06, 0x73,
0x79, 0x73, 0x74, 0x65, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x43, 0x00, 0x01,
0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x5c, 0x01,
0x00, 0x1a, 0x01, 0x00, 0x10, 0x01, 0x01, 0x1a, 0x01, 0x02, 0x12, 0x01,
0x6f, 0x01, 0x69, 0x01, 0x00, 0x3d, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x03, 0x00, 0x05, 0x40, 0x63, 0x6c, 0x69, 0x70, 0x00, 0x00,
0x05, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x00, 0x00, 0x03, 0x40, 0x6f, 0x73,
0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x01, 0x00, 0x01, 0x00, 0x03, 0x00,
0x00, 0x00, 0x00, 0x00, 0x0e, 0x6b, 0x01, 0x00, 0x00, 0x6b, 0x01, 0x01,
0x01, 0x6b, 0x01, 0x02, 0x02, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00,
0x04, 0x63, 0x6f, 0x70, 0x79, 0x00, 0x00, 0x05, 0x70, 0x61, 0x73, 0x74,
0x65, 0x00, 0x00, 0x0a, 0x6f, 0x73, 0x63, 0x35, 0x32, 0x5f, 0x63, 0x6f,
0x70, 0x79, 0x00, 0x00, 0x00, 0x02, 0x37, 0x00, 0x03, 0x00, 0x07, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0f, 0x39, 0x04, 0x00, 0x00, 0x19,
0x03, 0x00, 0x10, 0x04, 0x01, 0x4d, 0x03, 0x28, 0x03, 0x00, 0x13, 0x1d,
0x03, 0x02, 0x5c, 0x04, 0x00, 0x5c, 0x05, 0x01, 0x62, 0x06, 0x00, 0x34,
0x03, 0x03, 0x02, 0x26, 0x00, 0xe4, 0x19, 0x03, 0x00, 0x10, 0x04, 0x04,
0x4d, 0x03, 0x28, 0x03, 0x00, 0x13, 0x1d, 0x03, 0x02, 0x5c, 0x04, 0x02,
0x5c, 0x05, 0x01, 0x62, 0x06, 0x01, 0x34, 0x03, 0x03, 0x02, 0x26, 0x00,
0xc5, 0x19, 0x03, 0x00, 0x10, 0x04, 0x05, 0x4d, 0x03, 0x28, 0x03, 0x00,
0xb9, 0x1d, 0x03, 0x06, 0x5c, 0x04, 0x03, 0x23, 0x03, 0x01, 0x04, 0x03,
0x29, 0x04, 0x00, 0x03, 0x33, 0x03, 0x07, 0x5c, 0x04, 0x04, 0x4d, 0x03,
0x27, 0x03, 0x00, 0x08, 0x1d, 0x03, 0x06, 0x5c, 0x04, 0x05, 0x23, 0x03,
0x28, 0x03, 0x00, 0x28, 0x5c, 0x04, 0x06, 0x2f, 0x03, 0x08, 0x01, 0x28,
0x03, 0x00, 0x13, 0x1d, 0x03, 0x02, 0x5c, 0x04, 0x06, 0x5c, 0x05, 0x01,
0x62, 0x06, 0x02, 0x34, 0x03, 0x03, 0x02, 0x26, 0x00, 0x07, 0x01, 0x04,
0x01, 0x2f, 0x03, 0x09, 0x01, 0x26, 0x00, 0x6a, 0x1d, 0x03, 0x06, 0x5c,
0x04, 0x03, 0x23, 0x03, 0x01, 0x04, 0x03, 0x29, 0x04, 0x00, 0x03, 0x33,
0x03, 0x07, 0x5c, 0x04, 0x07, 0x4d, 0x03, 0x27, 0x03, 0x00, 0x08, 0x1d,
0x03, 0x06, 0x5c, 0x04, 0x08, 0x23, 0x03, 0x28, 0x03, 0x00, 0x43, 0x5c,
0x04, 0x09, 0x2f, 0x03, 0x08, 0x01, 0x28, 0x03, 0x00, 0x13, 0x1d, 0x03,
0x02, 0x5c, 0x04, 0x0a, 0x5c, 0x05, 0x01, 0x62, 0x06, 0x03, 0x34, 0x03,
0x03, 0x02, 0x26, 0x00, 0x25, 0x5c, 0x04, 0x0b, 0x2f, 0x03, 0x08, 0x01,
0x28, 0x03, 0x00, 0x13, 0x1d, 0x03, 0x02, 0x5c, 0x04, 0x0c, 0x5c, 0x05,
0x01, 0x62, 0x06, 0x04, 0x34, 0x03, 0x03, 0x02, 0x26, 0x00, 0x07, 0x01,
0x04, 0x01, 0x2f, 0x03, 0x09, 0x01, 0x01, 0x03, 0x01, 0x1a, 0x03, 0x0a,
0x3d, 0x03, 0x00, 0x0d, 0x00, 0x00, 0x04, 0x63, 0x6c, 0x69, 0x70, 0x00,
0x00, 0x00, 0x01, 0x77, 0x00, 0x00, 0x00, 0x06, 0x70, 0x62, 0x63, 0x6f,
0x70, 0x79, 0x00, 0x00, 0x00, 0x10, 0x58, 0x44, 0x47, 0x5f, 0x53, 0x45,
0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x00, 0x00,
0x00, 0x07, 0x77, 0x61, 0x79, 0x6c, 0x61, 0x6e, 0x64, 0x00, 0x00, 0x00,
0x0f, 0x57, 0x41, 0x59, 0x4c, 0x41, 0x4e, 0x44, 0x5f, 0x44, 0x49, 0x53,
0x50, 0x4c, 0x41, 0x59, 0x00, 0x00, 0x00, 0x07, 0x77, 0x6c, 0x2d, 0x63,
0x6f, 0x70, 0x79, 0x00, 0x00, 0x00, 0x03, 0x78, 0x31, 0x31, 0x00, 0x00,
0x00, 0x07, 0x44, 0x49, 0x53, 0x50, 0x4c, 0x41, 0x59, 0x00, 0x00, 0x00,
0x04, 0x78, 0x73, 0x65, 0x6c, 0x00, 0x00, 0x00, 0x18, 0x78, 0x73, 0x65,
0x6c, 0x20, 0x2d, 0x2d, 0x63, 0x6c, 0x69, 0x70, 0x62, 0x6f, 0x61, 0x72,
0x64, 0x20, 0x2d, 0x2d, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x00, 0x00, 0x00,
0x05, 0x78, 0x63, 0x6c, 0x69, 0x70, 0x00, 0x00, 0x00, 0x1a, 0x78, 0x63,
0x6c, 0x69, 0x70, 0x20, 0x2d, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69,
0x6f, 0x6e, 0x20, 0x63, 0x6c, 0x69, 0x70, 0x62, 0x6f, 0x61, 0x72, 0x64,
0x00, 0x00, 0x0b, 0x00, 0x03, 0x40, 0x6f, 0x73, 0x00, 0x00, 0x07, 0x77,
0x69, 0x6e, 0x64, 0x6f, 0x77, 0x73, 0x00, 0x00, 0x02, 0x49, 0x4f, 0x00,
0x00, 0x05, 0x70, 0x6f, 0x70, 0x65, 0x6e, 0x00, 0x00, 0x03, 0x6d, 0x61,
0x63, 0x00, 0x00, 0x05, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x00, 0x00, 0x03,
0x45, 0x4e, 0x56, 0x00, 0x00, 0x08, 0x64, 0x6f, 0x77, 0x6e, 0x63, 0x61,
0x73, 0x65, 0x00, 0x00, 0x0f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64,
0x5f, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x3f, 0x00, 0x00, 0x0a, 0x6f,
0x73, 0x63, 0x35, 0x32, 0x5f, 0x63, 0x6f, 0x70, 0x79, 0x00, 0x00, 0x05,
0x40, 0x63, 0x6c, 0x69, 0x70, 0x00, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x03,
0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x39, 0x04,
0x00, 0x00, 0x01, 0x03, 0x01, 0x21, 0x04, 0x01, 0x00, 0x32, 0x03, 0x00,
0x01, 0x3d, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x77, 0x72, 0x69,
0x74, 0x65, 0x00, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x03, 0x00, 0x06, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x39, 0x04, 0x00, 0x00, 0x01,
0x03, 0x01, 0x21, 0x04, 0x01, 0x00, 0x32, 0x03, 0x00, 0x01, 0x3d, 0x03,
0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x77, 0x72, 0x69, 0x74, 0x65, 0x00,
0x00, 0x00, 0x00, 0x2d, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x11, 0x39, 0x04, 0x00, 0x00, 0x01, 0x03, 0x01, 0x21,
0x04, 0x01, 0x00, 0x32, 0x03, 0x00, 0x01, 0x3d, 0x03, 0x00, 0x00, 0x00,
0x01, 0x00, 0x05, 0x77, 0x72, 0x69, 0x74, 0x65, 0x00, 0x00, 0x00, 0x00,
0x2d, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x11, 0x39, 0x04, 0x00, 0x00, 0x01, 0x03, 0x01, 0x21, 0x04, 0x01, 0x00,
0x32, 0x03, 0x00, 0x01, 0x3d, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05,
0x77, 0x72, 0x69, 0x74, 0x65, 0x00, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x03,
0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x39, 0x04,
0x00, 0x00, 0x01, 0x03, 0x01, 0x21, 0x04, 0x01, 0x00, 0x32, 0x03, 0x00,
0x01, 0x3d, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x77, 0x72, 0x69,
0x74, 0x65, 0x00, 0x00, 0x00, 0x02, 0x27, 0x00, 0x02, 0x00, 0x05, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdd, 0x39, 0x00, 0x00, 0x00, 0x19,
0x02, 0x00, 0x10, 0x03, 0x01, 0x4d, 0x02, 0x28, 0x02, 0x00, 0x0c, 0x5c,
0x03, 0x00, 0x2f, 0x02, 0x02, 0x01, 0x3d, 0x02, 0x26, 0x00, 0xbc, 0x19,
0x02, 0x00, 0x10, 0x03, 0x03, 0x4d, 0x02, 0x28, 0x02, 0x00, 0x0c, 0x5c,
0x03, 0x01, 0x2f, 0x02, 0x02, 0x01, 0x3d, 0x02, 0x26, 0x00, 0xa4, 0x19,
0x02, 0x00, 0x10, 0x03, 0x04, 0x4d, 0x02, 0x28, 0x02, 0x00, 0x98, 0x1d,
0x02, 0x05, 0x5c, 0x03, 0x02, 0x23, 0x02, 0x01, 0x03, 0x02, 0x29, 0x03,
0x00, 0x03, 0x33, 0x02, 0x06, 0x5c, 0x03, 0x03, 0x4d, 0x02, 0x27, 0x02,
0x00, 0x08, 0x1d, 0x02, 0x05, 0x5c, 0x03, 0x04, 0x23, 0x02, 0x28, 0x02,
0x00, 0x17, 0x5c, 0x03, 0x05, 0x2f, 0x02, 0x07, 0x01, 0x28, 0x02, 0x00,
0x09, 0x5c, 0x03, 0x06, 0x2f, 0x02, 0x02, 0x01, 0x3d, 0x02, 0x26, 0x00,
0x5a, 0x1d, 0x02, 0x05, 0x5c, 0x03, 0x02, 0x23, 0x02, 0x01, 0x03, 0x02,
0x29, 0x03, 0x00, 0x03, 0x33, 0x02, 0x06, 0x5c, 0x03, 0x07, 0x4d, 0x02,
0x27, 0x02, 0x00, 0x08, 0x1d, 0x02, 0x05, 0x5c, 0x03, 0x08, 0x23, 0x02,
0x28, 0x02, 0x00, 0x33, 0x5c, 0x03, 0x09, 0x2f, 0x02, 0x07, 0x01, 0x28,
0x02, 0x00, 0x0c, 0x5c, 0x03, 0x0a, 0x2f, 0x02, 0x02, 0x01, 0x3d, 0x02,
0x26, 0x00, 0x1c, 0x5c, 0x03, 0x0b, 0x2f, 0x02, 0x07, 0x01, 0x28, 0x02,
0x00, 0x0c, 0x5c, 0x03, 0x0c, 0x2f, 0x02, 0x02, 0x01, 0x3d, 0x02, 0x26,
0x00, 0x05, 0x19, 0x02, 0x08, 0x3d, 0x02, 0x5c, 0x02, 0x0d, 0x3d, 0x02,
0x00, 0x0e, 0x00, 0x00, 0x2c, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x73, 0x68,
0x65, 0x6c, 0x6c, 0x20, 0x2d, 0x4e, 0x6f, 0x50, 0x72, 0x6f, 0x66, 0x69,
0x6c, 0x65, 0x20, 0x2d, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x20,
0x47, 0x65, 0x74, 0x2d, 0x43, 0x6c, 0x69, 0x70, 0x62, 0x6f, 0x61, 0x72,
0x64, 0x00, 0x00, 0x00, 0x07, 0x70, 0x62, 0x70, 0x61, 0x73, 0x74, 0x65,
0x00, 0x00, 0x00, 0x10, 0x58, 0x44, 0x47, 0x5f, 0x53, 0x45, 0x53, 0x53,
0x49, 0x4f, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x00, 0x00, 0x00, 0x07,
0x77, 0x61, 0x79, 0x6c, 0x61, 0x6e, 0x64, 0x00, 0x00, 0x00, 0x0f, 0x57,
0x41, 0x59, 0x4c, 0x41, 0x4e, 0x44, 0x5f, 0x44, 0x49, 0x53, 0x50, 0x4c,
0x41, 0x59, 0x00, 0x00, 0x00, 0x07, 0x77, 0x6c, 0x2d, 0x63, 0x6f, 0x70,
0x79, 0x00, 0x00, 0x00, 0x08, 0x77, 0x6c, 0x2d, 0x70, 0x61, 0x73, 0x74,
0x65, 0x00, 0x00, 0x00, 0x03, 0x78, 0x31, 0x31, 0x00, 0x00, 0x00, 0x07,
0x44, 0x49, 0x53, 0x50, 0x4c, 0x41, 0x59, 0x00, 0x00, 0x00, 0x04, 0x78,
0x73, 0x65, 0x6c, 0x00, 0x00, 0x00, 0x19, 0x78, 0x73, 0x65, 0x6c, 0x20,
0x2d, 0x2d, 0x63, 0x6c, 0x69, 0x70, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x20,
0x2d, 0x2d, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x00, 0x00, 0x00, 0x05,
0x78, 0x63, 0x6c, 0x69, 0x70, 0x00, 0x00, 0x00, 0x1d, 0x78, 0x63, 0x6c,
0x69, 0x70, 0x20, 0x2d, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f,
0x6e, 0x20, 0x63, 0x6c, 0x69, 0x70, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x20,
0x2d, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x03, 0x40,
0x6f, 0x73, 0x00, 0x00, 0x07, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x73,
0x00, 0x00, 0x01, 0x60, 0x00, 0x00, 0x03, 0x6d, 0x61, 0x63, 0x00, 0x00,
0x05, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x00, 0x00, 0x03, 0x45, 0x4e, 0x56,
0x00, 0x00, 0x08, 0x64, 0x6f, 0x77, 0x6e, 0x63, 0x61, 0x73, 0x65, 0x00,
0x00, 0x0f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x5f, 0x65, 0x78,
0x69, 0x73, 0x74, 0x73, 0x3f, 0x00, 0x00, 0x05, 0x40, 0x63, 0x6c, 0x69,
0x70, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x27, 0x39, 0x04, 0x00, 0x00, 0x01, 0x04,
0x01, 0x52, 0x04, 0x01, 0x5c, 0x05, 0x00, 0x32, 0x04, 0x00, 0x01, 0x01,
0x03, 0x04, 0x5c, 0x05, 0x01, 0x01, 0x06, 0x03, 0x5d, 0x05, 0x5c, 0x06,
0x02, 0x5d, 0x05, 0x2f, 0x04, 0x01, 0x01, 0x3d, 0x01, 0x00, 0x03, 0x00,
0x00, 0x02, 0x6d, 0x30, 0x00, 0x00, 0x00, 0x07, 0x1b, 0x5d, 0x35, 0x32,
0x3b, 0x63, 0x3b, 0x00, 0x00, 0x00, 0x01, 0x07, 0x00, 0x00, 0x02, 0x00,
0x04, 0x70, 0x61, 0x63, 0x6b, 0x00, 0x00, 0x05, 0x70, 0x72, 0x69, 0x6e,
0x74, 0x00, 0x00, 0x00, 0x0f, 0xc7, 0x00, 0x01, 0x00, 0x4c, 0x00, 0x05,
0x00, 0x00, 0x00, 0x00, 0x07, 0xa8, 0x5c, 0x01, 0x00, 0x5c, 0x02, 0x01,
0x5c, 0x03, 0x02, 0x5c, 0x04, 0x03, 0x5c, 0x05, 0x04, 0x5c, 0x06, 0x05,
0x5c, 0x07, 0x06, 0x5c, 0x08, 0x07, 0x52, 0x02, 0x07, 0x5c, 0x03, 0x08,
0x52, 0x04, 0x00, 0x5c, 0x05, 0x09, 0x5c, 0x06, 0x0a, 0x52, 0x06, 0x01,
0x5c, 0x07, 0x0b, 0x5c, 0x08, 0x0c, 0x52, 0x08, 0x01, 0x5c, 0x09, 0x0d,
0x5c, 0x0a, 0x0e, 0x52, 0x0a, 0x01, 0x5c, 0x0b, 0x0f, 0x5c, 0x0c, 0x0e,
0x52, 0x0c, 0x01, 0x5c, 0x0d, 0x10, 0x5c, 0x0e, 0x0c, 0x52, 0x0e, 0x01,
0x5c, 0x0f, 0x11, 0x5c, 0x10, 0x12, 0x52, 0x10, 0x01, 0x5c, 0x11, 0x13,
0x5c, 0x12, 0x14, 0x52, 0x12, 0x01, 0x5c, 0x13, 0x15, 0x5c, 0x14, 0x0e,
0x52, 0x14, 0x01, 0x5c, 0x15, 0x16, 0x5c, 0x16, 0x0e, 0x52, 0x16, 0x01,
0x5c, 0x17, 0x17, 0x52, 0x18, 0x00, 0x5c, 0x19, 0x18, 0x5c, 0x1a, 0x0e,
0x52, 0x1a, 0x01, 0x5c, 0x1b, 0x19, 0x52, 0x1c, 0x00, 0x5c, 0x1d, 0x1a,
0x5c, 0x1e, 0x0e, 0x52, 0x1e, 0x01, 0x5c, 0x1f, 0x1b, 0x5c, 0x20, 0x1c,
0x52, 0x20, 0x01, 0x5c, 0x21, 0x1d, 0x52, 0x22, 0x00, 0x5c, 0x23, 0x1e,
0x5c, 0x24, 0x14, 0x5c, 0x25, 0x0a, 0x52, 0x24, 0x02, 0x5c, 0x25, 0x1f,
0x5c, 0x26, 0x0e, 0x52, 0x26, 0x01, 0x5c, 0x27, 0x20, 0x5c, 0x28, 0x12,
0x52, 0x28, 0x01, 0x5c, 0x29, 0x21, 0x52, 0x2a, 0x00, 0x5c, 0x2b, 0x22,
0x5c, 0x2c, 0x23, 0x5c, 0x2d, 0x24, 0x5c, 0x2e, 0x0a, 0x52, 0x2c, 0x03,
0x5e, 0x01, 0x16, 0x1a, 0x01, 0x00, 0x10, 0x01, 0x01, 0x10, 0x02, 0x02,
0x0f, 0x03, 0x00, 0x55, 0x55, 0x55, 0x10, 0x04, 0x03, 0x5c, 0x05, 0x25,
0x10, 0x06, 0x04, 0x5c, 0x07, 0x26, 0x52, 0x07, 0x01, 0x10, 0x08, 0x05,
0x5c, 0x09, 0x00, 0x5e, 0x02, 0x04, 0x10, 0x03, 0x06, 0x10, 0x04, 0x02,
0x0e, 0x05, 0x59, 0x9c, 0x10, 0x06, 0x03, 0x5c, 0x07, 0x27, 0x10, 0x08,
0x04, 0x5c, 0x09, 0x28, 0x5c, 0x0a, 0x29, 0x5c, 0x0b, 0x2a, 0x52, 0x09,
0x03, 0x10, 0x0a, 0x05, 0x5c, 0x0b, 0x00, 0x5e, 0x04, 0x04, 0x10, 0x05,
0x07, 0x10, 0x06, 0x02, 0x0f, 0x07, 0x00, 0xa8, 0xb9, 0xcc, 0x10, 0x08,
0x03, 0x5c, 0x09, 0x2b, 0x10, 0x0a, 0x04, 0x5c, 0x0b, 0x2c, 0x5c, 0x0c,
0x2d, 0x52, 0x0b, 0x02, 0x10, 0x0c, 0x05, 0x5c, 0x0d, 0x00, 0x5e, 0x06,
0x04, 0x10, 0x07, 0x08, 0x10, 0x08, 0x02, 0x0f, 0x09, 0x00, 0x36, 0xa3,
0xd9, 0x10, 0x0a, 0x03, 0x5c, 0x0b, 0x2e, 0x10, 0x0c, 0x04, 0x5c, 0x0d,
0x2f, 0x52, 0x0d, 0x01, 0x10, 0x0e, 0x05, 0x5c, 0x0f, 0x0d, 0x5e, 0x08,
0x04, 0x10, 0x09, 0x09, 0x10, 0x0a, 0x02, 0x0f, 0x0b, 0x00, 0x4d, 0x5a,
0x5e, 0x10, 0x0c, 0x03, 0x5c, 0x0d, 0x30, 0x10, 0x0e, 0x04, 0x5c, 0x0f,
0x31, 0x52, 0x0f, 0x01, 0x10, 0x10, 0x05, 0x5c, 0x11, 0x10, 0x5e, 0x0a,
0x04, 0x10, 0x0b, 0x0a, 0x10, 0x0c, 0x02, 0x0f, 0x0d, 0x00, 0x00, 0xad,
0xd8, 0x10, 0x0e, 0x03, 0x5c, 0x0f, 0x32, 0x10, 0x10, 0x04, 0x5c, 0x11,
0x33, 0x52, 0x11, 0x01, 0x10, 0x12, 0x05, 0x5c, 0x13, 0x11, 0x5e, 0x0c,
0x04, 0x10, 0x0d, 0x0b, 0x10, 0x0e, 0x02, 0x0f, 0x0f, 0x00, 0x00, 0xad,
0xd8, 0x10, 0x10, 0x03, 0x5c, 0x11, 0x32, 0x10, 0x12, 0x04, 0x5c, 0x13,
0x34, 0x52, 0x13, 0x01, 0x10, 0x14, 0x05, 0x5c, 0x15, 0x11, 0x5e, 0x0e,
0x04, 0x10, 0x0f, 0x0c, 0x10, 0x10, 0x02, 0x0f, 0x11, 0x00, 0xa0, 0x74,
0xc4, 0x10, 0x12, 0x03, 0x5c, 0x13, 0x35, 0x10, 0x14, 0x04, 0x5c, 0x15,
0x36, 0x5c, 0x16, 0x37, 0x52, 0x15, 0x02, 0x10, 0x16, 0x05, 0x5c, 0x17,
0x13, 0x5e, 0x10, 0x04, 0x10, 0x11, 0x0d, 0x10, 0x12, 0x02, 0x0f, 0x13,
0x00, 0xef, 0x8a, 0x91, 0x10, 0x14, 0x03, 0x5c, 0x15, 0x38, 0x10, 0x16,
0x04, 0x5c, 0x17, 0x39, 0x5c, 0x18, 0x3a, 0x52, 0x17, 0x02, 0x10, 0x18,
0x05, 0x5c, 0x19, 0x15, 0x5e, 0x12, 0x04, 0x10, 0x13, 0x0e, 0x10, 0x14,
0x02, 0x0f, 0x15, 0x00, 0xf0, 0xdf, 0x8a, 0x10, 0x16, 0x03, 0x5c, 0x17,
0x3b, 0x10, 0x18, 0x04, 0x5c, 0x19, 0x3c, 0x52, 0x19, 0x01, 0x10, 0x1a,
0x05, 0x5c, 0x1b, 0x16, 0x5e, 0x14, 0x04, 0x10, 0x15, 0x0f, 0x10, 0x16,
0x02, 0x0f, 0x17, 0x00, 0x36, 0xa3, 0xd9, 0x10, 0x18, 0x03, 0x5c, 0x19,
0x3d, 0x10, 0x1a, 0x04, 0x5c, 0x1b, 0x3e, 0x52, 0x1b, 0x01, 0x10, 0x1c,
0x05, 0x5c, 0x1d, 0x16, 0x5e, 0x16, 0x04, 0x10, 0x17, 0x10, 0x10, 0x18,
0x02, 0x0f, 0x19, 0x00, 0xcb, 0xcb, 0x41, 0x10, 0x1a, 0x03, 0x5c, 0x1b,
0x3f, 0x10, 0x1c, 0x04, 0x5c, 0x1d, 0x40, 0x52, 0x1d, 0x01, 0x10, 0x1e,
0x05, 0x5c, 0x1f, 0x0f, 0x5e, 0x18, 0x04, 0x10, 0x19, 0x11, 0x10, 0x1a,
0x02, 0x0f, 0x1b, 0x00, 0xcb, 0xcb, 0x41, 0x10, 0x1c, 0x03, 0x5c, 0x1d,
0x3f, 0x10, 0x1e, 0x04, 0x5c, 0x1f, 0x41, 0x52, 0x1f, 0x01, 0x10, 0x20,
0x05, 0x5c, 0x21, 0x0f, 0x5e, 0x1a, 0x04, 0x10, 0x1b, 0x12, 0x10, 0x1c,
0x02, 0x0f, 0x1d, 0x00, 0x6e, 0x15, 0x16, 0x10, 0x1e, 0x03, 0x5c, 0x1f,
0x38, 0x10, 0x20, 0x04, 0x5c, 0x21, 0x42, 0x52, 0x21, 0x01, 0x10, 0x22,
0x05, 0x5c, 0x23, 0x08, 0x5e, 0x1c, 0x04, 0x10, 0x1d, 0x13, 0x10, 0x1e,
0x02, 0x0f, 0x1f, 0x00, 0x36, 0xa3, 0xd9, 0x10, 0x20, 0x03, 0x5c, 0x21,
0x43, 0x10, 0x22, 0x04, 0x5c, 0x23, 0x44, 0x52, 0x23, 0x01, 0x10, 0x24,
0x05, 0x5c, 0x25, 0x17, 0x5e, 0x1e, 0x04, 0x10, 0x1f, 0x14, 0x10, 0x20,
0x02, 0x0f, 0x21, 0x00, 0x95, 0xe6, 0xcb, 0x10, 0x22, 0x03, 0x5c, 0x23,
0x45, 0x10, 0x24, 0x04, 0x5c, 0x25, 0x46, 0x52, 0x25, 0x01, 0x10, 0x26,
0x05, 0x5c, 0x27, 0x47, 0x5e, 0x20, 0x04, 0x10, 0x21, 0x15, 0x10, 0x22,
0x02, 0x0f, 0x23, 0x00, 0xde, 0xa5, 0x84, 0x10, 0x24, 0x03, 0x5c, 0x25,
0x48, 0x10, 0x26, 0x04, 0x5c, 0x27, 0x49, 0x52, 0x27, 0x01, 0x10, 0x28,
0x05, 0x5c, 0x29, 0x19, 0x5e, 0x22, 0x04, 0x10, 0x23, 0x16, 0x10, 0x24,
0x02, 0x0f, 0x25, 0x00, 0xa0, 0x74, 0xc4, 0x10, 0x26, 0x03, 0x5c, 0x27,
0x4a, 0x10, 0x28, 0x04, 0x5c, 0x29, 0x4b, 0x52, 0x29, 0x01, 0x10, 0x2a,
0x05, 0x5c, 0x2b, 0x1a, 0x5e, 0x24, 0x04, 0x10, 0x25, 0x17, 0x10, 0x26,
0x02, 0x0f, 0x27, 0x00, 0x36, 0xa3, 0xd9, 0x10, 0x28, 0x03, 0x5c, 0x29,
0x4c, 0x10, 0x2a, 0x04, 0x5c, 0x2b, 0x4d, 0x5c, 0x2c, 0x4e, 0x52, 0x2b,
0x02, 0x10, 0x2c, 0x05, 0x5c, 0x2d, 0x1b, 0x5e, 0x26, 0x04, 0x10, 0x27,
0x18, 0x10, 0x28, 0x02, 0x0f, 0x29, 0x00, 0x6d, 0x80, 0x86, 0x10, 0x2a,
0x03, 0x5c, 0x2b, 0x4f, 0x10, 0x2c, 0x04, 0x5c, 0x2d, 0x50, 0x52, 0x2d,
0x01, 0x10, 0x2e, 0x05, 0x5c, 0x2f, 0x1d, 0x5e, 0x28, 0x04, 0x10, 0x29,
0x19, 0x10, 0x2a, 0x02, 0x0f, 0x2b, 0x00, 0x36, 0xa3, 0xd9, 0x10, 0x2c,
0x03, 0x5c, 0x2d, 0x51, 0x10, 0x2e, 0x04, 0x5c, 0x2f, 0x52, 0x52, 0x2f,
0x01, 0x10, 0x30, 0x05, 0x5c, 0x31, 0x1e, 0x5e, 0x2a, 0x04, 0x10, 0x2b,
0x1a, 0x10, 0x2c, 0x02, 0x0f, 0x2d, 0x00, 0x6d, 0x80, 0x86, 0x10, 0x2e,
0x03, 0x5c, 0x2f, 0x4f, 0x10, 0x30, 0x04, 0x5c, 0x31, 0x53, 0x5c, 0x32,
0x54, 0x52, 0x31, 0x02, 0x10, 0x32, 0x05, 0x5c, 0x33, 0x1f, 0x5e, 0x2c,
0x04, 0x10, 0x2d, 0x1b, 0x10, 0x2e, 0x02, 0x0f, 0x2f, 0x00, 0xda, 0xd8,
0xd8, 0x10, 0x30, 0x03, 0x5c, 0x31, 0x55, 0x10, 0x32, 0x04, 0x5c, 0x33,
0x56, 0x52, 0x33, 0x01, 0x10, 0x34, 0x05, 0x5c, 0x35, 0x20, 0x5e, 0x2e,
0x04, 0x10, 0x2f, 0x1c, 0x10, 0x30, 0x02, 0x0f, 0x31, 0x00, 0x4e, 0x5c,
0x61, 0x10, 0x32, 0x03, 0x5c, 0x33, 0x57, 0x10, 0x34, 0x04, 0x5c, 0x35,
0x58, 0x5c, 0x36, 0x59, 0x52, 0x35, 0x02, 0x10, 0x36, 0x05, 0x5c, 0x37,
0x21, 0x5e, 0x30, 0x04, 0x10, 0x31, 0x1d, 0x10, 0x32, 0x02, 0x0f, 0x33,
0x00, 0x6d, 0x80, 0x86, 0x10, 0x34, 0x03, 0x5c, 0x35, 0x5a, 0x10, 0x36,
0x04, 0x5c, 0x37, 0x5b, 0x52, 0x37, 0x01, 0x5e, 0x32, 0x03, 0x10, 0x33,
0x1e, 0x10, 0x34, 0x02, 0x0f, 0x35, 0x00, 0xda, 0xd8, 0xd8, 0x10, 0x36,
0x03, 0x5c, 0x37, 0x5c, 0x10, 0x38, 0x04, 0x5c, 0x39, 0x5d, 0x52, 0x39,
0x01, 0x5e, 0x34, 0x03, 0x10, 0x35, 0x1f, 0x10, 0x36, 0x02, 0x0f, 0x37,
0x00, 0xdd, 0x4c, 0x35, 0x10, 0x38, 0x03, 0x5c, 0x39, 0x5e, 0x10, 0x3a,
0x04, 0x5c, 0x3b, 0x5f, 0x5c, 0x3c, 0x60, 0x52, 0x3b, 0x02, 0x5e, 0x36,
0x03, 0x10, 0x37, 0x20, 0x10, 0x38, 0x02, 0x0f, 0x39, 0x00, 0xf0, 0x50,
0x32, 0x10, 0x3a, 0x03, 0x5c, 0x3b, 0x61, 0x10, 0x3c, 0x04, 0x5c, 0x3d,
0x62, 0x52, 0x3d, 0x01, 0x5e, 0x38, 0x03, 0x10, 0x39, 0x21, 0x10, 0x3a,
0x02, 0x0f, 0x3b, 0x00, 0xf0, 0x50, 0x32, 0x10, 0x3c, 0x03, 0x5c, 0x3d,
0x61, 0x10, 0x3e, 0x04, 0x5c, 0x3f, 0x63, 0x52, 0x3f, 0x01, 0x5e, 0x3a,
0x03, 0x10, 0x3b, 0x22, 0x10, 0x3c, 0x02, 0x0f, 0x3d, 0x00, 0x9e, 0x9e,
0x9e, 0x10, 0x3e, 0x03, 0x5c, 0x3f, 0x64, 0x10, 0x40, 0x04, 0x5c, 0x41,
0x65, 0x52, 0x41, 0x01, 0x5e, 0x3c, 0x03, 0x10, 0x3d, 0x23, 0x10, 0x3e,
0x02, 0x0f, 0x3f, 0x00, 0x6d, 0x80, 0x86, 0x10, 0x40, 0x03, 0x5c, 0x41,
0x4f, 0x10, 0x42, 0x04, 0x5c, 0x43, 0x66, 0x52, 0x43, 0x01, 0x5e, 0x3e,
0x03, 0x10, 0x3f, 0x24, 0x10, 0x40, 0x02, 0x0f, 0x41, 0x00, 0xff, 0x80,
0x87, 0x10, 0x42, 0x03, 0x5c, 0x43, 0x67, 0x10, 0x44, 0x04, 0x5c, 0x45,
0x68, 0x52, 0x45, 0x01, 0x10, 0x46, 0x25, 0x5c, 0x47, 0x69, 0x52, 0x47,
0x01, 0x10, 0x48, 0x05, 0x5c, 0x49, 0x09, 0x5e, 0x40, 0x05, 0x10, 0x41,
0x26, 0x10, 0x42, 0x02, 0x0f, 0x43, 0x00, 0x4d, 0x5a, 0x5e, 0x10, 0x44,
0x03, 0x5c, 0x45, 0x6a, 0x10, 0x46, 0x04, 0x5c, 0x47, 0x6b, 0x52, 0x47,
0x01, 0x10, 0x48, 0x25, 0x5c, 0x49, 0x6c, 0x5c, 0x4a, 0x6d, 0x52, 0x49,
0x02, 0x10, 0x4a, 0x05, 0x5c, 0x4b, 0x0b, 0x5e, 0x42, 0x05, 0x10, 0x43,
0x27, 0x10, 0x44, 0x02, 0x0f, 0x45, 0x00, 0x6d, 0x80, 0x86, 0x10, 0x46,
0x03, 0x5c, 0x47, 0x6e, 0x10, 0x48, 0x04, 0x52, 0x49, 0x00, 0x5e, 0x44,
0x03, 0x5e, 0x01, 0x22, 0x1a, 0x01, 0x28, 0x10, 0x01, 0x27, 0x10, 0x02,
0x29, 0x0f, 0x03, 0x00, 0xee, 0xee, 0xee, 0x5e, 0x02, 0x01, 0x10, 0x03,
0x2a, 0x10, 0x04, 0x29, 0x0f, 0x05, 0x00, 0x7d, 0xcf, 0xff, 0x5e, 0x04,
0x01, 0x10, 0x05, 0x2b, 0x10, 0x06, 0x29, 0x0f, 0x07, 0x00, 0xef, 0x51,
0x68, 0x5e, 0x06, 0x01, 0x10, 0x07, 0x2c, 0x10, 0x08, 0x29, 0x0f, 0x09,
0x00, 0xaa, 0xaa, 0xaa, 0x10, 0x0a, 0x2d, 0x13, 0x0b, 0x5e, 0x08, 0x02,
0x10, 0x09, 0x2e, 0x10, 0x0a, 0x29, 0x0f, 0x0b, 0x00, 0xaa, 0xd9, 0x4c,
0x5e, 0x0a, 0x01, 0x10, 0x0b, 0x2f, 0x10, 0x0c, 0x29, 0x0f, 0x0d, 0x00,
0x7d, 0xcf, 0xff, 0x5e, 0x0c, 0x01, 0x10, 0x0d, 0x30, 0x10, 0x0e, 0x29,
0x0f, 0x0f, 0x00, 0x7d, 0xcf, 0xff, 0x5e, 0x0e, 0x01, 0x10, 0x0f, 0x31,
0x10, 0x10, 0x29, 0x0f, 0x11, 0x00, 0xd2, 0xa6, 0xff, 0x5e, 0x10, 0x01,
0x10, 0x11, 0x32, 0x10, 0x12, 0x29, 0x0f, 0x13, 0x00, 0xe6, 0xc0, 0x8a,
0x5e, 0x12, 0x01, 0x10, 0x13, 0x33, 0x10, 0x14, 0x29, 0x0f, 0x15, 0x00,
0x7a, 0xe9, 0x3c, 0x5e, 0x14, 0x01, 0x10, 0x15, 0x34, 0x10, 0x16, 0x29,
0x0f, 0x17, 0x00, 0xef, 0x51, 0x68, 0x5e, 0x16, 0x01, 0x10, 0x17, 0x35,
0x10, 0x18, 0x29, 0x0f, 0x19, 0x00, 0xff, 0xaf, 0x70, 0x5e, 0x18, 0x01,
0x10, 0x19, 0x36, 0x10, 0x1a, 0x29, 0x0f, 0x1b, 0x00, 0xff, 0x8f, 0x40,
0x5e, 0x1a, 0x01, 0x10, 0x1b, 0x37, 0x10, 0x1c, 0x29, 0x0f, 0x1d, 0x00,
0xf0, 0x71, 0x78, 0x5e, 0x1c, 0x01, 0x10, 0x1d, 0x38, 0x10, 0x1e, 0x29,
0x0f, 0x1f, 0x00, 0xff, 0xff, 0xff, 0x10, 0x20, 0x2d, 0x13, 0x21, 0x5e,
0x1e, 0x02, 0x10, 0x1f, 0x39, 0x10, 0x20, 0x29, 0x0f, 0x21, 0x00, 0xff,
0xaf, 0x70, 0x5e, 0x20, 0x01, 0x10, 0x21, 0x3a, 0x10, 0x22, 0x29, 0x0f,
0x23, 0x00, 0xf0, 0x71, 0x78, 0x5e, 0x22, 0x01, 0x10, 0x23, 0x3b, 0x10,
0x24, 0x29, 0x0f, 0x25, 0x00, 0x7d, 0xcf, 0xff, 0x5e, 0x24, 0x01, 0x10,
0x25, 0x3c, 0x10, 0x26, 0x29, 0x0f, 0x27, 0x00, 0x95, 0xe6, 0xcb, 0x5e,
0x26, 0x01, 0x10, 0x27, 0x3d, 0x10, 0x28, 0x29, 0x0f, 0x29, 0x00, 0xf0,
0x71, 0x78, 0x5e, 0x28, 0x01, 0x10, 0x29, 0x3e, 0x10, 0x2a, 0x29, 0x0f,
0x2b, 0x00, 0x7d, 0xcf, 0xff, 0x5e, 0x2a, 0x01, 0x10, 0x2b, 0x3f, 0x10,
0x2c, 0x29, 0x0f, 0x2d, 0x00, 0xff, 0x8f, 0x40, 0x5e, 0x2c, 0x01, 0x10,
0x2d, 0x40, 0x10, 0x2e, 0x29, 0x0f, 0x2f, 0x00, 0xd2, 0xa6, 0xff, 0x5e,
0x2e, 0x01, 0x10, 0x2f, 0x41, 0x10, 0x30, 0x29, 0x0f, 0x31, 0x00, 0xd2,
0xa6, 0xff, 0x5e, 0x30, 0x01, 0x10, 0x31, 0x42, 0x10, 0x32, 0x29, 0x0f,
0x33, 0x00, 0xff, 0xaf, 0xaf, 0x5e, 0x32, 0x01, 0x10, 0x33, 0x43, 0x10,
0x34, 0x29, 0x0f, 0x35, 0x00, 0xff, 0xff, 0x00, 0x5e, 0x34, 0x01, 0x10,
0x35, 0x44, 0x10, 0x36, 0x29, 0x0f, 0x37, 0x00, 0x0f, 0xff, 0x0f, 0x5e,
0x36, 0x01, 0x10, 0x37, 0x45, 0x10, 0x38, 0x29, 0x0f, 0x39, 0x00, 0xff,
0x0f, 0x0f, 0x5e, 0x38, 0x01, 0x5e, 0x01, 0x1c, 0x1a, 0x01, 0x46, 0x10,
0x01, 0x47, 0x1a, 0x01, 0x48, 0x5e, 0x01, 0x00, 0x1a, 0x01, 0x49, 0x5e,
0x01, 0x00, 0x1a, 0x01, 0x4a, 0x5e, 0x01, 0x00, 0x1a, 0x01, 0x4b, 0x11,
0x01, 0x1a, 0x01, 0x4c, 0x11, 0x01, 0x1a, 0x01, 0x4d, 0x62, 0x02, 0x00,
0x31, 0x01, 0x4e, 0x00, 0x1a, 0x01, 0x4f, 0x62, 0x02, 0x01, 0x31, 0x01,
0x4e, 0x00, 0x1a, 0x01, 0x50, 0x62, 0x02, 0x02, 0x31, 0x01, 0x4e, 0x00,
0x1a, 0x01, 0x51, 0x62, 0x02, 0x03, 0x31, 0x01, 0x4e, 0x00, 0x1a, 0x01,
0x52, 0x12, 0x01, 0x6f, 0x01, 0x69, 0x01, 0x04, 0x3d, 0x00, 0x00, 0x6f,
0x00, 0x00, 0x06, 0x63, 0x6c, 0x61, 0x6e, 0x67, 0x64, 0x00, 0x00, 0x00,
0x12, 0x2d, 0x2d, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e,
0x64, 0x2d, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x00, 0x00, 0x00, 0x0c, 0x2d,
0x2d, 0x63, 0x6c, 0x61, 0x6e, 0x67, 0x2d, 0x74, 0x69, 0x64, 0x79, 0x00,
0x00, 0x00, 0x1b, 0x2d, 0x2d, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74,
0x69, 0x6f, 0x6e, 0x2d, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x3d, 0x64, 0x65,
0x74, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x00, 0x00, 0x00, 0x18, 0x2d, 0x2d,
0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2d, 0x69, 0x6e, 0x73, 0x65, 0x72,
0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x6e, 0x65, 0x76, 0x65, 0x72, 0x00, 0x00,
0x00, 0x14, 0x2d, 0x2d, 0x70, 0x63, 0x68, 0x2d, 0x73, 0x74, 0x6f, 0x72,
0x61, 0x67, 0x65, 0x3d, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x00, 0x00,
0x00, 0x12, 0x2d, 0x2d, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2d, 0x72, 0x65,
0x73, 0x75, 0x6c, 0x74, 0x73, 0x3d, 0x35, 0x30, 0x00, 0x00, 0x00, 0x0b,
0x2d, 0x2d, 0x6c, 0x6f, 0x67, 0x3d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x00,
0x00, 0x00, 0x08, 0x72, 0x75, 0x62, 0x79, 0x2d, 0x6c, 0x73, 0x70, 0x00,
0x00, 0x00, 0x0a, 0x73, 0x6f, 0x6c, 0x61, 0x72, 0x67, 0x72, 0x61, 0x70,
0x68, 0x00, 0x00, 0x00, 0x05, 0x73, 0x74, 0x64, 0x69, 0x6f, 0x00, 0x00,
0x00, 0x14, 0x62, 0x61, 0x73, 0x68, 0x2d, 0x6c, 0x61, 0x6e, 0x67, 0x75,
0x61, 0x67, 0x65, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x00, 0x00,
0x00, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x00, 0x00, 0x00, 0x1a, 0x76,
0x73, 0x63, 0x6f, 0x64, 0x65, 0x2d, 0x63, 0x73, 0x73, 0x2d, 0x6c, 0x61,
0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65,
0x72, 0x00, 0x00, 0x00, 0x07, 0x2d, 0x2d, 0x73, 0x74, 0x64, 0x69, 0x6f,
0x00, 0x00, 0x00, 0x1b, 0x76, 0x73, 0x63, 0x6f, 0x64, 0x65, 0x2d, 0x6a,
0x73, 0x6f, 0x6e, 0x2d, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65,
0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x00, 0x00, 0x00, 0x08, 0x66,
0x69, 0x73, 0x68, 0x2d, 0x6c, 0x73, 0x70, 0x00, 0x00, 0x00, 0x05, 0x67,
0x6f, 0x70, 0x6c, 0x73, 0x00, 0x00, 0x00, 0x05, 0x73, 0x65, 0x72, 0x76,
0x65, 0x00, 0x00, 0x00, 0x17, 0x68, 0x61, 0x73, 0x6b, 0x65, 0x6c, 0x6c,
0x2d, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2d, 0x73, 0x65,
0x72, 0x76, 0x65, 0x72, 0x00, 0x00, 0x00, 0x03, 0x6c, 0x73, 0x70, 0x00,
0x00, 0x00, 0x15, 0x65, 0x6d, 0x6d, 0x65, 0x74, 0x2d, 0x6c, 0x61, 0x6e,
0x67, 0x75, 0x61, 0x67, 0x65, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72,
0x00, 0x00, 0x00, 0x1a, 0x74, 0x79, 0x70, 0x65, 0x73, 0x63, 0x72, 0x69,
0x70, 0x74, 0x2d, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2d,
0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x00, 0x00, 0x00, 0x13, 0x6c, 0x75,
0x61, 0x2d, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2d, 0x73,
0x65, 0x72, 0x76, 0x65, 0x72, 0x00, 0x00, 0x00, 0x12, 0x70, 0x79, 0x72,
0x69, 0x67, 0x68, 0x74, 0x2d, 0x6c, 0x61, 0x6e, 0x67, 0x73, 0x65, 0x72,
0x76, 0x65, 0x72, 0x00, 0x00, 0x00, 0x0d, 0x72, 0x75, 0x73, 0x74, 0x2d,
0x61, 0x6e, 0x61, 0x6c, 0x79, 0x7a, 0x65, 0x72, 0x00, 0x00, 0x00, 0x0c,
0x69, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x68, 0x65, 0x6e, 0x73, 0x65,
0x00, 0x00, 0x00, 0x08, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x6d, 0x61, 0x6e,
0x00, 0x00, 0x00, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x00, 0x00,
0x00, 0x15, 0x6e, 0x67, 0x69, 0x6e, 0x78, 0x2d, 0x6c, 0x61, 0x6e, 0x67,
0x75, 0x61, 0x67, 0x65, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x00,
0x00, 0x00, 0x05, 0x74, 0x61, 0x70, 0x6c, 0x6f, 0x00, 0x00, 0x00, 0x14,
0x79, 0x61, 0x6d, 0x6c, 0x2d, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67,
0x65, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x00, 0x00, 0x00, 0x04,
0x73, 0x71, 0x6c, 0x73, 0x00, 0x00, 0x00, 0x14, 0x6d, 0x61, 0x6b, 0x65,
0x2d, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2d, 0x73, 0x65,
0x72, 0x76, 0x65, 0x72, 0x00, 0x00, 0x00, 0x13, 0x73, 0x71, 0x6c, 0x2d,
0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2d, 0x73, 0x65, 0x72,
0x76, 0x65, 0x72, 0x00, 0x00, 0x00, 0x02, 0x75, 0x70, 0x00, 0x00, 0x00,
0x08, 0x2d, 0x2d, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x00, 0x00, 0x00,
0x04, 0xee, 0x98, 0x9e, 0x20, 0x00, 0x00, 0x00, 0x01, 0x63, 0x00, 0x00,
0x00, 0x04, 0xee, 0x98, 0x9d, 0x20, 0x00, 0x00, 0x00, 0x03, 0x63, 0x70,
0x70, 0x00, 0x00, 0x00, 0x02, 0x63, 0x63, 0x00, 0x00, 0x00, 0x03, 0x63,
0x78, 0x78, 0x00, 0x00, 0x00, 0x04, 0xef, 0x83, 0xbd, 0x20, 0x00, 0x00,
0x00, 0x01, 0x68, 0x00, 0x00, 0x00, 0x03, 0x68, 0x70, 0x70, 0x00, 0x00,
0x00, 0x04, 0xee, 0x9a, 0xb8, 0x20, 0x00, 0x00, 0x00, 0x03, 0x63, 0x73,
0x73, 0x00, 0x00, 0x00, 0x04, 0xee, 0xb9, 0x81, 0x20, 0x00, 0x00, 0x00,
0x04, 0x66, 0x69, 0x73, 0x68, 0x00, 0x00, 0x00, 0x04, 0xee, 0x98, 0xa7,
0x20, 0x00, 0x00, 0x00, 0x02, 0x67, 0x6f, 0x00, 0x00, 0x00, 0x03, 0x6d,
0x6f, 0x64, 0x00, 0x00, 0x00, 0x04, 0xee, 0x9d, 0xb7, 0x20, 0x00, 0x00,
0x00, 0x02, 0x68, 0x73, 0x00, 0x00, 0x00, 0x03, 0x6c, 0x68, 0x73, 0x00,
0x00, 0x00, 0x04, 0xef, 0x84, 0xa1, 0x20, 0x00, 0x00, 0x00, 0x04, 0x68,
0x74, 0x6d, 0x6c, 0x00, 0x00, 0x00, 0x03, 0x68, 0x74, 0x6d, 0x00, 0x00,
0x00, 0x04, 0xef, 0x8b, 0xaf, 0x20, 0x00, 0x00, 0x00, 0x02, 0x6a, 0x73,
0x00, 0x00, 0x00, 0x04, 0xee, 0x9a, 0x9d, 0x20, 0x00, 0x00, 0x00, 0x02,
0x74, 0x73, 0x00, 0x00, 0x00, 0x02, 0x7b, 0x7d, 0x00, 0x00, 0x00, 0x04,
0x6a, 0x73, 0x6f, 0x6e, 0x00, 0x00, 0x00, 0x05, 0x6a, 0x73, 0x6f, 0x6e,
0x63, 0x00, 0x00, 0x00, 0x03, 0x65, 0x72, 0x62, 0x00, 0x00, 0x00, 0x05,
0xf3, 0xb0, 0xa2, 0xb1, 0x20, 0x00, 0x00, 0x00, 0x03, 0x6c, 0x75, 0x61,
0x00, 0x00, 0x00, 0x05, 0xf3, 0xb0, 0x8c, 0xa0, 0x20, 0x00, 0x00, 0x00,
0x02, 0x70, 0x79, 0x00, 0x00, 0x00, 0x07, 0x70, 0x79, 0x72, 0x69, 0x67,
0x68, 0x74, 0x00, 0x00, 0x00, 0x05, 0xf3, 0xb1, 0x98, 0x97, 0x20, 0x00,
0x00, 0x00, 0x02, 0x72, 0x73, 0x00, 0x00, 0x00, 0x05, 0xf3, 0xb0, 0x8c,
0x9f, 0x20, 0x00, 0x00, 0x00, 0x03, 0x70, 0x68, 0x70, 0x00, 0x00, 0x00,
0x04, 0xee, 0xba, 0xab, 0x20, 0x00, 0x00, 0x00, 0x02, 0x6d, 0x64, 0x00,
0x00, 0x00, 0x08, 0x6d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x00,
0x00, 0x00, 0x04, 0xee, 0x98, 0x95, 0x20, 0x00, 0x00, 0x00, 0x04, 0x63,
0x6f, 0x6e, 0x66, 0x00, 0x00, 0x00, 0x04, 0xee, 0x9a, 0xb2, 0x20, 0x00,
0x00, 0x00, 0x04, 0x74, 0x6f, 0x6d, 0x6c, 0x00, 0x00, 0x00, 0x03, 0x79,
0x6d, 0x6c, 0x00, 0x00, 0x00, 0x04, 0x79, 0x61, 0x6d, 0x6c, 0x00, 0x00,
0x00, 0x04, 0xee, 0x99, 0x8d, 0x20, 0x00, 0x00, 0x00, 0x03, 0x73, 0x71,
0x6c, 0x00, 0x00, 0x00, 0x04, 0xee, 0x99, 0xb3, 0x20, 0x00, 0x00, 0x00,
0x08, 0x4d, 0x61, 0x6b, 0x65, 0x66, 0x69, 0x6c, 0x65, 0x00, 0x00, 0x00,
0x08, 0x6d, 0x61, 0x6b, 0x65, 0x66, 0x69, 0x6c, 0x65, 0x00, 0x00, 0x00,
0x04, 0xee, 0x99, 0x9f, 0x20, 0x00, 0x00, 0x00, 0x02, 0x67, 0x64, 0x00,
0x00, 0x00, 0x04, 0xef, 0x80, 0xad, 0x20, 0x00, 0x00, 0x00, 0x03, 0x6d,
0x61, 0x6e, 0x00, 0x00, 0x00, 0x04, 0xee, 0x9c, 0xa8, 0x20, 0x00, 0x00,
0x00, 0x04, 0x64, 0x69, 0x66, 0x66, 0x00, 0x00, 0x00, 0x05, 0x70, 0x61,
0x74, 0x63, 0x68, 0x00, 0x00, 0x00, 0x04, 0xee, 0x99, 0x9d, 0x20, 0x00,
0x00, 0x00, 0x0d, 0x67, 0x69, 0x74, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62,
0x75, 0x74, 0x65, 0x73, 0x00, 0x00, 0x00, 0x09, 0x67, 0x69, 0x74, 0x69,
0x67, 0x6e, 0x6f, 0x72, 0x65, 0x00, 0x00, 0x00, 0x02, 0x2e, 0x2a, 0x00,
0x00, 0x00, 0x05, 0x72, 0x65, 0x67, 0x65, 0x78, 0x00, 0x00, 0x00, 0x03,
0x69, 0x6e, 0x69, 0x00, 0x00, 0x00, 0x05, 0xf3, 0xb0, 0xb4, 0xad, 0x20,
0x00, 0x00, 0x00, 0x02, 0x72, 0x62, 0x00, 0x00, 0x00, 0x07, 0x47, 0x65,
0x6d, 0x66, 0x69, 0x6c, 0x65, 0x00, 0x00, 0x00, 0x04, 0xee, 0xaf, 0x8a,
0x20, 0x00, 0x00, 0x00, 0x02, 0x73, 0x68, 0x00, 0x00, 0x00, 0x0c, 0x62,
0x61, 0x73, 0x68, 0x5f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x00,
0x00, 0x00, 0x06, 0x62, 0x61, 0x73, 0x68, 0x72, 0x63, 0x00, 0x00, 0x00,
0x05, 0xf3, 0xb0, 0x88, 0x9a, 0x20, 0x00, 0x00, 0x53, 0x00, 0x0b, 0x40,
0x6c, 0x73, 0x70, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x00, 0x00,
0x01, 0x63, 0x00, 0x00, 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x00,
0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x00, 0x00, 0x0a, 0x65, 0x78,
0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x00, 0x00, 0x03, 0x6c,
0x73, 0x70, 0x00, 0x00, 0x03, 0x63, 0x70, 0x70, 0x00, 0x00, 0x01, 0x68,
0x00, 0x00, 0x03, 0x63, 0x73, 0x73, 0x00, 0x00, 0x04, 0x66, 0x69, 0x73,
0x68, 0x00, 0x00, 0x02, 0x67, 0x6f, 0x00, 0x00, 0x05, 0x67, 0x6f, 0x6d,
0x6f, 0x64, 0x00, 0x00, 0x07, 0x68, 0x61, 0x73, 0x6b, 0x65, 0x6c, 0x6c,
0x00, 0x00, 0x04, 0x68, 0x74, 0x6d, 0x6c, 0x00, 0x00, 0x0a, 0x6a, 0x61,
0x76, 0x61, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x00, 0x00, 0x0a, 0x74,
0x79, 0x70, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x00, 0x00, 0x04,
0x6a, 0x73, 0x6f, 0x6e, 0x00, 0x00, 0x05, 0x6a, 0x73, 0x6f, 0x6e, 0x63,
0x00, 0x00, 0x03, 0x65, 0x72, 0x62, 0x00, 0x00, 0x03, 0x6c, 0x75, 0x61,
0x00, 0x00, 0x06, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x00, 0x00, 0x04,
0x72, 0x75, 0x73, 0x74, 0x00, 0x00, 0x03, 0x70, 0x68, 0x70, 0x00, 0x00,
0x08, 0x6d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x00, 0x00, 0x05,
0x6e, 0x67, 0x69, 0x6e, 0x78, 0x00, 0x00, 0x04, 0x74, 0x6f, 0x6d, 0x6c,
0x00, 0x00, 0x04, 0x79, 0x61, 0x6d, 0x6c, 0x00, 0x00, 0x03, 0x73, 0x71,
0x6c, 0x00, 0x00, 0x04, 0x6d, 0x61, 0x6b, 0x65, 0x00, 0x00, 0x08, 0x67,
0x64, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x00, 0x00, 0x03, 0x6d, 0x61,
0x6e, 0x00, 0x00, 0x04, 0x64, 0x69, 0x66, 0x66, 0x00, 0x00, 0x0d, 0x67,
0x69, 0x74, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73,
0x00, 0x00, 0x09, 0x67, 0x69, 0x74, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65,
0x00, 0x00, 0x05, 0x72, 0x65, 0x67, 0x65, 0x78, 0x00, 0x00, 0x03, 0x69,
0x6e, 0x69, 0x00, 0x00, 0x04, 0x72, 0x75, 0x62, 0x79, 0x00, 0x00, 0x09,
0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x00, 0x00, 0x04,
0x62, 0x61, 0x73, 0x68, 0x00, 0x00, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75,
0x6c, 0x74, 0x00, 0x00, 0x0a, 0x40, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61,
0x67, 0x65, 0x73, 0x00, 0x00, 0x02, 0x66, 0x67, 0x00, 0x00, 0x07, 0x73,
0x68, 0x65, 0x62, 0x61, 0x6e, 0x67, 0x00, 0x00, 0x05, 0x65, 0x72, 0x72,
0x6f, 0x72, 0x00, 0x00, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74,
0x00, 0x00, 0x06, 0x69, 0x74, 0x61, 0x6c, 0x69, 0x63, 0x00, 0x00, 0x06,
0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x00, 0x00, 0x06, 0x65, 0x73, 0x63,
0x61, 0x70, 0x65, 0x00, 0x00, 0x0d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70,
0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x00, 0x06, 0x72, 0x65,
0x67, 0x65, 0x78, 0x70, 0x00, 0x00, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65,
0x72, 0x00, 0x00, 0x04, 0x74, 0x72, 0x75, 0x65, 0x00, 0x00, 0x05, 0x66,
0x61, 0x6c, 0x73, 0x65, 0x00, 0x00, 0x04, 0x63, 0x68, 0x61, 0x72, 0x00,
0x00, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x00, 0x00, 0x0f,
0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x6f, 0x70, 0x65, 0x72, 0x61,
0x74, 0x6f, 0x72, 0x00, 0x00, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74,
0x6f, 0x72, 0x00, 0x00, 0x08, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
0x6e, 0x00, 0x00, 0x04, 0x74, 0x79, 0x70, 0x65, 0x00, 0x00, 0x08, 0x63,
0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x00, 0x00, 0x10, 0x76, 0x61,
0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e,
0x63, 0x65, 0x00, 0x00, 0x0e, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c,
0x65, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x00, 0x00, 0x0a, 0x61, 0x6e,
0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x00, 0x09, 0x64,
0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x00, 0x00, 0x05, 0x6c,
0x61, 0x62, 0x65, 0x6c, 0x00, 0x00, 0x06, 0x62, 0x72, 0x61, 0x63, 0x65,
0x31, 0x00, 0x00, 0x06, 0x62, 0x72, 0x61, 0x63, 0x65, 0x32, 0x00, 0x00,
0x06, 0x62, 0x72, 0x61, 0x63, 0x65, 0x33, 0x00, 0x00, 0x06, 0x62, 0x72,
0x61, 0x63, 0x65, 0x34, 0x00, 0x00, 0x06, 0x62, 0x72, 0x61, 0x63, 0x65,
0x35, 0x00, 0x00, 0x06, 0x40, 0x74, 0x68, 0x65, 0x6d, 0x65, 0x00, 0x00,
0x09, 0x61, 0x75, 0x74, 0x6f, 0x5f, 0x75, 0x6e, 0x69, 0x78, 0x00, 0x00,
0x0d, 0x40, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x65, 0x6e, 0x64, 0x69, 0x6e,
0x67, 0x73, 0x00, 0x00, 0x0d, 0x40, 0x6b, 0x65, 0x79, 0x5f, 0x68, 0x61,
0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x00, 0x00, 0x0a, 0x40, 0x6b, 0x65,
0x79, 0x5f, 0x62, 0x69, 0x6e, 0x64, 0x73, 0x00, 0x00, 0x0d, 0x40, 0x68,
0x69, 0x67, 0x68, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x65, 0x72, 0x73, 0x00,
0x00, 0x0a, 0x40, 0x62, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x75, 0x70,
0x00, 0x00, 0x0b, 0x40, 0x62, 0x5f, 0x73, 0x68, 0x75, 0x74, 0x64, 0x6f,
0x77, 0x6e, 0x00, 0x00, 0x04, 0x70, 0x72, 0x6f, 0x63, 0x00, 0x00, 0x06,
0x40, 0x62, 0x5f, 0x62, 0x61, 0x72, 0x00, 0x00, 0x07, 0x40, 0x62, 0x5f,
0x63, 0x6f, 0x70, 0x79, 0x00, 0x00, 0x08, 0x40, 0x62, 0x5f, 0x70, 0x61,
0x73, 0x74, 0x65, 0x00, 0x00, 0x0e, 0x40, 0x62, 0x5f, 0x66, 0x69, 0x6c,
0x65, 0x5f, 0x64, 0x65, 0x74, 0x65, 0x63, 0x74, 0x00, 0x00, 0x00, 0x03,
0x55, 0x00, 0x09, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x1f, 0x39, 0x04, 0x00, 0x00, 0x0f, 0x03, 0x00, 0x82, 0xaa, 0xff, 0x5c,
0x04, 0x00, 0x01, 0x09, 0x01, 0x10, 0x0a, 0x00, 0x23, 0x09, 0x10, 0x0a,
0x01, 0x01, 0x0b, 0x09, 0x32, 0x0a, 0x02, 0x01, 0x28, 0x0a, 0x00, 0x0c,
0x0f, 0x03, 0x00, 0x82, 0xaa, 0xff, 0x5c, 0x04, 0x01, 0x26, 0x00, 0x68,
0x10, 0x0a, 0x03, 0x01, 0x0b, 0x09, 0x32, 0x0a, 0x02, 0x01, 0x28, 0x0a,
0x00, 0x0c, 0x0f, 0x03, 0x00, 0xff, 0x8f, 0x40, 0x5c, 0x04, 0x02, 0x26,
0x00, 0x4e, 0x10, 0x0a, 0x04, 0x01, 0x0b, 0x09, 0x32, 0x0a, 0x02, 0x01,
0x28, 0x0a, 0x00, 0x0c, 0x0f, 0x03, 0x00, 0x9a, 0xde, 0x7a, 0x5c, 0x04,
0x03, 0x26, 0x00, 0x34, 0x10, 0x0a, 0x05, 0x01, 0x0b, 0x09, 0x32, 0x0a,
0x02, 0x01, 0x28, 0x0a, 0x00, 0x0c, 0x0f, 0x03, 0x00, 0xff, 0xd7, 0x00,
0x5c, 0x04, 0x04, 0x26, 0x00, 0x1a, 0x10, 0x0a, 0x06, 0x01, 0x0b, 0x09,
0x32, 0x0a, 0x02, 0x01, 0x28, 0x0a, 0x00, 0x0c, 0x0f, 0x03, 0x00, 0xf2,
0x9c, 0xc3, 0x5c, 0x04, 0x05, 0x26, 0x00, 0x00, 0x1d, 0x09, 0x07, 0x33,
0x09, 0x08, 0x01, 0x0a, 0x01, 0x10, 0x0b, 0x09, 0x23, 0x0a, 0x23, 0x09,
0x01, 0x05, 0x09, 0x01, 0x09, 0x05, 0x29, 0x09, 0x00, 0x03, 0x26, 0x00,
0x0e, 0x1d, 0x09, 0x07, 0x33, 0x09, 0x08, 0x10, 0x0a, 0x0a, 0x23, 0x09,
0x01, 0x05, 0x09, 0x1d, 0x09, 0x0b, 0x01, 0x0a, 0x01, 0x10, 0x0b, 0x0c,
0x23, 0x0a, 0x32, 0x09, 0x0d, 0x01, 0x01, 0x06, 0x09, 0x5c, 0x09, 0x06,
0x01, 0x0a, 0x04, 0x5d, 0x09, 0x5c, 0x0a, 0x06, 0x5d, 0x09, 0x01, 0x0a,
0x01, 0x10, 0x0b, 0x00, 0x23, 0x0a, 0x33, 0x0a, 0x0e, 0x33, 0x0a, 0x0f,
0x5d, 0x09, 0x5c, 0x0a, 0x07, 0x5d, 0x09, 0x01, 0x0a, 0x05, 0x10, 0x0b,
0x10, 0x23, 0x0a, 0x5d, 0x09, 0x5c, 0x0a, 0x06, 0x5d, 0x09, 0x01, 0x0a,
0x06, 0x5d, 0x09, 0x5c, 0x0a, 0x08, 0x5d, 0x09, 0x01, 0x07, 0x09, 0x52,
0x08, 0x00, 0x01, 0x09, 0x08, 0x10, 0x0a, 0x11, 0x0f, 0x0b, 0x00, 0x0b,
0x0e, 0x14, 0x10, 0x0c, 0x12, 0x01, 0x0d, 0x03, 0x10, 0x0e, 0x13, 0x08,
0x0f, 0x10, 0x10, 0x14, 0x06, 0x11, 0x10, 0x12, 0x15, 0x03, 0x13, 0x0a,
0x5e, 0x0a, 0x05, 0x32, 0x09, 0x16, 0x01, 0x01, 0x09, 0x08, 0x10, 0x0a,
0x11, 0x01, 0x0b, 0x03, 0x10, 0x0c, 0x12, 0x0f, 0x0d, 0x00, 0x33, 0x36,
0x3c, 0x10, 0x0e, 0x14, 0x03, 0x0f, 0x0a, 0x10, 0x10, 0x15, 0x07, 0x11,
0x5e, 0x0a, 0x04, 0x32, 0x09, 0x16, 0x01, 0x01, 0x09, 0x08, 0x10, 0x0a,
0x11, 0x0f, 0x0b, 0x00, 0x33, 0x36, 0x3c, 0x10, 0x0c, 0x12, 0x0f, 0x0d,
0x00, 0x24, 0x27, 0x2d, 0x10, 0x0e, 0x14, 0x03, 0x0f, 0x0b, 0x10, 0x10,
0x15, 0x07, 0x11, 0x5e, 0x0a, 0x04, 0x32, 0x09, 0x16, 0x01, 0x01, 0x09,
0x08, 0x10, 0x0a, 0x11, 0x01, 0x0b, 0x05, 0x10, 0x0c, 0x17, 0x23, 0x0b,
0x10, 0x0c, 0x12, 0x0f, 0x0d, 0x00, 0x24, 0x27, 0x2d, 0x10, 0x0e, 0x14,
0x03, 0x0f, 0x0d, 0x10, 0x10, 0x15, 0x08, 0x11, 0x5e, 0x0a, 0x04, 0x32,
0x09, 0x16, 0x01, 0x01, 0x09, 0x08, 0x10, 0x0a, 0x11, 0x0f, 0x0b, 0x00,
0xce, 0xd4, 0xdf, 0x10, 0x0c, 0x12, 0x0f, 0x0d, 0x00, 0x24, 0x27, 0x2d,
0x10, 0x0e, 0x14, 0x03, 0x0f, 0x0f, 0x10, 0x10, 0x15, 0x01, 0x11, 0x06,
0x33, 0x11, 0x15, 0x46, 0x11, 0x01, 0x5e, 0x0a, 0x04, 0x32, 0x09, 0x16,
0x01, 0x01, 0x09, 0x08, 0x10, 0x0a, 0x11, 0x0f, 0x0b, 0x00, 0x24, 0x27,
0x2d, 0x10, 0x0c, 0x12, 0x06, 0x0d, 0x10, 0x0e, 0x14, 0x03, 0x0f, 0x0f,
0x01, 0x10, 0x06, 0x33, 0x10, 0x15, 0x45, 0x0f, 0x46, 0x0f, 0x01, 0x10,
0x10, 0x15, 0x07, 0x11, 0x5e, 0x0a, 0x04, 0x32, 0x09, 0x16, 0x01, 0x10,
0x09, 0x18, 0x01, 0x0a, 0x07, 0x10, 0x0b, 0x19, 0x01, 0x0c, 0x08, 0x5e,
0x09, 0x02, 0x3d, 0x09, 0x00, 0x09, 0x00, 0x00, 0x02, 0x20, 0x20, 0x00,
0x00, 0x00, 0x04, 0xee, 0x99, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x05, 0xf3,
0xb1, 0x93, 0xa7, 0x20, 0x00, 0x00, 0x00, 0x05, 0xf3, 0xb1, 0xa9, 0xa7,
0x20, 0x00, 0x00, 0x00, 0x04, 0xef, 0x84, 0xa0, 0x20, 0x00, 0x00, 0x00,
0x04, 0xee, 0xba, 0xa2, 0x20, 0x00, 0x00, 0x00, 0x01, 0x20, 0x00, 0x00,
0x00, 0x08, 0x20, 0xee, 0x82, 0xb4, 0xee, 0x82, 0xb4, 0x20, 0x00, 0x00,
0x00, 0x03, 0xee, 0x82, 0xb4, 0x00, 0x00, 0x1a, 0x00, 0x04, 0x6d, 0x6f,
0x64, 0x65, 0x00, 0x00, 0x06, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x00,
0x00, 0x03, 0x3d, 0x3d, 0x3d, 0x00, 0x00, 0x06, 0x69, 0x6e, 0x73, 0x65,
0x72, 0x74, 0x00, 0x00, 0x06, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x00,
0x00, 0x06, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x00, 0x00, 0x06, 0x6a,
0x75, 0x6d, 0x70, 0x65, 0x72, 0x00, 0x00, 0x01, 0x43, 0x00, 0x00, 0x09,
0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x73, 0x00, 0x00, 0x09,
0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x00, 0x00, 0x07,
0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x00, 0x00, 0x04, 0x46, 0x69,
0x6c, 0x65, 0x00, 0x00, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d,
0x65, 0x00, 0x00, 0x08, 0x62, 0x61, 0x73, 0x65, 0x6e, 0x61, 0x6d, 0x65,
0x00, 0x00, 0x04, 0x74, 0x6f, 0x5f, 0x73, 0x00, 0x00, 0x06, 0x75, 0x70,
0x63, 0x61, 0x73, 0x65, 0x00, 0x00, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f,
0x6c, 0x00, 0x00, 0x02, 0x66, 0x67, 0x00, 0x00, 0x02, 0x62, 0x67, 0x00,
0x00, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x00, 0x00, 0x05, 0x73, 0x74,
0x61, 0x72, 0x74, 0x00, 0x00, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68,
0x00, 0x00, 0x02, 0x3c, 0x3c, 0x00, 0x00, 0x05, 0x63, 0x6f, 0x6c, 0x6f,
0x72, 0x00, 0x00, 0x04, 0x74, 0x65, 0x78, 0x74, 0x00, 0x00, 0x0a, 0x68,
0x69, 0x67, 0x68, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x73, 0x00, 0x00, 0x00,
0x00, 0x37, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x10, 0x39, 0x04, 0x00, 0x00, 0x1d, 0x03, 0x00, 0x01, 0x04, 0x01,
0x32, 0x03, 0x01, 0x01, 0x3d, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x09,
0x43, 0x6c, 0x69, 0x70, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x00, 0x00, 0x04,
0x63, 0x6f, 0x70, 0x79, 0x00, 0x00, 0x00, 0x00, 0x34, 0x00, 0x02, 0x00,
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x39, 0x00, 0x00,
0x00, 0x1d, 0x02, 0x00, 0x33, 0x02, 0x01, 0x3d, 0x02, 0x00, 0x00, 0x00,
0x02, 0x00, 0x09, 0x43, 0x6c, 0x69, 0x70, 0x62, 0x6f, 0x61, 0x72, 0x64,
0x00, 0x00, 0x05, 0x70, 0x61, 0x73, 0x74, 0x65, 0x00, 0x00, 0x00, 0x03,
0xc8, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x3a, 0x39, 0x04, 0x00, 0x00, 0x10, 0x03, 0x00, 0x1d, 0x07, 0x01, 0x01,
0x08, 0x01, 0x32, 0x07, 0x02, 0x01, 0x27, 0x07, 0x00, 0x02, 0x3d, 0x03,
0x1d, 0x07, 0x01, 0x01, 0x08, 0x01, 0x10, 0x09, 0x03, 0x34, 0x07, 0x04,
0x01, 0x33, 0x07, 0x05, 0x01, 0x04, 0x07, 0x01, 0x07, 0x04, 0x5c, 0x08,
0x00, 0x32, 0x07, 0x06, 0x01, 0x28, 0x07, 0x00, 0xc7, 0x01, 0x07, 0x04,
0x08, 0x08, 0x11, 0x09, 0x64, 0x08, 0x23, 0x07, 0x33, 0x07, 0x07, 0x01,
0x05, 0x07, 0x01, 0x07, 0x05, 0x66, 0x08, 0x1f, 0x08, 0x08, 0x5c, 0x09,
0x01, 0x32, 0x08, 0x09, 0x01, 0x01, 0x09, 0x07, 0x32, 0x08, 0x0a, 0x01,
0x27, 0x08, 0x00, 0x17, 0x66, 0x08, 0x1f, 0x08, 0x08, 0x5c, 0x09, 0x02,
0x32, 0x08, 0x09, 0x01, 0x01, 0x09, 0x07, 0x32, 0x08, 0x0a, 0x01, 0x28,
0x08, 0x00, 0x06, 0x10, 0x08, 0x0b, 0x26, 0x00, 0x7a, 0x66, 0x08, 0x1f,
0x08, 0x08, 0x5c, 0x09, 0x03, 0x32, 0x08, 0x09, 0x01, 0x01, 0x09, 0x07,
0x32, 0x08, 0x0a, 0x01, 0x28, 0x08, 0x00, 0x06, 0x10, 0x08, 0x0c, 0x26,
0x00, 0x5d, 0x66, 0x08, 0x1f, 0x08, 0x08, 0x5c, 0x09, 0x04, 0x32, 0x08,
0x09, 0x01, 0x01, 0x09, 0x07, 0x32, 0x08, 0x0a, 0x01, 0x28, 0x08, 0x00,
0x06, 0x10, 0x08, 0x0d, 0x26, 0x00, 0x40, 0x66, 0x08, 0x1f, 0x08, 0x08,
0x5c, 0x09, 0x05, 0x32, 0x08, 0x09, 0x01, 0x01, 0x09, 0x07, 0x32, 0x08,
0x0a, 0x01, 0x28, 0x08, 0x00, 0x06, 0x10, 0x08, 0x0e, 0x26, 0x00, 0x23,
0x66, 0x08, 0x1f, 0x08, 0x08, 0x5c, 0x09, 0x06, 0x32, 0x08, 0x09, 0x01,
0x01, 0x09, 0x07, 0x32, 0x08, 0x0a, 0x01, 0x28, 0x08, 0x00, 0x06, 0x10,
0x08, 0x0f, 0x26, 0x00, 0x06, 0x10, 0x08, 0x00, 0x26, 0x00, 0x00, 0x01,
0x03, 0x08, 0x3d, 0x03, 0x10, 0x07, 0x10, 0x10, 0x08, 0x10, 0x32, 0x07,
0x11, 0x01, 0x27, 0x07, 0x00, 0x0a, 0x10, 0x07, 0x10, 0x10, 0x08, 0x12,
0x32, 0x07, 0x11, 0x01, 0x28, 0x07, 0x00, 0x02, 0x3d, 0x03, 0x5c, 0x08,
0x07, 0x2f, 0x07, 0x13, 0x01, 0x33, 0x07, 0x14, 0x28, 0x07, 0x00, 0x02,
0x3d, 0x03, 0x5c, 0x08, 0x08, 0x01, 0x09, 0x01, 0x5d, 0x08, 0x5c, 0x09,
0x09, 0x5d, 0x08, 0x2f, 0x07, 0x15, 0x01, 0x33, 0x07, 0x05, 0x01, 0x06,
0x07, 0x01, 0x07, 0x06, 0x66, 0x08, 0x1f, 0x08, 0x08, 0x5c, 0x09, 0x0a,
0x32, 0x08, 0x09, 0x01, 0x01, 0x09, 0x07, 0x32, 0x08, 0x0a, 0x01, 0x28,
0x08, 0x00, 0x06, 0x10, 0x08, 0x0b, 0x26, 0x00, 0xd1, 0x66, 0x08, 0x1f,
0x08, 0x08, 0x5c, 0x09, 0x05, 0x32, 0x08, 0x09, 0x01, 0x01, 0x09, 0x07,
0x32, 0x08, 0x0a, 0x01, 0x28, 0x08, 0x00, 0x06, 0x10, 0x08, 0x0e, 0x26,
0x00, 0xb4, 0x66, 0x08, 0x1f, 0x08, 0x08, 0x5c, 0x09, 0x0b, 0x32, 0x08,
0x09, 0x01, 0x01, 0x09, 0x07, 0x32, 0x08, 0x0a, 0x01, 0x28, 0x08, 0x00,
0x06, 0x10, 0x08, 0x16, 0x26, 0x00, 0x97, 0x66, 0x08, 0x1f, 0x08, 0x08,
0x5c, 0x09, 0x0c, 0x32, 0x08, 0x09, 0x01, 0x01, 0x09, 0x07, 0x32, 0x08,
0x0a, 0x01, 0x28, 0x08, 0x00, 0x06, 0x10, 0x08, 0x17, 0x26, 0x00, 0x7a,
0x66, 0x08, 0x1f, 0x08, 0x08, 0x5c, 0x09, 0x04, 0x32, 0x08, 0x09, 0x01,
0x01, 0x09, 0x07, 0x32, 0x08, 0x0a, 0x01, 0x28, 0x08, 0x00, 0x06, 0x10,
0x08, 0x0d, 0x26, 0x00, 0x5d, 0x66, 0x08, 0x1f, 0x08, 0x08, 0x5c, 0x09,
0x0d, 0x32, 0x08, 0x09, 0x01, 0x01, 0x09, 0x07, 0x32, 0x08, 0x0a, 0x01,
0x28, 0x08, 0x00, 0x06, 0x10, 0x08, 0x18, 0x26, 0x00, 0x40, 0x66, 0x08,
0x1f, 0x08, 0x08, 0x5c, 0x09, 0x0e, 0x32, 0x08, 0x09, 0x01, 0x01, 0x09,
0x07, 0x32, 0x08, 0x0a, 0x01, 0x28, 0x08, 0x00, 0x06, 0x10, 0x08, 0x19,
0x26, 0x00, 0x23, 0x66, 0x08, 0x1f, 0x08, 0x08, 0x5c, 0x09, 0x0f, 0x32,
0x08, 0x09, 0x01, 0x01, 0x09, 0x07, 0x32, 0x08, 0x0a, 0x01, 0x28, 0x08,
0x00, 0x06, 0x10, 0x08, 0x1a, 0x26, 0x00, 0x06, 0x10, 0x08, 0x00, 0x26,
0x00, 0x00, 0x01, 0x03, 0x08, 0x3d, 0x03, 0x00, 0x10, 0x00, 0x00, 0x02,
0x23, 0x21, 0x00, 0x00, 0x00, 0x04, 0x62, 0x61, 0x73, 0x68, 0x00, 0x00,
0x00, 0x02, 0x73, 0x68, 0x00, 0x00, 0x00, 0x04, 0x66, 0x69, 0x73, 0x68,
0x00, 0x00, 0x00, 0x06, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x00, 0x00,
0x00, 0x04, 0x72, 0x75, 0x62, 0x79, 0x00, 0x00, 0x00, 0x03, 0x6c, 0x75,
0x61, 0x00, 0x00, 0x00, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x00, 0x00, 0x00,
0x14, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x2d, 0x2d, 0x6d, 0x69, 0x6d, 0x65,
0x2d, 0x74, 0x79, 0x70, 0x65, 0x20, 0x2d, 0x62, 0x20, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x0b, 0x73, 0x68, 0x65, 0x6c, 0x6c, 0x73, 0x63,
0x72, 0x69, 0x70, 0x74, 0x00, 0x00, 0x00, 0x04, 0x64, 0x69, 0x66, 0x66,
0x00, 0x00, 0x00, 0x04, 0x68, 0x74, 0x6d, 0x6c, 0x00, 0x00, 0x00, 0x0a,
0x6a, 0x61, 0x76, 0x61, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x00, 0x00,
0x00, 0x08, 0x6d, 0x61, 0x6b, 0x65, 0x66, 0x69, 0x6c, 0x65, 0x00, 0x00,
0x00, 0x03, 0x2d, 0x63, 0x24, 0x00, 0x00, 0x1b, 0x00, 0x07, 0x64, 0x65,
0x66, 0x61, 0x75, 0x6c, 0x74, 0x00, 0x00, 0x04, 0x46, 0x69, 0x6c, 0x65,
0x00, 0x00, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x3f, 0x00, 0x00, 0x08,
0x72, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x00, 0x00, 0x04, 0x6f,
0x70, 0x65, 0x6e, 0x00, 0x00, 0x05, 0x63, 0x68, 0x6f, 0x6d, 0x70, 0x00,
0x00, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x77, 0x69, 0x74, 0x68,
0x3f, 0x00, 0x00, 0x08, 0x64, 0x6f, 0x77, 0x6e, 0x63, 0x61, 0x73, 0x65,
0x00, 0x00, 0x06, 0x52, 0x65, 0x67, 0x65, 0x78, 0x70, 0x00, 0x00, 0x07,
0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x00, 0x00, 0x03, 0x3d, 0x3d,
0x3d, 0x00, 0x00, 0x04, 0x62, 0x61, 0x73, 0x68, 0x00, 0x00, 0x04, 0x66,
0x69, 0x73, 0x68, 0x00, 0x00, 0x06, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e,
0x00, 0x00, 0x04, 0x72, 0x75, 0x62, 0x79, 0x00, 0x00, 0x03, 0x6c, 0x75,
0x61, 0x00, 0x00, 0x05, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x00, 0x00, 0x02,
0x21, 0x3d, 0x00, 0x00, 0x03, 0x6d, 0x61, 0x63, 0x00, 0x00, 0x0f, 0x63,
0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x5f, 0x65, 0x78, 0x69, 0x73, 0x74,
0x73, 0x3f, 0x00, 0x00, 0x01, 0x21, 0x00, 0x00, 0x01, 0x60, 0x00, 0x00,
0x04, 0x64, 0x69, 0x66, 0x66, 0x00, 0x00, 0x04, 0x68, 0x74, 0x6d, 0x6c,
0x00, 0x00, 0x0a, 0x6a, 0x61, 0x76, 0x61, 0x73, 0x63, 0x72, 0x69, 0x70,
0x74, 0x00, 0x00, 0x08, 0x6d, 0x61, 0x6b, 0x65, 0x66, 0x69, 0x6c, 0x65,
0x00, 0x00, 0x01, 0x63, 0x00, 0x00, 0x00, 0x01, 0x6b, 0x00, 0x01, 0x00,
0x0a, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4e, 0x10, 0x02, 0x00,
0x10, 0x03, 0x01, 0x10, 0x04, 0x02, 0x10, 0x05, 0x03, 0x10, 0x06, 0x04,
0x2f, 0x01, 0x05, 0x05, 0x10, 0x02, 0x06, 0x10, 0x03, 0x07, 0x10, 0x04,
0x08, 0x10, 0x05, 0x09, 0x10, 0x06, 0x0a, 0x10, 0x07, 0x0b, 0x10, 0x08,
0x0c, 0x2f, 0x01, 0x0d, 0x07, 0x6b, 0x01, 0x0e, 0x00, 0x6b, 0x01, 0x0f,
0x01, 0x6b, 0x01, 0x10, 0x02, 0x6b, 0x01, 0x11, 0x03, 0x6b, 0x01, 0x12,
0x04, 0x6b, 0x01, 0x13, 0x05, 0x6b, 0x01, 0x14, 0x06, 0x6b, 0x01, 0x15,
0x07, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x16, 0x00, 0x05, 0x74, 0x68, 0x65,
0x6d, 0x65, 0x00, 0x00, 0x0a, 0x6c, 0x73, 0x70, 0x5f, 0x63, 0x6f, 0x6e,
0x66, 0x69, 0x67, 0x00, 0x00, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61,
0x67, 0x65, 0x73, 0x00, 0x00, 0x0c, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x65,
0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x00, 0x00, 0x0c, 0x68, 0x69, 0x67,
0x68, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x65, 0x72, 0x73, 0x00, 0x00, 0x0d,
0x61, 0x74, 0x74, 0x72, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f,
0x72, 0x00, 0x00, 0x09, 0x62, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x75,
0x70, 0x00, 0x00, 0x0a, 0x62, 0x5f, 0x73, 0x68, 0x75, 0x74, 0x64, 0x6f,
0x77, 0x6e, 0x00, 0x00, 0x12, 0x62, 0x5f, 0x65, 0x78, 0x74, 0x72, 0x61,
0x5f, 0x68, 0x69, 0x67, 0x68, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x73, 0x00,
0x00, 0x05, 0x62, 0x5f, 0x62, 0x61, 0x72, 0x00, 0x00, 0x06, 0x62, 0x5f,
0x63, 0x6f, 0x70, 0x79, 0x00, 0x00, 0x07, 0x62, 0x5f, 0x70, 0x61, 0x73,
0x74, 0x65, 0x00, 0x00, 0x0d, 0x62, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x5f,
0x64, 0x65, 0x74, 0x65, 0x63, 0x74, 0x00, 0x00, 0x0b, 0x61, 0x74, 0x74,
0x72, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x65, 0x72, 0x00, 0x00, 0x04, 0x62,
0x61, 0x72, 0x3d, 0x00, 0x00, 0x07, 0x73, 0x74, 0x61, 0x72, 0x74, 0x75,
0x70, 0x00, 0x00, 0x08, 0x73, 0x68, 0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e,
0x00, 0x00, 0x04, 0x63, 0x6f, 0x70, 0x79, 0x00, 0x00, 0x05, 0x70, 0x61,
0x73, 0x74, 0x65, 0x00, 0x00, 0x0b, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x64,
0x65, 0x74, 0x65, 0x63, 0x74, 0x00, 0x00, 0x10, 0x65, 0x78, 0x74, 0x72,
0x61, 0x5f, 0x68, 0x69, 0x67, 0x68, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x73,
0x00, 0x00, 0x04, 0x62, 0x69, 0x6e, 0x64, 0x00, 0x00, 0x00, 0x00, 0x2c,
0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f,
0x39, 0x00, 0x00, 0x01, 0x01, 0x02, 0x01, 0x01, 0x03, 0x02, 0x1a, 0x03,
0x00, 0x3d, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x06, 0x40, 0x62, 0x5f,
0x62, 0x61, 0x72, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x03, 0x00, 0x04,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x39, 0x00, 0x00, 0x01,
0x01, 0x02, 0x01, 0x01, 0x03, 0x02, 0x1a, 0x03, 0x00, 0x3d, 0x03, 0x00,
0x00, 0x00, 0x01, 0x00, 0x0a, 0x40, 0x62, 0x5f, 0x73, 0x74, 0x61, 0x72,
0x74, 0x75, 0x70, 0x00, 0x00, 0x00, 0x00, 0x31, 0x00, 0x03, 0x00, 0x04,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x39, 0x00, 0x00, 0x01,
0x01, 0x02, 0x01, 0x01, 0x03, 0x02, 0x1a, 0x03, 0x00, 0x3d, 0x03, 0x00,
0x00, 0x00, 0x01, 0x00, 0x0b, 0x40, 0x62, 0x5f, 0x73, 0x68, 0x75, 0x74,
0x64, 0x6f, 0x77, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x03, 0x00,
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x39, 0x00, 0x00,
0x01, 0x01, 0x02, 0x01, 0x01, 0x03, 0x02, 0x1a, 0x03, 0x00, 0x3d, 0x03,
0x00, 0x00, 0x00, 0x01, 0x00, 0x07, 0x40, 0x62, 0x5f, 0x63, 0x6f, 0x70,
0x79, 0x00, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x39, 0x00, 0x00, 0x01, 0x01, 0x02,
0x01, 0x01, 0x03, 0x02, 0x1a, 0x03, 0x00, 0x3d, 0x03, 0x00, 0x00, 0x00,
0x01, 0x00, 0x08, 0x40, 0x62, 0x5f, 0x70, 0x61, 0x73, 0x74, 0x65, 0x00,
0x00, 0x00, 0x00, 0x34, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x0f, 0x39, 0x00, 0x00, 0x01, 0x01, 0x02, 0x01, 0x01,
0x03, 0x02, 0x1a, 0x03, 0x00, 0x3d, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00,
0x0e, 0x40, 0x62, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x64, 0x65, 0x74,
0x65, 0x63, 0x74, 0x00, 0x00, 0x00, 0x00, 0x39, 0x00, 0x03, 0x00, 0x04,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x39, 0x00, 0x00, 0x01,
0x01, 0x02, 0x01, 0x01, 0x03, 0x02, 0x1a, 0x03, 0x00, 0x3d, 0x03, 0x00,
0x00, 0x00, 0x01, 0x00, 0x13, 0x40, 0x62, 0x5f, 0x65, 0x78, 0x74, 0x72,
0x61, 0x5f, 0x68, 0x69, 0x67, 0x68, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x73,
0x00, 0x00, 0x00, 0x01, 0x43, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x03, 0x00,
0x00, 0x00, 0x00, 0x00, 0xc1, 0x39, 0x04, 0x40, 0x01, 0x26, 0x00, 0x06,
0x26, 0x00, 0x05, 0x26, 0x00, 0x04, 0x11, 0x02, 0x11, 0x03, 0x01, 0x05,
0x04, 0x01, 0x08, 0x01, 0x1d, 0x09, 0x00, 0x32, 0x08, 0x01, 0x01, 0x27,
0x08, 0x00, 0x07, 0x01, 0x08, 0x01, 0x53, 0x01, 0x08, 0x01, 0x01, 0x08,
0x02, 0x29, 0x08, 0x00, 0x03, 0x26, 0x00, 0x31, 0x12, 0x06, 0x1d, 0x08,
0x02, 0x33, 0x08, 0x03, 0x01, 0x07, 0x08, 0x01, 0x08, 0x07, 0x10, 0x09,
0x04, 0x62, 0x0a, 0x00, 0x34, 0x08, 0x05, 0x01, 0x30, 0x08, 0x06, 0x28,
0x08, 0x00, 0x0d, 0x01, 0x08, 0x07, 0x01, 0x09, 0x05, 0x34, 0x08, 0x07,
0x00, 0x26, 0x00, 0x02, 0x11, 0x08, 0x26, 0x00, 0x5b, 0x30, 0x08, 0x06,
0x28, 0x08, 0x00, 0x22, 0x01, 0x08, 0x02, 0x1d, 0x09, 0x00, 0x32, 0x08,
0x01, 0x01, 0x27, 0x08, 0x00, 0x07, 0x01, 0x08, 0x02, 0x53, 0x02, 0x08,
0x01, 0x01, 0x08, 0x01, 0x62, 0x09, 0x01, 0x34, 0x08, 0x08, 0x00, 0x26,
0x00, 0x32, 0x01, 0x08, 0x03, 0x1d, 0x09, 0x09, 0x32, 0x08, 0x01, 0x01,
0x28, 0x08, 0x00, 0x22, 0x01, 0x08, 0x02, 0x1d, 0x09, 0x00, 0x32, 0x08,
0x01, 0x01, 0x27, 0x08, 0x00, 0x07, 0x01, 0x08, 0x02, 0x53, 0x02, 0x08,
0x01, 0x01, 0x08, 0x01, 0x62, 0x09, 0x02, 0x34, 0x08, 0x08, 0x00, 0x26,
0x00, 0x02, 0x11, 0x08, 0x3d, 0x08, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x05,
0x41, 0x72, 0x72, 0x61, 0x79, 0x00, 0x00, 0x05, 0x69, 0x73, 0x5f, 0x61,
0x3f, 0x00, 0x00, 0x06, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x00, 0x00,
0x03, 0x6e, 0x65, 0x77, 0x00, 0x00, 0x03, 0x73, 0x65, 0x74, 0x00, 0x00,
0x17, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x5f, 0x73, 0x69, 0x6e, 0x67,
0x6c, 0x65, 0x74, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64,
0x00, 0x00, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x67, 0x69, 0x76,
0x65, 0x6e, 0x3f, 0x00, 0x00, 0x0d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e,
0x63, 0x65, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x00, 0x00, 0x04, 0x65, 0x61,
0x63, 0x68, 0x00, 0x00, 0x06, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x00,
0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x26, 0x39, 0x04, 0x20, 0x01, 0x26, 0x00, 0x03, 0x26,
0x00, 0x02, 0x11, 0x02, 0x01, 0x04, 0x03, 0x21, 0x05, 0x06, 0x00, 0x21,
0x06, 0x01, 0x00, 0x01, 0x07, 0x01, 0x01, 0x08, 0x02, 0x01, 0x09, 0x04,
0x34, 0x05, 0x00, 0x03, 0x3d, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04,
0x62, 0x69, 0x6e, 0x64, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x03, 0x00,
0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x39, 0x04, 0x00,
0x00, 0x21, 0x03, 0x02, 0x00, 0x62, 0x04, 0x00, 0x34, 0x03, 0x00, 0x00,
0x3d, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x65, 0x61, 0x63, 0x68,
0x00, 0x00, 0x00, 0x00, 0x87, 0x00, 0x03, 0x00, 0x08, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x5e, 0x39, 0x04, 0x00, 0x00, 0x19, 0x03, 0x00,
0x21, 0x04, 0x01, 0x00, 0x23, 0x03, 0x27, 0x03, 0x00, 0x0f, 0x5e, 0x03,
0x00, 0x19, 0x04, 0x00, 0x21, 0x05, 0x01, 0x00, 0x01, 0x06, 0x03, 0x25,
0x04, 0x19, 0x03, 0x00, 0x21, 0x04, 0x01, 0x00, 0x23, 0x03, 0x01, 0x04,
0x01, 0x23, 0x03, 0x27, 0x03, 0x00, 0x14, 0x52, 0x03, 0x00, 0x19, 0x04,
0x00, 0x21, 0x05, 0x01, 0x00, 0x23, 0x04, 0x01, 0x05, 0x01, 0x01, 0x06,
0x03, 0x25, 0x04, 0x19, 0x03, 0x00, 0x21, 0x04, 0x01, 0x00, 0x23, 0x03,
0x01, 0x04, 0x01, 0x23, 0x03, 0x21, 0x04, 0x05, 0x01, 0x32, 0x03, 0x01,
0x01, 0x3d, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0d, 0x40, 0x6b, 0x65,
0x79, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x00, 0x00,
0x02, 0x3c, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x03, 0x00, 0x05,
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x39, 0x04, 0x00, 0x00,
0x21, 0x03, 0x02, 0x00, 0x62, 0x04, 0x00, 0x34, 0x03, 0x00, 0x00, 0x3d,
0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x65, 0x61, 0x63, 0x68, 0x00,
0x00, 0x00, 0x00, 0x84, 0x00, 0x03, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x5e, 0x39, 0x04, 0x00, 0x00, 0x19, 0x03, 0x00, 0x21,
0x04, 0x01, 0x00, 0x23, 0x03, 0x27, 0x03, 0x00, 0x0f, 0x5e, 0x03, 0x00,
0x19, 0x04, 0x00, 0x21, 0x05, 0x01, 0x00, 0x01, 0x06, 0x03, 0x25, 0x04,
0x19, 0x03, 0x00, 0x21, 0x04, 0x01, 0x00, 0x23, 0x03, 0x01, 0x04, 0x01,
0x23, 0x03, 0x27, 0x03, 0x00, 0x14, 0x52, 0x03, 0x00, 0x19, 0x04, 0x00,
0x21, 0x05, 0x01, 0x00, 0x23, 0x04, 0x01, 0x05, 0x01, 0x01, 0x06, 0x03,
0x25, 0x04, 0x19, 0x03, 0x00, 0x21, 0x04, 0x01, 0x00, 0x23, 0x03, 0x01,
0x04, 0x01, 0x23, 0x03, 0x21, 0x04, 0x03, 0x01, 0x32, 0x03, 0x01, 0x01,
0x3d, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0a, 0x40, 0x6b, 0x65, 0x79,
0x5f, 0x62, 0x69, 0x6e, 0x64, 0x73, 0x00, 0x00, 0x02, 0x3c, 0x3c, 0x00,
0x00, 0x00, 0x00, 0x38, 0x00, 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00,
0x00, 0x00, 0x00, 0x0a, 0x6b, 0x01, 0x00, 0x00, 0x6b, 0x01, 0x01, 0x01,
0x3d, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x10, 0x72, 0x65, 0x71, 0x75,
0x69, 0x72, 0x65, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65,
0x00, 0x00, 0x04, 0x6c, 0x6f, 0x61, 0x64, 0x00, 0x00, 0x00, 0x01, 0x07,
0x00, 0x05, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7b,
0x39, 0x04, 0x20, 0x00, 0x26, 0x00, 0x03, 0x26, 0x00, 0x02, 0x11, 0x02,
0x01, 0x05, 0x01, 0x5c, 0x06, 0x00, 0x32, 0x05, 0x00, 0x01, 0x27, 0x05,
0x00, 0x0b, 0x01, 0x05, 0x01, 0x5c, 0x06, 0x00, 0x45, 0x05, 0x01, 0x01,
0x05, 0x1d, 0x05, 0x01, 0x01, 0x06, 0x01, 0x1d, 0x07, 0x01, 0x1d, 0x08,
0x02, 0x33, 0x08, 0x03, 0x32, 0x07, 0x04, 0x01, 0x32, 0x05, 0x05, 0x02,
0x01, 0x01, 0x05, 0x15, 0x05, 0x06, 0x01, 0x06, 0x01, 0x32, 0x05, 0x07,
0x01, 0x28, 0x05, 0x00, 0x01, 0x40, 0x15, 0x05, 0x06, 0x01, 0x06, 0x01,
0x32, 0x05, 0x08, 0x01, 0x1d, 0x05, 0x01, 0x01, 0x06, 0x01, 0x32, 0x05,
0x09, 0x01, 0x01, 0x04, 0x05, 0x01, 0x06, 0x04, 0x01, 0x07, 0x02, 0x27,
0x07, 0x00, 0x03, 0x15, 0x07, 0x0a, 0x01, 0x08, 0x01, 0x2f, 0x05, 0x0b,
0x03, 0x3d, 0x05, 0x00, 0x01, 0x00, 0x00, 0x03, 0x2e, 0x72, 0x62, 0x00,
0x00, 0x0c, 0x00, 0x09, 0x65, 0x6e, 0x64, 0x5f, 0x77, 0x69, 0x74, 0x68,
0x3f, 0x00, 0x00, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x00, 0x00, 0x01, 0x43,
0x00, 0x00, 0x0b, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x66, 0x69,
0x6c, 0x65, 0x00, 0x00, 0x07, 0x64, 0x69, 0x72, 0x6e, 0x61, 0x6d, 0x65,
0x00, 0x00, 0x0b, 0x65, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x5f, 0x70, 0x61,
0x74, 0x68, 0x00, 0x00, 0x07, 0x24, 0x4c, 0x4f, 0x41, 0x44, 0x45, 0x44,
0x00, 0x00, 0x08, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x3f, 0x00,
0x00, 0x02, 0x3c, 0x3c, 0x00, 0x00, 0x04, 0x72, 0x65, 0x61, 0x64, 0x00,
0x00, 0x09, 0x24, 0x42, 0x49, 0x4e, 0x44, 0x5f, 0x54, 0x4f, 0x50, 0x00,
0x00, 0x04, 0x65, 0x76, 0x61, 0x6c, 0x00, 0x00, 0x00, 0x00, 0xd3, 0x00,
0x04, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x39,
0x04, 0x20, 0x00, 0x26, 0x00, 0x03, 0x26, 0x00, 0x02, 0x11, 0x02, 0x01,
0x04, 0x01, 0x5c, 0x05, 0x00, 0x32, 0x04, 0x00, 0x01, 0x27, 0x04, 0x00,
0x0b, 0x01, 0x04, 0x01, 0x5c, 0x05, 0x00, 0x45, 0x04, 0x01, 0x01, 0x04,
0x1d, 0x04, 0x01, 0x01, 0x05, 0x01, 0x1d, 0x06, 0x01, 0x1d, 0x07, 0x02,
0x33, 0x07, 0x03, 0x32, 0x06, 0x04, 0x01, 0x32, 0x04, 0x05, 0x02, 0x01,
0x01, 0x04, 0x15, 0x04, 0x06, 0x01, 0x05, 0x01, 0x32, 0x04, 0x07, 0x01,
0x01, 0x05, 0x01, 0x01, 0x06, 0x02, 0x2f, 0x04, 0x08, 0x02, 0x3d, 0x04,
0x00, 0x01, 0x00, 0x00, 0x03, 0x2e, 0x72, 0x62, 0x00, 0x00, 0x09, 0x00,
0x09, 0x65, 0x6e, 0x64, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x3f, 0x00, 0x00,
0x04, 0x46, 0x69, 0x6c, 0x65, 0x00, 0x00, 0x01, 0x43, 0x00, 0x00, 0x0b,
0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x00,
0x00, 0x07, 0x64, 0x69, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x00, 0x00, 0x0b,
0x65, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x00,
0x00, 0x07, 0x24, 0x4c, 0x4f, 0x41, 0x44, 0x45, 0x44, 0x00, 0x00, 0x06,
0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x00, 0x00, 0x10, 0x72, 0x65, 0x71,
0x75, 0x69, 0x72, 0x65, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76,
0x65, 0x00, 0x4c, 0x56, 0x41, 0x52, 0x00, 0x00, 0x01, 0x78, 0x00, 0x00,
0x00, 0x1d, 0x00, 0x03, 0x63, 0x6d, 0x64, 0x00, 0x04, 0x74, 0x65, 0x78,
0x74, 0x00, 0x01, 0x66, 0x00, 0x07, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65,
0x64, 0x00, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x00, 0x0a, 0x6d, 0x6f, 0x64,
0x65, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x0b, 0x6d, 0x6f, 0x64,
0x65, 0x5f, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x00, 0x09, 0x6c, 0x61,
0x6e, 0x67, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x00, 0x08, 0x66, 0x69, 0x6c,
0x65, 0x6e, 0x61, 0x6d, 0x65, 0x00, 0x08, 0x73, 0x74, 0x61, 0x72, 0x74,
0x69, 0x6e, 0x67, 0x00, 0x0a, 0x68, 0x69, 0x67, 0x68, 0x6c, 0x69, 0x67,
0x68, 0x74, 0x73, 0x00, 0x04, 0x74, 0x79, 0x70, 0x65, 0x00, 0x0a, 0x66,
0x69, 0x72, 0x73, 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x00, 0x07, 0x73,
0x68, 0x65, 0x62, 0x61, 0x6e, 0x67, 0x00, 0x08, 0x6d, 0x69, 0x6d, 0x65,
0x74, 0x79, 0x70, 0x65, 0x00, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x00,
0x05, 0x6d, 0x6f, 0x64, 0x65, 0x73, 0x00, 0x04, 0x6b, 0x65, 0x79, 0x73,
0x00, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x03, 0x61, 0x70,
0x70, 0x00, 0x03, 0x64, 0x73, 0x6c, 0x00, 0x01, 0x6b, 0x00, 0x03, 0x61,
0x63, 0x74, 0x00, 0x03, 0x62, 0x6c, 0x6b, 0x00, 0x04, 0x6d, 0x6f, 0x64,
0x65, 0x00, 0x03, 0x6b, 0x65, 0x79, 0x00, 0x04, 0x70, 0x61, 0x74, 0x68,
0x00, 0x04, 0x62, 0x69, 0x6e, 0x64, 0x00, 0x04, 0x63, 0x6f, 0x64, 0x65,
0x00, 0x00, 0xff, 0xff, 0x00, 0x01, 0xff, 0xff, 0x00, 0x02, 0xff, 0xff,
0x00, 0x02, 0xff, 0xff, 0x00, 0x02, 0xff, 0xff, 0x00, 0x02, 0xff, 0xff,
0x00, 0x02, 0xff, 0xff, 0xff, 0xff, 0x00, 0x01, 0xff, 0xff, 0x00, 0x03,
0x00, 0x04, 0xff, 0xff, 0x00, 0x05, 0x00, 0x06, 0x00, 0x07, 0x00, 0x08,
0x00, 0x09, 0x00, 0x0a, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0x00, 0x08,
0xff, 0xff, 0x00, 0x0b, 0x00, 0x0c, 0x00, 0x0d, 0x00, 0x0e, 0xff, 0xff,
0x00, 0x0f, 0xff, 0xff, 0x00, 0x0f, 0xff, 0xff, 0x00, 0x0f, 0xff, 0xff,
0x00, 0x0f, 0xff, 0xff, 0x00, 0x0f, 0xff, 0xff, 0x00, 0x0f, 0xff, 0xff,
0x00, 0x0f, 0x00, 0x10, 0x00, 0x11, 0x00, 0x12, 0xff, 0xff, 0x00, 0x0f,
0x00, 0x13, 0x00, 0x14, 0x00, 0x15, 0x00, 0x16, 0xff, 0xff, 0x00, 0x17,
0x00, 0x18, 0xff, 0xff, 0x00, 0x19, 0xff, 0xff, 0x00, 0x18, 0xff, 0xff,
0x00, 0x19, 0xff, 0xff, 0x00, 0x1a, 0x00, 0x1b, 0xff, 0xff, 0x00, 0x1c,
0x00, 0x1a, 0x00, 0x1b, 0xff, 0xff, 0x45, 0x4e, 0x44, 0x00, 0x00, 0x00,
0x00, 0x08
};
constexpr unsigned int _tmp___crib_precompiled_mrb_len = 11198;

View File

@@ -1,22 +0,0 @@
#ifndef SCRIPTING_DECL_H
#define SCRIPTING_DECL_H
#include "syntax/decl.h"
#include "utils/utils.h"
extern std::unordered_map<std::string, std::pair<VALUE, VALUE>>
custom_highlighters;
void ruby_start();
void ruby_shutdown();
void ruby_log(std::string msg);
void load_theme();
void load_languages_info();
uint8_t read_line_endings();
void load_custom_highlighters();
VALUE parse_custom(std::vector<Token> *tokens, VALUE parser_block,
const char *line, uint32_t len, VALUE state,
uint32_t line_num);
bool custom_compare(VALUE match_block, VALUE state1, VALUE state2);
#endif

View File

@@ -3,6 +3,7 @@
#include "io/knot.h" #include "io/knot.h"
#include "io/sysio.h" #include "io/sysio.h"
#include "pch.h"
#include "syntax/trie.h" #include "syntax/trie.h"
struct Highlight { struct Highlight {
@@ -26,24 +27,6 @@ const std::unordered_map<std::string, TokenKind> kind_map = {
#undef ADD #undef ADD
}; };
constexpr const char tokens_def[] = "module Tokens\n"
#define STRINGIFY_HELPER(x) #x
#define STRINGIFY(x) STRINGIFY_HELPER(x)
#define ADD(name) " " #name " = " STRINGIFY(__COUNTER__) "\n"
#include "syntax/tokens.def"
#undef ADD
#undef STRINGIFY
#undef STRINGIFY_HELPER
" freeze\n"
"end";
constexpr const char crib_module[] = {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wc23-extensions"
#embed "libcrib.rb"
#pragma clang diagnostic pop
, '\0'};
extern std::array<Highlight, TOKEN_KIND_COUNT> highlights; extern std::array<Highlight, TOKEN_KIND_COUNT> highlights;
struct Token { struct Token {
@@ -58,10 +41,4 @@ struct LineData {
std::shared_ptr<void> out_state{nullptr}; std::shared_ptr<void> out_state{nullptr};
}; };
struct CustomState {
VALUE state;
CustomState(VALUE s) : state(s) { rb_gc_register_address(&state); }
~CustomState() { rb_gc_unregister_address(&state); }
};
#endif #endif

View File

@@ -5,17 +5,12 @@
struct LineTree { struct LineTree {
void clear() { void clear() {
std::unique_lock lock(mtx);
clear_node(root); clear_node(root);
root = nullptr; root = nullptr;
stack_size = 0; stack_size = 0;
} }
void build(uint32_t x) { void build(uint32_t x) { root = build_node(x); }
std::unique_lock lock(mtx);
root = build_node(x);
}
LineData *at(uint32_t x) { LineData *at(uint32_t x) {
std::shared_lock lock(mtx);
LineNode *n = root; LineNode *n = root;
while (n) { while (n) {
uint32_t left_size = n->left ? n->left->size : 0; uint32_t left_size = n->left ? n->left->size : 0;
@@ -31,7 +26,6 @@ struct LineTree {
return nullptr; return nullptr;
} }
LineData *start_iter(uint32_t x) { LineData *start_iter(uint32_t x) {
std::shared_lock lock(mtx);
stack_size = 0; stack_size = 0;
LineNode *n = root; LineNode *n = root;
while (n) { while (n) {
@@ -52,7 +46,6 @@ struct LineTree {
} }
void end_iter() { stack_size = 0; } void end_iter() { stack_size = 0; }
LineData *next() { LineData *next() {
std::shared_lock lock(mtx);
while (stack_size) { while (stack_size) {
auto &f = stack[stack_size - 1]; auto &f = stack[stack_size - 1];
LineNode *n = f.node; LineNode *n = f.node;
@@ -73,21 +66,16 @@ struct LineTree {
return nullptr; return nullptr;
} }
void insert(uint32_t x, uint32_t y) { void insert(uint32_t x, uint32_t y) {
std::unique_lock lock(mtx);
if (x > subtree_size(root)) if (x > subtree_size(root))
x = subtree_size(root); x = subtree_size(root);
root = insert_node(root, x, y); root = insert_node(root, x, y);
} }
void erase(uint32_t x, uint32_t y) { void erase(uint32_t x, uint32_t y) {
std::unique_lock lock(mtx);
if (x + y > subtree_size(root)) if (x + y > subtree_size(root))
x = subtree_size(root) - y; x = subtree_size(root) - y;
root = erase_node(root, x, y); root = erase_node(root, x, y);
} }
uint32_t count() { uint32_t count() { return subtree_size(root); }
std::shared_lock lock(mtx);
return subtree_size(root);
}
~LineTree() { clear(); } ~LineTree() { clear(); }
private: private:
@@ -117,7 +105,6 @@ private:
LineNode *root = nullptr; LineNode *root = nullptr;
Frame stack[32]; Frame stack[32];
std::atomic<uint8_t> stack_size = 0; std::atomic<uint8_t> stack_size = 0;
std::shared_mutex mtx;
static constexpr uint32_t LEAF_TARGET = 256; static constexpr uint32_t LEAF_TARGET = 256;
LineTree::LineNode *erase_node(LineNode *n, uint32_t x, uint32_t y) { LineTree::LineNode *erase_node(LineNode *n, uint32_t x, uint32_t y) {
if (!n || y == 0) if (!n || y == 0)

View File

@@ -1,7 +1,7 @@
#ifndef SYNTAX_PARSER_H #ifndef SYNTAX_PARSER_H
#define SYNTAX_PARSER_H #define SYNTAX_PARSER_H
#include "scripting/decl.h" #include "ruby/decl.h"
#include "syntax/decl.h" #include "syntax/decl.h"
#include "syntax/line_tree.h" #include "syntax/line_tree.h"
@@ -14,18 +14,16 @@ struct Parser {
uint32_t line_num); uint32_t line_num);
bool (*state_match_func)(std::shared_ptr<void> state_1, bool (*state_match_func)(std::shared_ptr<void> state_1,
std::shared_ptr<void> state_2); std::shared_ptr<void> state_2);
VALUE parser_block = Qnil; mrb_value parser_block = mrb_nil_value();
VALUE match_block = Qnil; mrb_value match_block = mrb_nil_value();
bool is_custom{false}; bool is_custom{false};
std::atomic<uint32_t> scroll_max{UINT32_MAX - 2048}; std::atomic<uint32_t> scroll_max{0};
std::atomic<bool> scroll_dirty{false}; std::atomic<bool> scroll_dirty{false};
std::mutex mutex;
std::mutex data_mutex;
LineTree line_tree; LineTree line_tree;
UniqueQueue<uint32_t> dirty_lines; UniqueQueue<uint32_t> dirty_lines;
Parser(Editor *editor, std::string n_lang, uint32_t n_scroll_max); Parser(Editor *editor, std::string n_lang, uint32_t n_scroll_max);
void edit(uint32_t start_line, uint32_t old_end_line, uint32_t inserted_rows); void edit(uint32_t start_line, uint32_t removed_rows, uint32_t inserted_rows);
void work(); void work();
void scroll(uint32_t line); void scroll(uint32_t line);
}; };

10
include/tiling/decl.h Normal file
View File

@@ -0,0 +1,10 @@
#ifndef TILING_DECL_H
#define TILING_DECL_H
#include "utils/utils.h"
struct Window {};
struct TileBlock {};
#endif

View File

@@ -8,9 +8,10 @@
struct Bar { struct Bar {
Coord screen; Coord screen;
std::string command = ""; std::string command = "";
std::string log_line = "";
uint32_t cursor = 0; uint32_t cursor = 0;
Bar(Coord screen) : screen(screen) {} void init(Coord screen) { this->screen = screen; }
void render(); void render();
void handle(KeyEvent event); void handle(KeyEvent event);
void log(std::string message); void log(std::string message);

View File

@@ -102,7 +102,6 @@ struct Language {
std::string name; std::string name;
std::string lsp_name; std::string lsp_name;
uint32_t color; uint32_t color;
std::string symbol;
}; };
struct LSP { struct LSP {
@@ -112,7 +111,6 @@ struct LSP {
extern std::unordered_map<std::string, Language> languages; extern std::unordered_map<std::string, Language> languages;
extern std::unordered_map<std::string, std::string> language_extensions; extern std::unordered_map<std::string, std::string> language_extensions;
extern std::unordered_map<std::string, std::string> language_mimetypes;
extern std::unordered_map<std::string, LSP> lsps; extern std::unordered_map<std::string, LSP> lsps;
#define MAX(a, b) ((a) > (b) ? (a) : (b)) #define MAX(a, b) ((a) > (b) ? (a) : (b))
@@ -155,12 +153,8 @@ std::string path_to_file_uri(const std::string &path_str);
std::string filename_from_path(const std::string &path); std::string filename_from_path(const std::string &path);
std::string get_exe_dir(); std::string get_exe_dir();
char *load_file(const char *path, uint32_t *out_len, bool *out_eol); char *load_file(const char *path, uint32_t *out_len, bool *out_eol);
char *detect_file_type(const char *filename);
Language language_for_file(const char *filename); Language language_for_file(const char *filename);
void copy_to_clipboard(const char *text, size_t len);
char *get_from_clipboard(uint32_t *out_len);
template <typename T> template <typename T>
inline T *safe_get(std::map<uint16_t, T> &m, uint16_t key) { inline T *safe_get(std::map<uint16_t, T> &m, uint16_t key) {
auto it = m.find(key); auto it = m.find(key);

View File

@@ -4,60 +4,9 @@ set -eu
install() { install() {
BINARY_NAME="crib" BINARY_NAME="crib"
VERSION="v0.0.1-alpha" BIN_URL="https://git.syedm.dev/SyedM/crib/releases/download/v0.0.5-alpha/crib"
RUBY_VERSION="3.4"
HAVE_34=0
HAVE_32=0
if ldconfig -p | grep -q libruby.so.3.4; then echo "Install or update locally (~/.local/bin) or globally (/usr/bin)? [l/g]"
HAVE_34=1
fi
if ldconfig -p | grep -q libruby-3.2.so; then
HAVE_32=1
fi
if [ "$HAVE_34" = "1" ] && [ "$HAVE_32" = "1" ]; then
echo "Multiple Ruby versions detected."
echo "Select Ruby ABI:"
echo " 1) Ruby 3.4"
echo " 2) Ruby 3.2"
read -r choice </dev/tty
case "$choice" in
1) RUBY_VERSION="3.4" ;;
2) RUBY_VERSION="3.2" ;;
*)
echo "Invalid choice"
exit 1
;;
esac
elif [ "$HAVE_34" = "1" ]; then
RUBY_VERSION="3.4"
elif [ "$HAVE_32" = "1" ]; then
RUBY_VERSION="3.2"
else
echo "No compatible Ruby library found need Ruby 3.2 or 3.4."
exit 1
fi
GITHUB_URL="https://github.com/SyedM-dev/crib/releases/download/$VERSION/crib-linux-x86_64-ruby$RUBY_VERSION"
missing_ruby=""
missing_magic=""
command -v ruby >/dev/null 2>&1 || missing_ruby="ruby"
ldconfig -p | grep libmagic >/dev/null 2>&1 || missing_magic="libmagic"
if [ -n "$missing_ruby" ] || [ -n "$missing_magic" ]; then
echo "Missing dependencies: ${missing_ruby} ${missing_magic}"
echo "Install them using your package manager:"
echo "Ubuntu/Debian: sudo apt install ruby libmagic1"
echo "Arch: sudo pacman -S ruby file"
echo "Void: sudo xbps-install -Sy ruby file"
exit 1
fi
echo "Installing Crib (Ruby $RUBY_VERSION)"
echo "Install locally (~/.local/bin) or globally (/usr/bin)? [l/g]"
read -r choice </dev/tty read -r choice </dev/tty
case "$choice" in case "$choice" in
l | L) l | L)
@@ -77,14 +26,13 @@ install() {
$SUDO mkdir -p "$INSTALL_DIR" $SUDO mkdir -p "$INSTALL_DIR"
echo "Downloading binary..." echo "Downloading binary..."
curl -L "$GITHUB_URL" -o /tmp/"$BINARY_NAME" curl -L "$BIN_URL" -o /tmp/"$BINARY_NAME"
$SUDO install -m 755 /tmp/"$BINARY_NAME" "$INSTALL_DIR/$BINARY_NAME" $SUDO install -m 755 /tmp/"$BINARY_NAME" "$INSTALL_DIR/$BINARY_NAME"
rm -f /tmp/"$BINARY_NAME" rm -f /tmp/"$BINARY_NAME"
echo echo
echo "✔ Crib installed to $INSTALL_DIR" echo "✔ Crib installed to $INSTALL_DIR"
echo "Run with: $BINARY_NAME" echo "Run with: $BINARY_NAME"
echo "Ruby ABI: $RUBY_VERSION"
echo "Add $INSTALL_DIR to PATH if needed." echo "Add $INSTALL_DIR to PATH if needed."
} }

Binary file not shown.

40
libs/libruby/ruby.h vendored
View File

@@ -1,40 +0,0 @@
#ifndef RUBY_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY_H 1
/**
* @author $Author$
* @date Sun 10 12:06:15 Jun JST 2007
* @copyright 2007-2008 Yukihiro Matsumoto
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
*/
#define HAVE_RUBY_ATOMIC_H 1
#define HAVE_RUBY_DEBUG_H 1
#define HAVE_RUBY_DEFINES_H 1
#define HAVE_RUBY_ENCODING_H 1
#define HAVE_RUBY_FIBER_SCHEDULER_H 1
#define HAVE_RUBY_INTERN_H 1
#define HAVE_RUBY_IO_H 1
#define HAVE_RUBY_MEMORY_VIEW_H 1
#define HAVE_RUBY_MISSING_H 1
#define HAVE_RUBY_ONIGMO_H 1
#define HAVE_RUBY_ONIGURUMA_H 1
#define HAVE_RUBY_RACTOR_H 1
#define HAVE_RUBY_RANDOM_H 1
#define HAVE_RUBY_RE_H 1
#define HAVE_RUBY_REGEX_H 1
#define HAVE_RUBY_RUBY_H 1
#define HAVE_RUBY_ST_H 1
#define HAVE_RUBY_THREAD_H 1
#define HAVE_RUBY_THREAD_NATIVE_H 1
#define HAVE_RUBY_UTIL_H 1
#define HAVE_RUBY_VERSION_H 1
#define HAVE_RUBY_VM_H 1
#ifdef _WIN32
#define HAVE_RUBY_WIN32_H 1
#endif
#include "ruby/ruby.h"
#endif /* RUBY_H */

View File

@@ -1,234 +0,0 @@
#ifndef RUBY_ASSERT_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY_ASSERT_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @date Wed May 18 00:21:44 JST 1994
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
*/
#include "ruby/internal/assume.h"
#include "ruby/internal/attr/cold.h"
#include "ruby/internal/attr/noreturn.h"
#include "ruby/internal/cast.h"
#include "ruby/internal/dllexport.h"
#include "ruby/backward/2/assume.h"
/* RUBY_NDEBUG is very simple: after everything described below are done,
* define it with either NDEBUG is undefined (=0) or defined (=1). It is truly
* subordinate.
*
* RUBY_DEBUG versus NDEBUG is complicated. Assertions shall be:
*
* | -UNDEBUG | -DNDEBUG
* ---------------+----------+---------
* -URUBY_DEBUG | (*1) | disabled
* -DRUBY_DEBUG=0 | disabled | disabled
* -DRUBY_DEBUG=1 | enabled | (*2)
* -DRUBY_DEBUG | enabled | (*2)
*
* where:
*
* - (*1): Assertions shall be silently disabled, no warnings, in favour of
* commit 21991e6ca59274e41a472b5256bd3245f6596c90.
*
* - (*2): Compile-time warnings shall be issued.
*/
/** @cond INTERNAL_MACRO */
/*
* Pro tip: `!!RUBY_DEBUG-1` expands to...
*
* - `!!(-1)` (== `!0` == `1`) when RUBY_DEBUG is defined to be empty,
* - `(!!0)-1` (== `0-1` == `-1`) when RUBY_DEBUG is defined as 0, and
* - `(!!n)-1` (== `1-1` == `0`) when RUBY_DEBUG is defined as something else.
*/
#if ! defined(RUBY_DEBUG)
# define RBIMPL_RUBY_DEBUG 0
#elif !!RUBY_DEBUG-1 < 0
# define RBIMPL_RUBY_DEBUG 0
#else
# define RBIMPL_RUBY_DEBUG 1
#endif
/*
* ISO/IEC 9899 (all past versions) says that "If NDEBUG is defined as a macro
* name at the point in the source file where <assert.h> is included, ..."
* which means we must not take its defined value into account.
*/
#if defined(NDEBUG)
# define RBIMPL_NDEBUG 1
#else
# define RBIMPL_NDEBUG 0
#endif
/** @endcond */
/* Here we go... */
#undef RUBY_DEBUG
#undef RUBY_NDEBUG
#undef NDEBUG
#if defined(__DOXYGEN__)
# /** Define this macro when you want assertions. */
# define RUBY_DEBUG 0
# /** Define this macro when you don't want assertions. */
# define NDEBUG
# /** This macro is basically the same as #NDEBUG */
# define RUBY_NDEBUG 1
#elif (RBIMPL_NDEBUG == 1) && (RBIMPL_RUBY_DEBUG == 0)
# /* Assertions disabled as per request, no conflicts. */
# define RUBY_DEBUG 0
# define RUBY_NDEBUG 1
# define NDEBUG
#elif (RBIMPL_NDEBUG == 0) && (RBIMPL_RUBY_DEBUG == 1)
# /* Assertions enabled as per request, no conflicts. */
# define RUBY_DEBUG 1
# define RUBY_NDEBUG 0
# /* keep NDEBUG undefined */
#elif (RBIMPL_NDEBUG == 0) && (RBIMPL_RUBY_DEBUG == 0)
# /* The (*1) situation in above diagram. */
# define RUBY_DEBUG 0
# define RUBY_NDEBUG 1
# define NDEBUG
#elif (RBIMPL_NDEBUG == 1) && (RBIMPL_RUBY_DEBUG == 1)
# /* The (*2) situation in above diagram. */
# define RUBY_DEBUG 1
# define RUBY_NDEBUG 0
# /* keep NDEBUG undefined */
# if defined(_MSC_VER)
# pragma message("NDEBUG is ignored because RUBY_DEBUG>0.")
# elif defined(__GNUC__)
# pragma GCC warning "NDEBUG is ignored because RUBY_DEBUG>0."
# else
# error NDEBUG is ignored because RUBY_DEBUG>0.
# endif
#endif
#undef RBIMPL_NDEBUG
#undef RBIMPL_RUBY_DEBUG
/** @cond INTERNAL_MACRO */
#define RBIMPL_ASSERT_NOTHING RBIMPL_CAST((void)0)
RBIMPL_SYMBOL_EXPORT_BEGIN()
RBIMPL_ATTR_NORETURN()
RBIMPL_ATTR_COLD()
void rb_assert_failure(const char *file, int line, const char *name, const char *expr);
RBIMPL_SYMBOL_EXPORT_END()
#ifdef RUBY_FUNCTION_NAME_STRING
# define RBIMPL_ASSERT_FUNC RUBY_FUNCTION_NAME_STRING
#else
# define RBIMPL_ASSERT_FUNC RBIMPL_CAST((const char *)0)
#endif
/** @endcond */
/**
* Prints the given message, and terminates the entire process abnormally.
*
* @param mesg The message to display.
*/
#define RUBY_ASSERT_FAIL(mesg) \
rb_assert_failure(__FILE__, __LINE__, RBIMPL_ASSERT_FUNC, mesg)
/**
* Asserts that the expression is truthy. If not aborts with the message.
*
* @param expr What supposedly evaluates to true.
* @param mesg The message to display on failure.
*/
#define RUBY_ASSERT_MESG(expr, mesg) \
(RB_LIKELY(expr) ? RBIMPL_ASSERT_NOTHING : RUBY_ASSERT_FAIL(mesg))
/**
* A variant of #RUBY_ASSERT that does not interface with #RUBY_DEBUG.
*
* @copydetails #RUBY_ASSERT
*/
#define RUBY_ASSERT_ALWAYS(expr) RUBY_ASSERT_MESG((expr), #expr)
/**
* Asserts that the given expression is truthy if and only if #RUBY_DEBUG is truthy.
*
* @param expr What supposedly evaluates to true.
*/
#if RUBY_DEBUG
# define RUBY_ASSERT(expr) RUBY_ASSERT_MESG((expr), #expr)
#else
# define RUBY_ASSERT(expr) RBIMPL_ASSERT_NOTHING
#endif
/**
* A variant of #RUBY_ASSERT that interfaces with #NDEBUG instead of
* #RUBY_DEBUG. This almost resembles `assert` C standard macro, except minor
* implementation details.
*
* @copydetails #RUBY_ASSERT
*/
/* Currently `RUBY_DEBUG == ! defined(NDEBUG)` is always true. There is no
* difference any longer between this one and `RUBY_ASSERT`. */
#if defined(NDEBUG)
# define RUBY_ASSERT_NDEBUG(expr) RBIMPL_ASSERT_NOTHING
#else
# define RUBY_ASSERT_NDEBUG(expr) RUBY_ASSERT_MESG((expr), #expr)
#endif
/**
* @copydoc #RUBY_ASSERT_WHEN
* @param mesg The message to display on failure.
*/
#if RUBY_DEBUG
# define RUBY_ASSERT_MESG_WHEN(cond, expr, mesg) RUBY_ASSERT_MESG((expr), (mesg))
#else
# define RUBY_ASSERT_MESG_WHEN(cond, expr, mesg) \
((cond) ? RUBY_ASSERT_MESG((expr), (mesg)) : RBIMPL_ASSERT_NOTHING)
#endif
/**
* A variant of #RUBY_ASSERT that asserts when either #RUBY_DEBUG or `cond`
* parameter is truthy.
*
* @param cond Extra condition that shall hold for assertion to take effect.
* @param expr What supposedly evaluates to true.
*/
#define RUBY_ASSERT_WHEN(cond, expr) RUBY_ASSERT_MESG_WHEN((cond), (expr), #expr)
/**
* This is either #RUBY_ASSERT or #RBIMPL_ASSUME, depending on #RUBY_DEBUG.
*
* @copydetails #RUBY_ASSERT
*/
#if RUBY_DEBUG
# define RBIMPL_ASSERT_OR_ASSUME(expr) RUBY_ASSERT_ALWAYS(expr)
#elif RBIMPL_COMPILER_BEFORE(Clang, 7, 0, 0)
# /* See commit 67d259c5dccd31fe49d417fec169977712ffdf10 */
# define RBIMPL_ASSERT_OR_ASSUME(expr) RBIMPL_ASSERT_NOTHING
#elif defined(RUBY_ASSERT_NOASSUME)
# /* See commit d300a734414ef6de7e8eb563b7cc4389c455ed08 */
# define RBIMPL_ASSERT_OR_ASSUME(expr) RBIMPL_ASSERT_NOTHING
#elif ! defined(RBIMPL_HAVE___ASSUME)
# define RBIMPL_ASSERT_OR_ASSUME(expr) RBIMPL_ASSERT_NOTHING
#else
# define RBIMPL_ASSERT_OR_ASSUME(expr) RBIMPL_ASSUME(expr)
#endif
#endif /* RUBY_ASSERT_H */

View File

@@ -1,890 +0,0 @@
#ifndef RUBY_ATOMIC_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY_ATOMIC_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Atomic operations
*
* Basically, if we could assume either C11 or C++11, these macros are just
* redundant. Sadly we cannot. We have to do them ourselves.
*/
#include "ruby/internal/config.h"
#ifdef STDC_HEADERS
# include <stddef.h> /* size_t */
#endif
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h> /* ssize_t */
#endif
#if RBIMPL_COMPILER_SINCE(MSVC, 13, 0, 0)
# pragma intrinsic(_InterlockedOr)
#elif defined(__sun) && defined(HAVE_ATOMIC_H)
# include <atomic.h>
#endif
#include "ruby/assert.h"
#include "ruby/backward/2/limits.h"
#include "ruby/internal/attr/artificial.h"
#include "ruby/internal/attr/noalias.h"
#include "ruby/internal/attr/nonnull.h"
#include "ruby/internal/compiler_since.h"
#include "ruby/internal/cast.h"
#include "ruby/internal/value.h"
#include "ruby/internal/static_assert.h"
#include "ruby/internal/stdbool.h"
/*
* Asserts that your environment supports more than one atomic types. These
* days systems tend to have such property (C11 was a standard of decades ago,
* right?) but we still support older ones.
*/
#if defined(__DOXYGEN__) || defined(HAVE_GCC_ATOMIC_BUILTINS) || defined(HAVE_GCC_SYNC_BUILTINS)
# define RUBY_ATOMIC_GENERIC_MACRO 1
#endif
/**
* Type that is eligible for atomic operations. Depending on your host
* platform you might have more than one such type, but we choose one of them
* anyways.
*/
#if defined(__DOXYGEN__)
using rb_atomic_t = std::atomic<unsigned>;
#elif defined(HAVE_GCC_ATOMIC_BUILTINS)
typedef unsigned int rb_atomic_t;
#elif defined(HAVE_GCC_SYNC_BUILTINS)
typedef unsigned int rb_atomic_t;
#elif defined(_WIN32)
typedef LONG rb_atomic_t;
#elif defined(__sun) && defined(HAVE_ATOMIC_H)
typedef unsigned int rb_atomic_t;
#else
# error No atomic operation found
#endif
/**
* Atomically replaces the value pointed by `var` with the result of addition
* of `val` to the old value of `var`.
*
* @param var A variable of ::rb_atomic_t.
* @param val Value to add.
* @return What was stored in `var` before the addition.
* @post `var` holds `var + val`.
*/
#define RUBY_ATOMIC_FETCH_ADD(var, val) rbimpl_atomic_fetch_add(&(var), (val))
/**
* Atomically replaces the value pointed by `var` with the result of
* subtraction of `val` to the old value of `var`.
*
* @param var A variable of ::rb_atomic_t.
* @param val Value to subtract.
* @return What was stored in `var` before the subtraction.
* @post `var` holds `var - val`.
*/
#define RUBY_ATOMIC_FETCH_SUB(var, val) rbimpl_atomic_fetch_sub(&(var), (val))
/**
* Atomically replaces the value pointed by `var` with the result of
* bitwise OR between `val` and the old value of `var`.
*
* @param var A variable of ::rb_atomic_t.
* @param val Value to mix.
* @return void
* @post `var` holds `var | val`.
* @note For portability, this macro can return void.
*/
#define RUBY_ATOMIC_OR(var, val) rbimpl_atomic_or(&(var), (val))
/**
* Atomically replaces the value pointed by `var` with `val`. This is just an
* assignment, but you can additionally know the previous value.
*
* @param var A variable of ::rb_atomic_t.
* @param val Value to set.
* @return What was stored in `var` before the assignment.
* @post `var` holds `val`.
*/
#define RUBY_ATOMIC_EXCHANGE(var, val) rbimpl_atomic_exchange(&(var), (val))
/**
* Atomic compare-and-swap. This stores `val` to `var` if and only if the
* assignment changes the value of `var` from `oldval` to `newval`. You can
* detect whether the assignment happened or not using the return value.
*
* @param var A variable of ::rb_atomic_t.
* @param oldval Expected value of `var` before the assignment.
* @param newval What you want to store at `var`.
* @retval oldval Successful assignment (`var` is now `newval`).
* @retval otherwise Something else is at `var`; not updated.
*/
#define RUBY_ATOMIC_CAS(var, oldval, newval) \
rbimpl_atomic_cas(&(var), (oldval), (newval))
/**
* Identical to #RUBY_ATOMIC_EXCHANGE, except for the return type.
*
* @param var A variable of ::rb_atomic_t.
* @param val Value to set.
* @return void
* @post `var` holds `val`.
*/
#define RUBY_ATOMIC_SET(var, val) rbimpl_atomic_set(&(var), (val))
/**
* Identical to #RUBY_ATOMIC_FETCH_ADD, except for the return type.
*
* @param var A variable of ::rb_atomic_t.
* @param val Value to add.
* @return void
* @post `var` holds `var + val`.
*/
#define RUBY_ATOMIC_ADD(var, val) rbimpl_atomic_add(&(var), (val))
/**
* Identical to #RUBY_ATOMIC_FETCH_SUB, except for the return type.
*
* @param var A variable of ::rb_atomic_t.
* @param val Value to subtract.
* @return void
* @post `var` holds `var - val`.
*/
#define RUBY_ATOMIC_SUB(var, val) rbimpl_atomic_sub(&(var), (val))
/**
* Atomically increments the value pointed by `var`.
*
* @param var A variable of ::rb_atomic_t.
* @return void
* @post `var` holds `var + 1`.
*/
#define RUBY_ATOMIC_INC(var) rbimpl_atomic_inc(&(var))
/**
* Atomically decrements the value pointed by `var`.
*
* @param var A variable of ::rb_atomic_t.
* @return void
* @post `var` holds `var - 1`.
*/
#define RUBY_ATOMIC_DEC(var) rbimpl_atomic_dec(&(var))
/**
* Identical to #RUBY_ATOMIC_INC, except it expects its argument is `size_t`.
* There are cases where ::rb_atomic_t is 32bit while `size_t` is 64bit. This
* should be used for size related operations to support such platforms.
*
* @param var A variable of `size_t`.
* @return void
* @post `var` holds `var + 1`.
*/
#define RUBY_ATOMIC_SIZE_INC(var) rbimpl_atomic_size_inc(&(var))
/**
* Identical to #RUBY_ATOMIC_DEC, except it expects its argument is `size_t`.
* There are cases where ::rb_atomic_t is 32bit while `size_t` is 64bit. This
* should be used for size related operations to support such platforms.
*
* @param var A variable of `size_t`.
* @return void
* @post `var` holds `var - 1`.
*/
#define RUBY_ATOMIC_SIZE_DEC(var) rbimpl_atomic_size_dec(&(var))
/**
* Identical to #RUBY_ATOMIC_EXCHANGE, except it expects its arguments are
* `size_t`. There are cases where ::rb_atomic_t is 32bit while `size_t` is
* 64bit. This should be used for size related operations to support such
* platforms.
*
* @param var A variable of `size_t`.
* @param val Value to set.
* @return What was stored in `var` before the assignment.
* @post `var` holds `val`.
*/
#define RUBY_ATOMIC_SIZE_EXCHANGE(var, val) \
rbimpl_atomic_size_exchange(&(var), (val))
/**
* Identical to #RUBY_ATOMIC_CAS, except it expects its arguments are `size_t`.
* There are cases where ::rb_atomic_t is 32bit while `size_t` is 64bit. This
* should be used for size related operations to support such platforms.
*
* @param var A variable of `size_t`.
* @param oldval Expected value of `var` before the assignment.
* @param newval What you want to store at `var`.
* @retval oldval Successful assignment (`var` is now `newval`).
* @retval otherwise Something else is at `var`; not updated.
*/
#define RUBY_ATOMIC_SIZE_CAS(var, oldval, newval) \
rbimpl_atomic_size_cas(&(var), (oldval), (newval))
/**
* Identical to #RUBY_ATOMIC_ADD, except it expects its arguments are `size_t`.
* There are cases where ::rb_atomic_t is 32bit while `size_t` is 64bit. This
* should be used for size related operations to support such platforms.
*
* @param var A variable of `size_t`.
* @param val Value to add.
* @return void
* @post `var` holds `var + val`.
*/
#define RUBY_ATOMIC_SIZE_ADD(var, val) rbimpl_atomic_size_add(&(var), (val))
/**
* Identical to #RUBY_ATOMIC_SUB, except it expects its arguments are `size_t`.
* There are cases where ::rb_atomic_t is 32bit while `size_t` is 64bit. This
* should be used for size related operations to support such platforms.
*
* @param var A variable of `size_t`.
* @param val Value to subtract.
* @return void
* @post `var` holds `var - val`.
*/
#define RUBY_ATOMIC_SIZE_SUB(var, val) rbimpl_atomic_size_sub(&(var), (val))
/**
* Identical to #RUBY_ATOMIC_EXCHANGE, except it expects its arguments are
* `void*`. There are cases where ::rb_atomic_t is 32bit while `void*` is
* 64bit. This should be used for pointer related operations to support such
* platforms.
*
* @param var A variable of `void *`.
* @param val Value to set.
* @return What was stored in `var` before the assignment.
* @post `var` holds `val`.
*
* @internal
*
* :FIXME: this `(void*)` cast is evil! However `void*` is incompatible with
* some pointers, most notably function pointers.
*/
#define RUBY_ATOMIC_PTR_EXCHANGE(var, val) \
RBIMPL_CAST(rbimpl_atomic_ptr_exchange((void **)&(var), (void *)val))
/**
* Identical to #RUBY_ATOMIC_CAS, except it expects its arguments are `void*`.
* There are cases where ::rb_atomic_t is 32bit while `void*` is 64bit. This
* should be used for size related operations to support such platforms.
*
* @param var A variable of `void*`.
* @param oldval Expected value of `var` before the assignment.
* @param newval What you want to store at `var`.
* @retval oldval Successful assignment (`var` is now `newval`).
* @retval otherwise Something else is at `var`; not updated.
*/
#define RUBY_ATOMIC_PTR_CAS(var, oldval, newval) \
RBIMPL_CAST(rbimpl_atomic_ptr_cas((void **)&(var), (oldval), (newval)))
/**
* Identical to #RUBY_ATOMIC_EXCHANGE, except it expects its arguments are
* ::VALUE. There are cases where ::rb_atomic_t is 32bit while ::VALUE is
* 64bit. This should be used for pointer related operations to support such
* platforms.
*
* @param var A variable of ::VALUE.
* @param val Value to set.
* @return What was stored in `var` before the assignment.
* @post `var` holds `val`.
*/
#define RUBY_ATOMIC_VALUE_EXCHANGE(var, val) \
rbimpl_atomic_value_exchange(&(var), (val))
/**
* Identical to #RUBY_ATOMIC_CAS, except it expects its arguments are ::VALUE.
* There are cases where ::rb_atomic_t is 32bit while ::VALUE is 64bit. This
* should be used for size related operations to support such platforms.
*
* @param var A variable of `void*`.
* @param oldval Expected value of `var` before the assignment.
* @param newval What you want to store at `var`.
* @retval oldval Successful assignment (`var` is now `newval`).
* @retval otherwise Something else is at `var`; not updated.
*/
#define RUBY_ATOMIC_VALUE_CAS(var, oldval, newval) \
rbimpl_atomic_value_cas(&(var), (oldval), (newval))
/** @cond INTERNAL_MACRO */
RBIMPL_ATTR_ARTIFICIAL()
RBIMPL_ATTR_NOALIAS()
RBIMPL_ATTR_NONNULL((1))
static inline rb_atomic_t
rbimpl_atomic_fetch_add(volatile rb_atomic_t *ptr, rb_atomic_t val)
{
#if 0
#elif defined(HAVE_GCC_ATOMIC_BUILTINS)
return __atomic_fetch_add(ptr, val, __ATOMIC_SEQ_CST);
#elif defined(HAVE_GCC_SYNC_BUILTINS)
return __sync_fetch_and_add(ptr, val);
#elif defined(_WIN32)
return InterlockedExchangeAdd(ptr, val);
#elif defined(__sun) && defined(HAVE_ATOMIC_H)
/*
* `atomic_add_int_nv` takes its second argument as `int`! Meanwhile our
* `rb_atomic_t` is unsigned. We cannot pass `val` as-is. We have to
* manually check integer overflow.
*/
RBIMPL_ASSERT_OR_ASSUME(val <= INT_MAX);
return atomic_add_int_nv(ptr, val) - val;
#else
# error Unsupported platform.
#endif
}
RBIMPL_ATTR_ARTIFICIAL()
RBIMPL_ATTR_NOALIAS()
RBIMPL_ATTR_NONNULL((1))
static inline void
rbimpl_atomic_add(volatile rb_atomic_t *ptr, rb_atomic_t val)
{
#if 0
#elif defined(HAVE_GCC_ATOMIC_BUILTINS)
/*
* GCC on amd64 is smart enough to detect this `__atomic_add_fetch`'s
* return value is not used, then compiles it into single `LOCK ADD`
* instruction.
*/
__atomic_add_fetch(ptr, val, __ATOMIC_SEQ_CST);
#elif defined(HAVE_GCC_SYNC_BUILTINS)
__sync_add_and_fetch(ptr, val);
#elif defined(_WIN32)
/*
* `InterlockedExchangeAdd` is `LOCK XADD`. It seems there also is
* `_InterlockedAdd` intrinsic in ARM Windows but not for x86? Sticking to
* `InterlockedExchangeAdd` for better portability.
*/
InterlockedExchangeAdd(ptr, val);
#elif defined(__sun) && defined(HAVE_ATOMIC_H)
/* Ditto for `atomic_add_int_nv`. */
RBIMPL_ASSERT_OR_ASSUME(val <= INT_MAX);
atomic_add_int(ptr, val);
#else
# error Unsupported platform.
#endif
}
RBIMPL_ATTR_ARTIFICIAL()
RBIMPL_ATTR_NOALIAS()
RBIMPL_ATTR_NONNULL((1))
static inline void
rbimpl_atomic_size_add(volatile size_t *ptr, size_t val)
{
#if 0
#elif defined(HAVE_GCC_ATOMIC_BUILTINS)
__atomic_add_fetch(ptr, val, __ATOMIC_SEQ_CST);
#elif defined(HAVE_GCC_SYNC_BUILTINS)
__sync_add_and_fetch(ptr, val);
#elif defined(_WIN32) && defined(_M_AMD64)
/* Ditto for `InterlockeExchangedAdd`. */
InterlockedExchangeAdd64(ptr, val);
#elif defined(__sun) && defined(HAVE_ATOMIC_H) && (defined(_LP64) || defined(_I32LPx))
/* Ditto for `atomic_add_int_nv`. */
RBIMPL_ASSERT_OR_ASSUME(val <= LONG_MAX);
atomic_add_long(ptr, val);
#else
RBIMPL_STATIC_ASSERT(size_of_rb_atomic_t, sizeof *ptr == sizeof(rb_atomic_t));
volatile rb_atomic_t *const tmp = RBIMPL_CAST((volatile rb_atomic_t *)ptr);
rbimpl_atomic_add(tmp, val);
#endif
}
RBIMPL_ATTR_ARTIFICIAL()
RBIMPL_ATTR_NOALIAS()
RBIMPL_ATTR_NONNULL((1))
static inline void
rbimpl_atomic_inc(volatile rb_atomic_t *ptr)
{
#if 0
#elif defined(HAVE_GCC_ATOMIC_BUILTINS) || defined(HAVE_GCC_SYNC_BUILTINS)
rbimpl_atomic_add(ptr, 1);
#elif defined(_WIN32)
InterlockedIncrement(ptr);
#elif defined(__sun) && defined(HAVE_ATOMIC_H)
atomic_inc_uint(ptr);
#else
rbimpl_atomic_add(ptr, 1);
#endif
}
RBIMPL_ATTR_ARTIFICIAL()
RBIMPL_ATTR_NOALIAS()
RBIMPL_ATTR_NONNULL((1))
static inline void
rbimpl_atomic_size_inc(volatile size_t *ptr)
{
#if 0
#elif defined(HAVE_GCC_ATOMIC_BUILTINS) || defined(HAVE_GCC_SYNC_BUILTINS)
rbimpl_atomic_size_add(ptr, 1);
#elif defined(_WIN32) && defined(_M_AMD64)
InterlockedIncrement64(ptr);
#elif defined(__sun) && defined(HAVE_ATOMIC_H) && (defined(_LP64) || defined(_I32LPx))
atomic_inc_ulong(ptr);
#else
rbimpl_atomic_size_add(ptr, 1);
#endif
}
RBIMPL_ATTR_ARTIFICIAL()
RBIMPL_ATTR_NOALIAS()
RBIMPL_ATTR_NONNULL((1))
static inline rb_atomic_t
rbimpl_atomic_fetch_sub(volatile rb_atomic_t *ptr, rb_atomic_t val)
{
#if 0
#elif defined(HAVE_GCC_ATOMIC_BUILTINS)
return __atomic_fetch_sub(ptr, val, __ATOMIC_SEQ_CST);
#elif defined(HAVE_GCC_SYNC_BUILTINS)
return __sync_fetch_and_sub(ptr, val);
#elif defined(_WIN32)
/* rb_atomic_t is signed here! Safe to do `-val`. */
return InterlockedExchangeAdd(ptr, -val);
#elif defined(__sun) && defined(HAVE_ATOMIC_H)
/* Ditto for `rbimpl_atomic_fetch_add`. */
const signed neg = -1;
RBIMPL_ASSERT_OR_ASSUME(val <= INT_MAX);
return atomic_add_int_nv(ptr, neg * val) + val;
#else
# error Unsupported platform.
#endif
}
RBIMPL_ATTR_ARTIFICIAL()
RBIMPL_ATTR_NOALIAS()
RBIMPL_ATTR_NONNULL((1))
static inline void
rbimpl_atomic_sub(volatile rb_atomic_t *ptr, rb_atomic_t val)
{
#if 0
#elif defined(HAVE_GCC_ATOMIC_BUILTINS)
__atomic_sub_fetch(ptr, val, __ATOMIC_SEQ_CST);
#elif defined(HAVE_GCC_SYNC_BUILTINS)
__sync_sub_and_fetch(ptr, val);
#elif defined(_WIN32)
InterlockedExchangeAdd(ptr, -val);
#elif defined(__sun) && defined(HAVE_ATOMIC_H)
const signed neg = -1;
RBIMPL_ASSERT_OR_ASSUME(val <= INT_MAX);
atomic_add_int(ptr, neg * val);
#else
# error Unsupported platform.
#endif
}
RBIMPL_ATTR_ARTIFICIAL()
RBIMPL_ATTR_NOALIAS()
RBIMPL_ATTR_NONNULL((1))
static inline void
rbimpl_atomic_size_sub(volatile size_t *ptr, size_t val)
{
#if 0
#elif defined(HAVE_GCC_ATOMIC_BUILTINS)
__atomic_sub_fetch(ptr, val, __ATOMIC_SEQ_CST);
#elif defined(HAVE_GCC_SYNC_BUILTINS)
__sync_sub_and_fetch(ptr, val);
#elif defined(_WIN32) && defined(_M_AMD64)
const ssize_t neg = -1;
InterlockedExchangeAdd64(ptr, neg * val);
#elif defined(__sun) && defined(HAVE_ATOMIC_H) && (defined(_LP64) || defined(_I32LPx))
const signed neg = -1;
RBIMPL_ASSERT_OR_ASSUME(val <= LONG_MAX);
atomic_add_long(ptr, neg * val);
#else
RBIMPL_STATIC_ASSERT(size_of_rb_atomic_t, sizeof *ptr == sizeof(rb_atomic_t));
volatile rb_atomic_t *const tmp = RBIMPL_CAST((volatile rb_atomic_t *)ptr);
rbimpl_atomic_sub(tmp, val);
#endif
}
RBIMPL_ATTR_ARTIFICIAL()
RBIMPL_ATTR_NOALIAS()
RBIMPL_ATTR_NONNULL((1))
static inline void
rbimpl_atomic_dec(volatile rb_atomic_t *ptr)
{
#if 0
#elif defined(HAVE_GCC_ATOMIC_BUILTINS) || defined(HAVE_GCC_SYNC_BUILTINS)
rbimpl_atomic_sub(ptr, 1);
#elif defined(_WIN32)
InterlockedDecrement(ptr);
#elif defined(__sun) && defined(HAVE_ATOMIC_H)
atomic_dec_uint(ptr);
#else
rbimpl_atomic_sub(ptr, 1);
#endif
}
RBIMPL_ATTR_ARTIFICIAL()
RBIMPL_ATTR_NOALIAS()
RBIMPL_ATTR_NONNULL((1))
static inline void
rbimpl_atomic_size_dec(volatile size_t *ptr)
{
#if 0
#elif defined(HAVE_GCC_ATOMIC_BUILTINS) || defined(HAVE_GCC_SYNC_BUILTINS)
rbimpl_atomic_size_sub(ptr, 1);
#elif defined(_WIN32) && defined(_M_AMD64)
InterlockedDecrement64(ptr);
#elif defined(__sun) && defined(HAVE_ATOMIC_H) && (defined(_LP64) || defined(_I32LPx))
atomic_dec_ulong(ptr);
#else
rbimpl_atomic_size_sub(ptr, 1);
#endif
}
RBIMPL_ATTR_ARTIFICIAL()
RBIMPL_ATTR_NOALIAS()
RBIMPL_ATTR_NONNULL((1))
static inline void
rbimpl_atomic_or(volatile rb_atomic_t *ptr, rb_atomic_t val)
{
#if 0
#elif defined(HAVE_GCC_ATOMIC_BUILTINS)
__atomic_or_fetch(ptr, val, __ATOMIC_SEQ_CST);
#elif defined(HAVE_GCC_SYNC_BUILTINS)
__sync_or_and_fetch(ptr, val);
#elif RBIMPL_COMPILER_SINCE(MSVC, 13, 0, 0)
_InterlockedOr(ptr, val);
#elif defined(_WIN32) && defined(__GNUC__)
/* This was for old MinGW. Maybe not needed any longer? */
__asm__(
"lock\n\t"
"orl\t%1, %0"
: "=m"(ptr)
: "Ir"(val));
#elif defined(_WIN32) && defined(_M_IX86)
__asm mov eax, ptr;
__asm mov ecx, val;
__asm lock or [eax], ecx;
#elif defined(__sun) && defined(HAVE_ATOMIC_H)
atomic_or_uint(ptr, val);
#else
# error Unsupported platform.
#endif
}
/* Nobody uses this but for theoretical backwards compatibility... */
#if RBIMPL_COMPILER_BEFORE(MSVC, 13, 0, 0)
static inline rb_atomic_t
rb_w32_atomic_or(volatile rb_atomic_t *var, rb_atomic_t val)
{
return rbimpl_atomic_or(var, val);
}
#endif
RBIMPL_ATTR_ARTIFICIAL()
RBIMPL_ATTR_NOALIAS()
RBIMPL_ATTR_NONNULL((1))
static inline rb_atomic_t
rbimpl_atomic_exchange(volatile rb_atomic_t *ptr, rb_atomic_t val)
{
#if 0
#elif defined(HAVE_GCC_ATOMIC_BUILTINS)
return __atomic_exchange_n(ptr, val, __ATOMIC_SEQ_CST);
#elif defined(HAVE_GCC_SYNC_BUILTINS)
return __sync_lock_test_and_set(ptr, val);
#elif defined(_WIN32)
return InterlockedExchange(ptr, val);
#elif defined(__sun) && defined(HAVE_ATOMIC_H)
return atomic_swap_uint(ptr, val);
#else
# error Unsupported platform.
#endif
}
RBIMPL_ATTR_ARTIFICIAL()
RBIMPL_ATTR_NOALIAS()
RBIMPL_ATTR_NONNULL((1))
static inline size_t
rbimpl_atomic_size_exchange(volatile size_t *ptr, size_t val)
{
#if 0
#elif defined(HAVE_GCC_ATOMIC_BUILTINS)
return __atomic_exchange_n(ptr, val, __ATOMIC_SEQ_CST);
#elif defined(HAVE_GCC_SYNC_BUILTINS)
return __sync_lock_test_and_set(ptr, val);
#elif defined(_WIN32) && defined(_M_AMD64)
return InterlockedExchange64(ptr, val);
#elif defined(__sun) && defined(HAVE_ATOMIC_H) && (defined(_LP64) || defined(_I32LPx))
return atomic_swap_ulong(ptr, val);
#else
RBIMPL_STATIC_ASSERT(size_of_size_t, sizeof *ptr == sizeof(rb_atomic_t));
volatile rb_atomic_t *const tmp = RBIMPL_CAST((volatile rb_atomic_t *)ptr);
const rb_atomic_t ret = rbimpl_atomic_exchange(tmp, val);
return RBIMPL_CAST((size_t)ret);
#endif
}
RBIMPL_ATTR_ARTIFICIAL()
RBIMPL_ATTR_NOALIAS()
RBIMPL_ATTR_NONNULL((1))
static inline void *
rbimpl_atomic_ptr_exchange(void *volatile *ptr, const void *val)
{
#if 0
#elif defined(InterlockedExchangePointer)
/* const_cast */
PVOID *pptr = RBIMPL_CAST((PVOID *)ptr);
PVOID pval = RBIMPL_CAST((PVOID)val);
return InterlockedExchangePointer(pptr, pval);
#elif defined(__sun) && defined(HAVE_ATOMIC_H)
return atomic_swap_ptr(ptr, RBIMPL_CAST((void *)val));
#else
RBIMPL_STATIC_ASSERT(sizeof_voidp, sizeof *ptr == sizeof(size_t));
const size_t sval = RBIMPL_CAST((size_t)val);
volatile size_t *const sptr = RBIMPL_CAST((volatile size_t *)ptr);
const size_t sret = rbimpl_atomic_size_exchange(sptr, sval);
return RBIMPL_CAST((void *)sret);
#endif
}
RBIMPL_ATTR_ARTIFICIAL()
RBIMPL_ATTR_NOALIAS()
RBIMPL_ATTR_NONNULL((1))
static inline VALUE
rbimpl_atomic_value_exchange(volatile VALUE *ptr, VALUE val)
{
RBIMPL_STATIC_ASSERT(sizeof_value, sizeof *ptr == sizeof(size_t));
const size_t sval = RBIMPL_CAST((size_t)val);
volatile size_t *const sptr = RBIMPL_CAST((volatile size_t *)ptr);
const size_t sret = rbimpl_atomic_size_exchange(sptr, sval);
return RBIMPL_CAST((VALUE)sret);
}
RBIMPL_ATTR_ARTIFICIAL()
RBIMPL_ATTR_NOALIAS()
RBIMPL_ATTR_NONNULL((1))
static inline void
rbimpl_atomic_set(volatile rb_atomic_t *ptr, rb_atomic_t val)
{
#if 0
#elif defined(HAVE_GCC_ATOMIC_BUILTINS)
__atomic_store_n(ptr, val, __ATOMIC_SEQ_CST);
#else
/* Maybe std::atomic<rb_atomic_t>::store can be faster? */
rbimpl_atomic_exchange(ptr, val);
#endif
}
RBIMPL_ATTR_ARTIFICIAL()
RBIMPL_ATTR_NOALIAS()
RBIMPL_ATTR_NONNULL((1))
static inline rb_atomic_t
rbimpl_atomic_cas(volatile rb_atomic_t *ptr, rb_atomic_t oldval, rb_atomic_t newval)
{
#if 0
#elif defined(HAVE_GCC_ATOMIC_BUILTINS)
__atomic_compare_exchange_n(
ptr, &oldval, newval, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
return oldval;
#elif defined(HAVE_GCC_SYNC_BUILTINS)
return __sync_val_compare_and_swap(ptr, oldval, newval);
#elif RBIMPL_COMPILER_SINCE(MSVC, 13, 0, 0)
return InterlockedCompareExchange(ptr, newval, oldval);
#elif defined(_WIN32)
PVOID *pptr = RBIMPL_CAST((PVOID *)ptr);
PVOID pold = RBIMPL_CAST((PVOID)oldval);
PVOID pnew = RBIMPL_CAST((PVOID)newval);
PVOID pret = InterlockedCompareExchange(pptr, pnew, pold);
return RBIMPL_CAST((rb_atomic_t)pret);
#elif defined(__sun) && defined(HAVE_ATOMIC_H)
return atomic_cas_uint(ptr, oldval, newval);
#else
# error Unsupported platform.
#endif
}
/* Nobody uses this but for theoretical backwards compatibility... */
#if RBIMPL_COMPILER_BEFORE(MSVC, 13, 0, 0)
static inline rb_atomic_t
rb_w32_atomic_cas(volatile rb_atomic_t *var, rb_atomic_t oldval, rb_atomic_t newval)
{
return rbimpl_atomic_cas(var, oldval, newval);
}
#endif
RBIMPL_ATTR_ARTIFICIAL()
RBIMPL_ATTR_NOALIAS()
RBIMPL_ATTR_NONNULL((1))
static inline size_t
rbimpl_atomic_size_cas(volatile size_t *ptr, size_t oldval, size_t newval)
{
#if 0
#elif defined(HAVE_GCC_ATOMIC_BUILTINS)
__atomic_compare_exchange_n(
ptr, &oldval, newval, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
return oldval;
#elif defined(HAVE_GCC_SYNC_BUILTINS)
return __sync_val_compare_and_swap(ptr, oldval, newval);
#elif defined(_WIN32) && defined(_M_AMD64)
return InterlockedCompareExchange64(ptr, newval, oldval);
#elif defined(__sun) && defined(HAVE_ATOMIC_H) && (defined(_LP64) || defined(_I32LPx))
return atomic_cas_ulong(ptr, oldval, newval);
#else
RBIMPL_STATIC_ASSERT(size_of_size_t, sizeof *ptr == sizeof(rb_atomic_t));
volatile rb_atomic_t *tmp = RBIMPL_CAST((volatile rb_atomic_t *)ptr);
return rbimpl_atomic_cas(tmp, oldval, newval);
#endif
}
RBIMPL_ATTR_ARTIFICIAL()
RBIMPL_ATTR_NOALIAS()
RBIMPL_ATTR_NONNULL((1))
static inline void *
rbimpl_atomic_ptr_cas(void **ptr, const void *oldval, const void *newval)
{
#if 0
#elif defined(InterlockedExchangePointer)
/* ... Can we say that InterlockedCompareExchangePtr surly exists when
* InterlockedExchangePointer is defined? Seems so but...?*/
PVOID *pptr = RBIMPL_CAST((PVOID *)ptr);
PVOID pold = RBIMPL_CAST((PVOID)oldval);
PVOID pnew = RBIMPL_CAST((PVOID)newval);
return InterlockedCompareExchangePointer(pptr, pnew, pold);
#elif defined(__sun) && defined(HAVE_ATOMIC_H)
void *pold = RBIMPL_CAST((void *)oldval);
void *pnew = RBIMPL_CAST((void *)newval);
return atomic_cas_ptr(ptr, pold, pnew);
#else
RBIMPL_STATIC_ASSERT(sizeof_voidp, sizeof *ptr == sizeof(size_t));
const size_t snew = RBIMPL_CAST((size_t)newval);
const size_t sold = RBIMPL_CAST((size_t)oldval);
volatile size_t *const sptr = RBIMPL_CAST((volatile size_t *)ptr);
const size_t sret = rbimpl_atomic_size_cas(sptr, sold, snew);
return RBIMPL_CAST((void *)sret);
#endif
}
RBIMPL_ATTR_ARTIFICIAL()
RBIMPL_ATTR_NOALIAS()
RBIMPL_ATTR_NONNULL((1))
static inline VALUE
rbimpl_atomic_value_cas(volatile VALUE *ptr, VALUE oldval, VALUE newval)
{
RBIMPL_STATIC_ASSERT(sizeof_value, sizeof *ptr == sizeof(size_t));
const size_t snew = RBIMPL_CAST((size_t)newval);
const size_t sold = RBIMPL_CAST((size_t)oldval);
volatile size_t *const sptr = RBIMPL_CAST((volatile size_t *)ptr);
const size_t sret = rbimpl_atomic_size_cas(sptr, sold, snew);
return RBIMPL_CAST((VALUE)sret);
}
/** @endcond */
#endif /* RUBY_ATOMIC_H */

View File

@@ -1,25 +0,0 @@
#ifndef RUBY_RUBY_BACKWARD_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY_RUBY_BACKWARD_H 1
/**
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
*/
#include "ruby/internal/value.h"
#include "ruby/internal/interpreter.h"
#include "ruby/backward/2/attributes.h"
#define RBIMPL_ATTR_DEPRECATED_SINCE(ver) RBIMPL_ATTR_DEPRECATED(("since " #ver))
#define RBIMPL_ATTR_DEPRECATED_INTERNAL(ver) RBIMPL_ATTR_DEPRECATED(("since "#ver", also internal"))
#define RBIMPL_ATTR_DEPRECATED_INTERNAL_ONLY() RBIMPL_ATTR_DEPRECATED(("only for internal use"))
RBIMPL_ATTR_DEPRECATED_INTERNAL_ONLY() void rb_clear_constant_cache(void);
/* from version.c */
#if defined(RUBY_SHOW_COPYRIGHT_TO_DIE) && !!(RUBY_SHOW_COPYRIGHT_TO_DIE+0)
# error RUBY_SHOW_COPYRIGHT_TO_DIE is deprecated
#endif
#endif /* RUBY_RUBY_BACKWARD_H */

View File

@@ -1,56 +0,0 @@
#ifndef RUBY_BACKWARD2_ASSUME_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY_BACKWARD2_ASSUME_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Defines #ASSUME / #RB_LIKELY / #UNREACHABLE
*/
#include "ruby/internal/config.h"
#include "ruby/internal/assume.h"
#include "ruby/internal/has/builtin.h"
#define ASSUME RBIMPL_ASSUME /**< @old{RBIMPL_ASSUME} */
#define UNREACHABLE RBIMPL_UNREACHABLE() /**< @old{RBIMPL_UNREACHABLE} */
#define UNREACHABLE_RETURN RBIMPL_UNREACHABLE_RETURN /**< @old{RBIMPL_UNREACHABLE_RETURN} */
/* likely */
#if RBIMPL_HAS_BUILTIN(__builtin_expect)
/**
* Asserts that the given Boolean expression likely holds.
*
* @param x An expression that likely holds.
*
* @note Consider this macro carefully. It has been here since when CPUs were
* like babies, but contemporary processors are beasts. They are
* smarter than mare mortals like us today. Their branch predictions
* highly expectedly outperform your use of this macro.
*/
# define RB_LIKELY(x) (__builtin_expect(!!(x), 1))
/**
* Asserts that the given Boolean expression likely doesn't hold.
*
* @param x An expression that likely doesn't hold.
*/
# define RB_UNLIKELY(x) (__builtin_expect(!!(x), 0))
#else
# define RB_LIKELY(x) (x)
# define RB_UNLIKELY(x) (x)
#endif
#endif /* RUBY_BACKWARD2_ASSUME_H */

View File

@@ -1,165 +0,0 @@
#ifndef RUBY_BACKWARD2_ATTRIBUTES_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY_BACKWARD2_ATTRIBUTES_H
/**
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Various attribute-related macros.
*
* ### Q&A ###
*
* - Q: Why are the macros defined in this header file so inconsistent in
* style?
*
* - A: Don't know. Don't blame me. Backward compatibility is the key here.
* I'm just preserving what they have been.
*/
#include "ruby/internal/config.h"
#include "ruby/internal/attr/alloc_size.h"
#include "ruby/internal/attr/cold.h"
#include "ruby/internal/attr/const.h"
#include "ruby/internal/attr/deprecated.h"
#include "ruby/internal/attr/error.h"
#include "ruby/internal/attr/forceinline.h"
#include "ruby/internal/attr/format.h"
#include "ruby/internal/attr/maybe_unused.h"
#include "ruby/internal/attr/noinline.h"
#include "ruby/internal/attr/nonnull.h"
#include "ruby/internal/attr/noreturn.h"
#include "ruby/internal/attr/pure.h"
#include "ruby/internal/attr/restrict.h"
#include "ruby/internal/attr/returns_nonnull.h"
#include "ruby/internal/attr/warning.h"
#include "ruby/internal/has/attribute.h"
/* function attributes */
#undef CONSTFUNC
#define CONSTFUNC(x) RBIMPL_ATTR_CONST() x
#undef PUREFUNC
#define PUREFUNC(x) RBIMPL_ATTR_PURE() x
#undef DEPRECATED
#define DEPRECATED(x) RBIMPL_ATTR_DEPRECATED(("")) x
#undef DEPRECATED_BY
#define DEPRECATED_BY(n,x) RBIMPL_ATTR_DEPRECATED(("by: " # n)) x
#undef DEPRECATED_TYPE
#if defined(__GNUC__)
# define DEPRECATED_TYPE(mesg, decl) \
_Pragma("message \"DEPRECATED_TYPE is deprecated\""); \
decl RBIMPL_ATTR_DEPRECATED(mseg)
#elif defined(_MSC_VER)
# pragma deprecated(DEPRECATED_TYPE)
# define DEPRECATED_TYPE(mesg, decl) \
__pragma(message(__FILE__"("STRINGIZE(__LINE__)"): warning: " \
"DEPRECATED_TYPE is deprecated")) \
decl RBIMPL_ATTR_DEPRECATED(mseg)
#else
# define DEPRECATED_TYPE(mesg, decl) \
<-<-"DEPRECATED_TYPE is deprecated"->->
#endif
#undef RUBY_CXX_DEPRECATED
#define RUBY_CXX_DEPRECATED(mseg) RBIMPL_ATTR_DEPRECATED((mseg))
#undef NOINLINE
#define NOINLINE(x) RBIMPL_ATTR_NOINLINE() x
#ifndef MJIT_HEADER
# undef ALWAYS_INLINE
# define ALWAYS_INLINE(x) RBIMPL_ATTR_FORCEINLINE() x
#endif
#undef ERRORFUNC
#define ERRORFUNC(mesg, x) RBIMPL_ATTR_ERROR(mesg) x
#if RBIMPL_HAS_ATTRIBUTE(error)
# define HAVE_ATTRIBUTE_ERRORFUNC 1
#endif
#undef WARNINGFUNC
#define WARNINGFUNC(mesg, x) RBIMPL_ATTR_WARNING(mesg) x
#if RBIMPL_HAS_ATTRIBUTE(warning)
# define HAVE_ATTRIBUTE_WARNINGFUNC 1
#endif
/*
cold attribute for code layout improvements
RUBY_FUNC_ATTRIBUTE not used because MSVC does not like nested func macros
*/
#undef COLDFUNC
#define COLDFUNC RBIMPL_ATTR_COLD()
#define PRINTF_ARGS(decl, string_index, first_to_check) \
RBIMPL_ATTR_FORMAT(RBIMPL_PRINTF_FORMAT, (string_index), (first_to_check)) \
decl
#undef RUBY_ATTR_ALLOC_SIZE
#define RUBY_ATTR_ALLOC_SIZE RBIMPL_ATTR_ALLOC_SIZE
#undef RUBY_ATTR_MALLOC
#define RUBY_ATTR_MALLOC RBIMPL_ATTR_RESTRICT()
#undef RUBY_ATTR_RETURNS_NONNULL
#define RUBY_ATTR_RETURNS_NONNULL RBIMPL_ATTR_RETURNS_NONNULL()
#ifndef FUNC_MINIMIZED
#define FUNC_MINIMIZED(x) x
#endif
#ifndef FUNC_UNOPTIMIZED
#define FUNC_UNOPTIMIZED(x) x
#endif
#ifndef RUBY_ALIAS_FUNCTION_TYPE
#define RUBY_ALIAS_FUNCTION_TYPE(type, prot, name, args) \
FUNC_MINIMIZED(type prot) {return (type)name args;}
#endif
#ifndef RUBY_ALIAS_FUNCTION_VOID
#define RUBY_ALIAS_FUNCTION_VOID(prot, name, args) \
FUNC_MINIMIZED(void prot) {name args;}
#endif
#ifndef RUBY_ALIAS_FUNCTION
#define RUBY_ALIAS_FUNCTION(prot, name, args) \
RUBY_ALIAS_FUNCTION_TYPE(VALUE, prot, name, args)
#endif
#undef RUBY_FUNC_NONNULL
#define RUBY_FUNC_NONNULL(n, x) RBIMPL_ATTR_NONNULL(n) x
#undef NORETURN
#define NORETURN(x) RBIMPL_ATTR_NORETURN() x
#define NORETURN_STYLE_NEW
#ifndef PACKED_STRUCT
# define PACKED_STRUCT(x) x
#endif
#ifndef PACKED_STRUCT_UNALIGNED
# if UNALIGNED_WORD_ACCESS
# define PACKED_STRUCT_UNALIGNED(x) PACKED_STRUCT(x)
# else
# define PACKED_STRUCT_UNALIGNED(x) x
# endif
#endif
#undef RB_UNUSED_VAR
#define RB_UNUSED_VAR(x) x RBIMPL_ATTR_MAYBE_UNUSED()
#endif /* RUBY_BACKWARD2_ATTRIBUTES_H */

View File

@@ -1,36 +0,0 @@
#ifndef RUBY_BACKWARD2_BOOL_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY_BACKWARD2_BOOL_H
/**
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Defines old TRUE / FALSE
*/
#include "ruby/internal/stdbool.h"
#ifndef FALSE
# define FALSE false
#elif FALSE
# error FALSE must be false
#endif
#ifndef TRUE
# define TRUE true
#elif ! TRUE
# error TRUE must be true
#endif
#endif /* RUBY_BACKWARD2_BOOL_H */

View File

@@ -1,37 +0,0 @@
#ifndef RUBY_BACKWARD2_GCC_VERSION_SINCE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY_BACKWARD2_GCC_VERSION_SINCE_H
/**
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Defines old GCC_VERSION_SINCE
*/
#include "ruby/internal/compiler_since.h"
#ifndef GCC_VERSION_SINCE
#define GCC_VERSION_SINCE(x, y, z) RBIMPL_COMPILER_SINCE(GCC, (x), (y), (z))
#endif
#ifndef GCC_VERSION_BEFORE
#define GCC_VERSION_BEFORE(x, y, z) \
(RBIMPL_COMPILER_BEFORE(GCC, (x), (y), (z)) || \
(RBIMPL_COMPILER_IS(GCC) && \
((RBIMPL_COMPILER_VERSION_MAJOR == (x)) && \
((RBIMPL_COMPILER_VERSION_MINOR == (y)) && \
(RBIMPL_COMPILER_VERSION_PATCH == (z))))))
#endif
#endif /* RUBY_BACKWARD2_GCC_VERSION_SINCE_H */

View File

@@ -1,131 +0,0 @@
#ifndef RUBY_BACKWARD2_INTTYPES_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY_BACKWARD2_INTTYPES_H
/**
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief C99 shim for `<inttypes.h>`
*/
#include "ruby/internal/config.h" /* PRI_LL_PREFIX etc. are here */
#ifdef HAVE_INTTYPES_H
# include <inttypes.h>
#endif
#include "ruby/internal/value.h" /* PRI_VALUE_PREFIX is here. */
#ifndef PRI_INT_PREFIX
# define PRI_INT_PREFIX ""
#endif
#ifndef PRI_LONG_PREFIX
# define PRI_LONG_PREFIX "l"
#endif
#ifndef PRI_SHORT_PREFIX
# define PRI_SHORT_PREFIX "h"
#endif
#ifdef PRI_64_PREFIX
# /* Take that. */
#elif SIZEOF_LONG == 8
# define PRI_64_PREFIX PRI_LONG_PREFIX
#elif SIZEOF_LONG_LONG == 8
# define PRI_64_PREFIX PRI_LL_PREFIX
#endif
#ifndef PRIdPTR
# define PRIdPTR PRI_PTR_PREFIX"d"
# define PRIiPTR PRI_PTR_PREFIX"i"
# define PRIoPTR PRI_PTR_PREFIX"o"
# define PRIuPTR PRI_PTR_PREFIX"u"
# define PRIxPTR PRI_PTR_PREFIX"x"
# define PRIXPTR PRI_PTR_PREFIX"X"
#endif
#ifndef RUBY_PRI_VALUE_MARK
# define RUBY_PRI_VALUE_MARK "\v"
#endif
#if defined PRIdPTR && !defined PRI_VALUE_PREFIX
# define PRIdVALUE PRIdPTR
# define PRIoVALUE PRIoPTR
# define PRIuVALUE PRIuPTR
# define PRIxVALUE PRIxPTR
# define PRIXVALUE PRIXPTR
# define PRIsVALUE PRIiPTR"" RUBY_PRI_VALUE_MARK
#else
# define PRIdVALUE PRI_VALUE_PREFIX"d"
# define PRIoVALUE PRI_VALUE_PREFIX"o"
# define PRIuVALUE PRI_VALUE_PREFIX"u"
# define PRIxVALUE PRI_VALUE_PREFIX"x"
# define PRIXVALUE PRI_VALUE_PREFIX"X"
# define PRIsVALUE PRI_VALUE_PREFIX"i" RUBY_PRI_VALUE_MARK
#endif
#ifndef PRI_VALUE_PREFIX
# define PRI_VALUE_PREFIX ""
#endif
#ifdef PRI_TIMET_PREFIX
# /* Take that. */
#elif SIZEOF_TIME_T == SIZEOF_INT
# define PRI_TIMET_PREFIX
#elif SIZEOF_TIME_T == SIZEOF_LONG
# define PRI_TIMET_PREFIX "l"
#elif SIZEOF_TIME_T == SIZEOF_LONG_LONG
# define PRI_TIMET_PREFIX PRI_LL_PREFIX
#endif
#ifdef PRI_PTRDIFF_PREFIX
# /* Take that. */
#elif SIZEOF_PTRDIFF_T == SIZEOF_INT
# define PRI_PTRDIFF_PREFIX ""
#elif SIZEOF_PTRDIFF_T == SIZEOF_LONG
# define PRI_PTRDIFF_PREFIX "l"
#elif SIZEOF_PTRDIFF_T == SIZEOF_LONG_LONG
# define PRI_PTRDIFF_PREFIX PRI_LL_PREFIX
#endif
#ifndef PRIdPTRDIFF
# define PRIdPTRDIFF PRI_PTRDIFF_PREFIX"d"
# define PRIiPTRDIFF PRI_PTRDIFF_PREFIX"i"
# define PRIoPTRDIFF PRI_PTRDIFF_PREFIX"o"
# define PRIuPTRDIFF PRI_PTRDIFF_PREFIX"u"
# define PRIxPTRDIFF PRI_PTRDIFF_PREFIX"x"
# define PRIXPTRDIFF PRI_PTRDIFF_PREFIX"X"
#endif
#ifdef PRI_SIZE_PREFIX
# /* Take that. */
#elif SIZEOF_SIZE_T == SIZEOF_INT
# define PRI_SIZE_PREFIX ""
#elif SIZEOF_SIZE_T == SIZEOF_LONG
# define PRI_SIZE_PREFIX "l"
#elif SIZEOF_SIZE_T == SIZEOF_LONG_LONG
# define PRI_SIZE_PREFIX PRI_LL_PREFIX
#endif
#ifndef PRIdSIZE
# define PRIdSIZE PRI_SIZE_PREFIX"d"
# define PRIiSIZE PRI_SIZE_PREFIX"i"
# define PRIoSIZE PRI_SIZE_PREFIX"o"
# define PRIuSIZE PRI_SIZE_PREFIX"u"
# define PRIxSIZE PRI_SIZE_PREFIX"x"
# define PRIXSIZE PRI_SIZE_PREFIX"X"
#endif
#endif /* RUBY_BACKWARD2_INTTYPES_H */

View File

@@ -1,99 +0,0 @@
#ifndef RUBY_BACKWARD2_LIMITS_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY_BACKWARD2_LIMITS_H
/**
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Historical shim for `<limits.h>`.
*
* The macros in this header file are obsolescent. Does anyone really need our
* own definition of `CHAR_BIT` today?
*/
#include "ruby/internal/config.h"
#ifdef HAVE_LIMITS_H
# include <limits.h>
#endif
#include "ruby/backward/2/long_long.h"
#ifndef LONG_MAX
# /* assuming 32bit(2's complement) long */
# define LONG_MAX 2147483647L
#endif
#ifndef LONG_MIN
# define LONG_MIN (-LONG_MAX-1)
#endif
#ifndef CHAR_BIT
# define CHAR_BIT 8
#endif
#ifdef LLONG_MAX
# /* Take that. */
#elif defined(LONG_LONG_MAX)
# define LLONG_MAX LONG_LONG_MAX
#elif defined(_I64_MAX)
# define LLONG_MAX _I64_MAX
#else
# /* assuming 64bit(2's complement) long long */
# define LLONG_MAX 9223372036854775807LL
#endif
#ifdef LLONG_MIN
# /* Take that. */
#elif defined(LONG_LONG_MIN)
# define LLONG_MIN LONG_LONG_MIN
#elif defined(_I64_MAX)
# define LLONG_MIN _I64_MIN
#else
# define LLONG_MIN (-LLONG_MAX-1)
#endif
#ifdef SIZE_MAX
# /* Take that. */
#elif SIZEOF_SIZE_T == SIZEOF_LONG_LONG
# define SIZE_MAX ULLONG_MAX
# define SIZE_MIN ULLONG_MIN
#elif SIZEOF_SIZE_T == SIZEOF_LONG
# define SIZE_MAX ULONG_MAX
# define SIZE_MIN ULONG_MIN
#elif SIZEOF_SIZE_T == SIZEOF_INT
# define SIZE_MAX UINT_MAX
# define SIZE_MIN UINT_MIN
#else
# define SIZE_MAX USHRT_MAX
# define SIZE_MIN USHRT_MIN
#endif
#ifdef SSIZE_MAX
# /* Take that. */
#elif SIZEOF_SIZE_T == SIZEOF_LONG_LONG
# define SSIZE_MAX LLONG_MAX
# define SSIZE_MIN LLONG_MIN
#elif SIZEOF_SIZE_T == SIZEOF_LONG
# define SSIZE_MAX LONG_MAX
# define SSIZE_MIN LONG_MIN
#elif SIZEOF_SIZE_T == SIZEOF_INT
# define SSIZE_MAX INT_MAX
# define SSIZE_MIN INT_MIN
#else
# define SSIZE_MAX SHRT_MAX
# define SSIZE_MIN SHRT_MIN
#endif
#endif /* RUBY_BACKWARD2_LIMITS_H */

View File

@@ -1,73 +0,0 @@
#ifndef RUBY_BACKWARD2_LONG_LONG_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY_BACKWARD2_LONG_LONG_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Defines old #LONG_LONG
*
* No known compiler that can compile today's ruby lacks long long.
* Historically MSVC was one of such compiler, but it implemented long long a
* while ago (some time back in 2013). The macros are for backwards
* compatibility only.
*/
#include "ruby/internal/config.h"
#include "ruby/internal/has/warning.h"
#include "ruby/internal/warning_push.h"
#if defined(__DOXYGEN__)
# /** @cond INTERNAL_MACRO */
# define HAVE_LONG_LONG 1
# define HAVE_TRUE_LONG_LONG 1
# /** @endcond */
# /** @deprecated Just use `long long` directly. */
# define LONG_LONG long long.
#elif RBIMPL_HAS_WARNING("-Wc++11-long-long")
# define HAVE_TRUE_LONG_LONG 1
# define LONG_LONG \
RBIMPL_WARNING_PUSH() \
RBIMPL_WARNING_IGNORED(-Wc++11-long-long) \
long long \
RBIMPL_WARNING_POP()
#elif RBIMPL_HAS_WARNING("-Wlong-long")
# define HAVE_TRUE_LONG_LONG 1
# define LONG_LONG \
RBIMPL_WARNING_PUSH() \
RBIMPL_WARNING_IGNORED(-Wlong-long) \
long long \
RBIMPL_WARNING_POP()
#elif defined(HAVE_LONG_LONG)
# define HAVE_TRUE_LONG_LONG 1
# define LONG_LONG long long
#elif SIZEOF___INT64 > 0
# define HAVE_LONG_LONG 1
# define LONG_LONG __int64
# undef SIZEOF_LONG_LONG
# define SIZEOF_LONG_LONG SIZEOF___INT64
#else
# error Hello! Ruby developers believe this message must not happen.
# error If you encounter this message, can you file a bug report?
# error Remember to attach a detailed description of your environment.
# error Thank you!
#endif
#endif /* RBIMPL_BACKWARD2_LONG_LONG_H */

View File

@@ -1,32 +0,0 @@
#ifndef RUBY_BACKWARD2_R_CAST_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY_BACKWARD2_R_CAST_H
/**
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Defines old R_CAST
*
* Nobody is actively using this macro.
*/
#define R_CAST(st) (struct st*)
#define RMOVED(obj) (R_CAST(RMoved)(obj))
#if defined(__GNUC__)
# warning R_CAST and RMOVED are deprecated
#elif defined(_MSC_VER)
# pragma message("warning: R_CAST and RMOVED are deprecated")
#endif
#endif /* RUBY_BACKWARD2_R_CAST_H */

View File

@@ -1,36 +0,0 @@
#ifndef RUBY_BACKWARD2_RMODULE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY_BACKWARD2_RMODULE_H
/**
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Orphan macros.
*
* These macros seems broken since at least 2011. Nobody (except ruby itself
* who is implementing the internals) could have used those macros for a while.
* Kept public as-is here to keep some theoretical backwards compatibility.
*/
#define RMODULE_IV_TBL(m) RCLASS_IV_TBL(m)
#define RMODULE_CONST_TBL(m) RCLASS_CONST_TBL(m)
#define RMODULE_M_TBL(m) RCLASS_M_TBL(m)
#define RMODULE_SUPER(m) RCLASS_SUPER(m)
#if defined(__GNUC__)
# warning RMODULE_* macros are deprecated
#elif defined(_MSC_VER)
# pragma message("warning: RMODULE_* macros are deprecated")
#endif
#endif /* RUBY_BACKWARD2_RMODULE_H */

View File

@@ -1,30 +0,0 @@
#ifndef RUBY_BACKWARD2_STDALIGN_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY_BACKWARD2_STDALIGN_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Defines #RUBY_ALIGNAS / #RUBY_ALIGNOF
*/
#include "ruby/internal/stdalign.h"
#undef RUBY_ALIGNAS
#undef RUBY_ALIGNOF
#define RUBY_ALIGNAS RBIMPL_ALIGNAS /**< @copydoc RBIMPL_ALIGNAS */
#define RUBY_ALIGNOF RBIMPL_ALIGNOF /**< @copydoc RBIMPL_ALIGNOF */
#endif /* RUBY_BACKWARD2_STDALIGN_H */

View File

@@ -1,69 +0,0 @@
#ifndef RUBY_BACKWARD2_STDARG_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY_BACKWARD2_STDARG_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Defines old #_
*
* Nobody should ever use these macros any longer. No known compilers lack
* prototypes today. It's 21st century. Just forget them.
*/
#undef _
/**
* @deprecated Nobody practically needs this macro any longer.
* @brief This was a transition path from K&R to ANSI.
*/
#ifdef HAVE_PROTOTYPES
# define _(args) args
#else
# define _(args) ()
#endif
#undef __
/**
* @deprecated Nobody practically needs this macro any longer.
* @brief This was a transition path from K&R to ANSI.
*/
#ifdef HAVE_STDARG_PROTOTYPES
# define __(args) args
#else
# define __(args) ()
#endif
/**
* Functions declared using this macro take arbitrary arguments, including
* void.
*
* ```CXX
* void func(ANYARGS);
* ```
*
* This was a necessary evil when there was no such thing like function
* overloading. But it is the 21st century today. People generally need not
* use this. Just use a granular typed function.
*
* @see ruby::backward::cxxanyargs
*/
#ifdef __cplusplus
#define ANYARGS ...
#else
#define ANYARGS
#endif
#endif /* RUBY_BACKWARD2_STDARG_H */

View File

@@ -1,700 +0,0 @@
#ifndef RUBY_BACKWARD_CXXANYARGS_HPP //-*-C++-*-vi:ft=cpp
#define RUBY_BACKWARD_CXXANYARGS_HPP
/// @file
/// @author @shyouhei
/// @copyright This file is a part of the programming language Ruby.
/// Permission is hereby granted, to either redistribute and/or
/// modify this file, provided that the conditions mentioned in the
/// file COPYING are met. Consult the file for details.
/// @note DO NOT MODERNISE THIS FILE! As the file name implies it is
/// meant to be a backwards compatibility shim. Please stick to
/// C++ 98 and never use newer features, like `constexpr`.
/// @brief Provides old prototypes for C++ programs.
#include "ruby/internal/config.h"
#include "ruby/internal/intern/class.h"
#include "ruby/internal/intern/cont.h"
#include "ruby/internal/intern/hash.h"
#include "ruby/internal/intern/proc.h"
#include "ruby/internal/intern/thread.h"
#include "ruby/internal/intern/variable.h"
#include "ruby/internal/intern/vm.h"
#include "ruby/internal/iterator.h"
#include "ruby/internal/method.h"
#include "ruby/internal/value.h"
#include "ruby/internal/variable.h"
#include "ruby/backward/2/stdarg.h"
#include "ruby/st.h"
extern "C++" {
#ifdef HAVE_NULLPTR
#include <cstddef>
#endif
/// @brief The main namespace.
/// @note The name "ruby" might already be taken, but that must not be a
/// problem because namespaces are allowed to reopen.
namespace ruby {
/// Backwards compatibility layer.
namespace backward {
/// Provides ANYARGS deprecation warnings. In C, ANYARGS means there is no
/// function prototype. Literally anything, even including nothing, can be a
/// valid ANYARGS. So passing a correctly prototyped function pointer to an
/// ANYARGS-ed function parameter is valid, at the same time passing an
/// ANYARGS-ed function pointer to a granular typed function parameter is also
/// valid. However on the other hand in C++, ANYARGS doesn't actually mean any
/// number of arguments. C++'s ANYARGS means _variadic_ number of arguments.
/// This is incompatible with ordinal, correct function prototypes.
///
/// Luckily, function prototypes being distinct each other means they can be
/// overloaded. We can provide a compatibility layer for older Ruby APIs which
/// used to have ANYARGS. This namespace includes such attempts.
namespace cxxanyargs {
typedef VALUE type(ANYARGS); ///< ANYARGS-ed function type.
typedef void void_type(ANYARGS); ///< ANYARGS-ed function type, void variant.
typedef int int_type(ANYARGS); ///< ANYARGS-ed function type, int variant.
typedef VALUE onearg_type(VALUE); ///< Single-argumented function type.
/// @name Hooking global variables
/// @{
RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief Define a function-backended global variable.
/// @param[in] q Name of the variable.
/// @param[in] w Getter function.
/// @param[in] e Setter function.
/// @note Both functions can be nullptr.
/// @see rb_define_hooked_variable()
/// @deprecated Use granular typed overload instead.
inline void
rb_define_virtual_variable(const char *q, type *w, void_type *e)
{
rb_gvar_getter_t *r = reinterpret_cast<rb_gvar_getter_t*>(w);
rb_gvar_setter_t *t = reinterpret_cast<rb_gvar_setter_t*>(e);
::rb_define_virtual_variable(q, r, t);
}
RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
inline void
rb_define_virtual_variable(const char *q, rb_gvar_getter_t *w, void_type *e)
{
rb_gvar_setter_t *t = reinterpret_cast<rb_gvar_setter_t*>(e);
::rb_define_virtual_variable(q, w, t);
}
RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
inline void
rb_define_virtual_variable(const char *q, type *w, rb_gvar_setter_t *e)
{
rb_gvar_getter_t *r = reinterpret_cast<rb_gvar_getter_t*>(w);
::rb_define_virtual_variable(q, r, e);
}
#ifdef HAVE_NULLPTR
inline void
rb_define_virtual_variable(const char *q, rb_gvar_getter_t *w, std::nullptr_t e)
{
::rb_define_virtual_variable(q, w, e);
}
RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
inline void
rb_define_virtual_variable(const char *q, type *w, std::nullptr_t e)
{
rb_gvar_getter_t *r = reinterpret_cast<rb_gvar_getter_t *>(w);
::rb_define_virtual_variable(q, r, e);
}
inline void
rb_define_virtual_variable(const char *q, std::nullptr_t w, rb_gvar_setter_t *e)
{
::rb_define_virtual_variable(q, w, e);
}
RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
inline void
rb_define_virtual_variable(const char *q, std::nullptr_t w, void_type *e)
{
rb_gvar_setter_t *r = reinterpret_cast<rb_gvar_setter_t *>(e);
::rb_define_virtual_variable(q, w, r);
}
#endif
RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief Define a function-backended global variable.
/// @param[in] q Name of the variable.
/// @param[in] w Variable storage.
/// @param[in] e Getter function.
/// @param[in] r Setter function.
/// @note Both functions can be nullptr.
/// @see rb_define_virtual_variable()
/// @deprecated Use granular typed overload instead.
inline void
rb_define_hooked_variable(const char *q, VALUE *w, type *e, void_type *r)
{
rb_gvar_getter_t *t = reinterpret_cast<rb_gvar_getter_t*>(e);
rb_gvar_setter_t *y = reinterpret_cast<rb_gvar_setter_t*>(r);
::rb_define_hooked_variable(q, w, t, y);
}
RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
inline void
rb_define_hooked_variable(const char *q, VALUE *w, rb_gvar_getter_t *e, void_type *r)
{
rb_gvar_setter_t *y = reinterpret_cast<rb_gvar_setter_t*>(r);
::rb_define_hooked_variable(q, w, e, y);
}
RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
inline void
rb_define_hooked_variable(const char *q, VALUE *w, type *e, rb_gvar_setter_t *r)
{
rb_gvar_getter_t *t = reinterpret_cast<rb_gvar_getter_t*>(e);
::rb_define_hooked_variable(q, w, t, r);
}
#ifdef HAVE_NULLPTR
inline void
rb_define_hooked_variable(const char *q, VALUE *w, rb_gvar_getter_t *e, std::nullptr_t r)
{
::rb_define_hooked_variable(q, w, e, r);
}
RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
inline void
rb_define_hooked_variable(const char *q, VALUE *w, type *e, std::nullptr_t r)
{
rb_gvar_getter_t *y = reinterpret_cast<rb_gvar_getter_t *>(e);
::rb_define_hooked_variable(q, w, y, r);
}
inline void
rb_define_hooked_variable(const char *q, VALUE *w, std::nullptr_t e, rb_gvar_setter_t *r)
{
::rb_define_hooked_variable(q, w, e, r);
}
RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
inline void
rb_define_hooked_variable(const char *q, VALUE *w, std::nullptr_t e, void_type *r)
{
rb_gvar_setter_t *y = reinterpret_cast<rb_gvar_setter_t *>(r);
::rb_define_hooked_variable(q, w, e, y);
}
#endif
/// @}
/// @name Exceptions and tag jumps
/// @{
// RUBY_CXX_DEPRECATED("by rb_block_call since 1.9")
RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief Old way to implement iterators.
/// @param[in] q A function that can yield.
/// @param[in] w Passed to `q`.
/// @param[in] e What is to be yielded.
/// @param[in] r Passed to `e`.
/// @return The return value of `q`.
/// @note `e` can be nullptr.
/// @deprecated This function is obsoleted since long before 2.x era. Do not
/// use it any longer. rb_block_call() is provided instead.
inline VALUE
rb_iterate(onearg_type *q, VALUE w, type *e, VALUE r)
{
rb_block_call_func_t t = reinterpret_cast<rb_block_call_func_t>(e);
return backward::rb_iterate_deprecated(q, w, t, r);
}
#ifdef HAVE_NULLPTR
RUBY_CXX_DEPRECATED("by rb_block_call since 1.9")
inline VALUE
rb_iterate(onearg_type *q, VALUE w, std::nullptr_t e, VALUE r)
{
return backward::rb_iterate_deprecated(q, w, e, r);
}
#endif
RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief Call a method with a block.
/// @param[in] q The self.
/// @param[in] w The method.
/// @param[in] e The # of elems of `r`
/// @param[in] r The arguments.
/// @param[in] t What is to be yielded.
/// @param[in] y Passed to `t`
/// @return Return value of `q#w(*r,&t)`
/// @note 't' can be nullptr.
/// @deprecated Use granular typed overload instead.
inline VALUE
rb_block_call(VALUE q, ID w, int e, const VALUE *r, type *t, VALUE y)
{
rb_block_call_func_t u = reinterpret_cast<rb_block_call_func_t>(t);
return ::rb_block_call(q, w, e, r, u, y);
}
#ifdef HAVE_NULLPTR
inline VALUE
rb_block_call(VALUE q, ID w, int e, const VALUE *r, std::nullptr_t t, VALUE y)
{
return ::rb_block_call(q, w, e, r, t, y);
}
#endif
RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief An equivalent of `rescue` clause.
/// @param[in] q A function that can raise.
/// @param[in] w Passed to `q`.
/// @param[in] e A function that cleans-up.
/// @param[in] r Passed to `e`.
/// @return The return value of `q` if no exception occurs, or the return
/// value of `e` if otherwise.
/// @note `e` can be nullptr.
/// @see rb_ensure()
/// @see rb_rescue2()
/// @see rb_protect()
/// @deprecated Use granular typed overload instead.
inline VALUE
rb_rescue(type *q, VALUE w, type *e, VALUE r)
{
typedef VALUE func1_t(VALUE);
typedef VALUE func2_t(VALUE, VALUE);
func1_t *t = reinterpret_cast<func1_t*>(q);
func2_t *y = reinterpret_cast<func2_t*>(e);
return ::rb_rescue(t, w, y, r);
}
RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief An equivalent of `rescue` clause.
/// @param[in] q A function that can raise.
/// @param[in] w Passed to `q`.
/// @param[in] e A function that cleans-up.
/// @param[in] r Passed to `e`.
/// @param[in] ... 0-terminated list of subclass of @ref rb_eException.
/// @return The return value of `q` if no exception occurs, or the return
/// value of `e` if otherwise.
/// @note `e` can be nullptr.
/// @see rb_ensure()
/// @see rb_rescue()
/// @see rb_protect()
/// @deprecated Use granular typed overload instead.
inline VALUE
rb_rescue2(type *q, VALUE w, type *e, VALUE r, ...)
{
typedef VALUE func1_t(VALUE);
typedef VALUE func2_t(VALUE, VALUE);
func1_t *t = reinterpret_cast<func1_t*>(q);
func2_t *y = reinterpret_cast<func2_t*>(e);
va_list ap;
va_start(ap, r);
VALUE ret = ::rb_vrescue2(t, w, y, r, ap);
va_end(ap);
return ret;
}
RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief An equivalent of `ensure` clause.
/// @param[in] q A function that can raise.
/// @param[in] w Passed to `q`.
/// @param[in] e A function that ensures.
/// @param[in] r Passed to `e`.
/// @return The return value of `q`.
/// @note It makes no sense to pass nullptr to `e`.
/// @see rb_rescue()
/// @see rb_rescue2()
/// @see rb_protect()
/// @deprecated Use granular typed overload instead.
inline VALUE
rb_ensure(type *q, VALUE w, type *e, VALUE r)
{
typedef VALUE func1_t(VALUE);
func1_t *t = reinterpret_cast<func1_t*>(q);
func1_t *y = reinterpret_cast<func1_t*>(e);
return ::rb_ensure(t, w, y, r);
}
RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief An equivalent of `Kernel#catch`.
/// @param[in] q The "tag" string.
/// @param[in] w A function that can throw.
/// @param[in] e Passed to `w`.
/// @return What was thrown.
/// @note `q` can be a nullptr but makes no sense to pass nullptr to`w`.
/// @see rb_block_call()
/// @see rb_protect()
/// @see rb_rb_catch_obj()
/// @see rb_rescue()
/// @deprecated Use granular typed overload instead.
inline VALUE
rb_catch(const char *q, type *w, VALUE e)
{
rb_block_call_func_t r = reinterpret_cast<rb_block_call_func_t>(w);
return ::rb_catch(q, r, e);
}
#ifdef HAVE_NULLPTR
inline VALUE
rb_catch(const char *q, std::nullptr_t w, VALUE e)
{
return ::rb_catch(q, w, e);
}
#endif
RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief An equivalent of `Kernel#catch`.
/// @param[in] q The "tag" object.
/// @param[in] w A function that can throw.
/// @param[in] e Passed to `w`.
/// @return What was thrown.
/// @note It makes no sense to pass nullptr to`w`.
/// @see rb_block_call()
/// @see rb_protect()
/// @see rb_rb_catch_obj()
/// @see rb_rescue()
/// @deprecated Use granular typed overload instead.
inline VALUE
rb_catch_obj(VALUE q, type *w, VALUE e)
{
rb_block_call_func_t r = reinterpret_cast<rb_block_call_func_t>(w);
return ::rb_catch_obj(q, r, e);
}
/// @}
/// @name Procs, Fibers and Threads
/// @{
RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief Creates a rb_cFiber instance.
/// @param[in] q The fiber body.
/// @param[in] w Passed to `q`.
/// @return What was allocated.
/// @note It makes no sense to pass nullptr to`q`.
/// @see rb_proc_new()
/// @see rb_thread_create()
/// @deprecated Use granular typed overload instead.
inline VALUE
rb_fiber_new(type *q, VALUE w)
{
rb_block_call_func_t e = reinterpret_cast<rb_block_call_func_t>(q);
return ::rb_fiber_new(e, w);
}
RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief Creates a @ref rb_cProc instance.
/// @param[in] q The proc body.
/// @param[in] w Passed to `q`.
/// @return What was allocated.
/// @note It makes no sense to pass nullptr to`q`.
/// @see rb_fiber_new()
/// @see rb_thread_create()
/// @deprecated Use granular typed overload instead.
inline VALUE
rb_proc_new(type *q, VALUE w)
{
rb_block_call_func_t e = reinterpret_cast<rb_block_call_func_t>(q);
return ::rb_proc_new(e, w);
}
RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief Creates a @ref rb_cThread instance.
/// @param[in] q The thread body.
/// @param[in] w Passed to `q`.
/// @return What was allocated.
/// @note It makes no sense to pass nullptr to`q`.
/// @see rb_proc_new()
/// @see rb_fiber_new()
/// @deprecated Use granular typed overload instead.
inline VALUE
rb_thread_create(type *q, void *w)
{
typedef VALUE ptr_t(void*);
ptr_t *e = reinterpret_cast<ptr_t*>(q);
return ::rb_thread_create(e, w);
}
/// @}
/// @name Hash and st_table
/// @{
RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief Iteration over the given table.
/// @param[in] q A table to scan.
/// @param[in] w A function to iterate.
/// @param[in] e Passed to `w`.
/// @retval 0 Always returns 0.
/// @note It makes no sense to pass nullptr to`w`.
/// @see st_foreach_check()
/// @see rb_hash_foreach()
/// @deprecated Use granular typed overload instead.
inline int
st_foreach(st_table *q, int_type *w, st_data_t e)
{
st_foreach_callback_func *r =
reinterpret_cast<st_foreach_callback_func*>(w);
return ::st_foreach(q, r, e);
}
RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief Iteration over the given table.
/// @param[in] q A table to scan.
/// @param[in] w A function to iterate.
/// @param[in] e Passed to `w`.
/// @retval 0 Successful end of iteration.
/// @retval 1 Element removed during traversing.
/// @note It makes no sense to pass nullptr to`w`.
/// @see st_foreach()
/// @deprecated Use granular typed overload instead.
inline int
st_foreach_check(st_table *q, int_type *w, st_data_t e, st_data_t)
{
st_foreach_check_callback_func *t =
reinterpret_cast<st_foreach_check_callback_func*>(w);
return ::st_foreach_check(q, t, e, 0);
}
RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief Iteration over the given table.
/// @param[in] q A table to scan.
/// @param[in] w A function to iterate.
/// @param[in] e Passed to `w`.
/// @note It makes no sense to pass nullptr to`w`.
/// @see st_foreach_check()
/// @deprecated Use granular typed overload instead.
inline void
st_foreach_safe(st_table *q, int_type *w, st_data_t e)
{
st_foreach_callback_func *r =
reinterpret_cast<st_foreach_callback_func*>(w);
::st_foreach_safe(q, r, e);
}
RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief Iteration over the given hash.
/// @param[in] q A hash to scan.
/// @param[in] w A function to iterate.
/// @param[in] e Passed to `w`.
/// @note It makes no sense to pass nullptr to`w`.
/// @see st_foreach()
/// @deprecated Use granular typed overload instead.
inline void
rb_hash_foreach(VALUE q, int_type *w, VALUE e)
{
st_foreach_callback_func *r =
reinterpret_cast<st_foreach_callback_func*>(w);
::rb_hash_foreach(q, r, e);
}
RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief Iteration over each instance variable of the object.
/// @param[in] q An object.
/// @param[in] w A function to iterate.
/// @param[in] e Passed to `w`.
/// @note It makes no sense to pass nullptr to`w`.
/// @see st_foreach()
/// @deprecated Use granular typed overload instead.
inline void
rb_ivar_foreach(VALUE q, int_type *w, VALUE e)
{
st_foreach_callback_func *r =
reinterpret_cast<st_foreach_callback_func*>(w);
::rb_ivar_foreach(q, r, e);
}
/// @}
/// Driver for *_define_method. ::rb_define_method function for instance takes
/// a pointer to ANYARGS-ed functions, which in fact varies 18 different
/// prototypes. We still need to preserve ANYARGS for storages but why not
/// check the consistencies if possible. In C++ a function has its own
/// prototype, which is a compile-time constant (static type) by nature. We
/// can list up all the possible input types and provide warnings for other
/// cases. This is such attempt.
namespace define_method {
/// Type of ::rb_f_notimplement().
typedef VALUE notimpl_type(int, const VALUE *, VALUE, VALUE);
/// @brief Template metaprogramming to generate function prototypes.
/// @tparam T Type of method id (`ID` or `const char*` in practice).
/// @tparam F Definition driver e.g. ::rb_define_method.
template<typename T, void (*F)(VALUE klass, T mid, type *func, int arity)>
struct driver {
/// @brief Defines a method
/// @tparam N Arity of the function.
/// @tparam U The function in question
template<int N, typename U>
struct engine {
/* :TODO: Following deprecation attribute renders tons of warnings (one
* per every method definitions), which is annoying. Of course
* annoyance is the core feature of deprecation warnings... But that
* could be too much, especially when the warnings happen inside of
* machine-generated programs. And SWIG is known to do such thing.
* The new (granular) API was introduced in API version 2.7. As of
* this writing the version is 2.8. Let's warn this later, some time
* during 3.x. Hopefully codes in old (ANYARGS-ed) format should be
* less than now. */
#if (RUBY_API_VERSION_MAJOR * 100 + RUBY_API_VERSION_MINOR) >= 301
RUBY_CXX_DEPRECATED("use of ANYARGS is deprecated")
#endif
/// @copydoc define(VALUE klass, T mid, U func)
/// @deprecated Pass correctly typed function instead.
static inline void
define(VALUE klass, T mid, type func)
{
F(klass, mid, func, N);
}
/// @brief Defines klass#mid as func, whose arity is N.
/// @param[in] klass Where the method lives.
/// @param[in] mid Name of the method to define.
/// @param[in] func Function that implements klass#mid.
static inline void
define(VALUE klass, T mid, U func)
{
F(klass, mid, reinterpret_cast<type *>(func), N);
}
/// @copydoc define(VALUE klass, T mid, U func)
static inline void
define(VALUE klass, T mid, notimpl_type func)
{
F(klass, mid, reinterpret_cast<type *>(func), N);
}
};
/// @cond INTERNAL_MACRO
template<int N, bool = false> struct specific : public engine<N, type *> {};
template<bool b> struct specific<15, b> : public engine<15, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
template<bool b> struct specific<14, b> : public engine<14, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
template<bool b> struct specific<13, b> : public engine<13, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
template<bool b> struct specific<12, b> : public engine<12, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
template<bool b> struct specific<11, b> : public engine<11, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
template<bool b> struct specific<10, b> : public engine<10, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
template<bool b> struct specific< 9, b> : public engine< 9, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
template<bool b> struct specific< 8, b> : public engine< 8, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
template<bool b> struct specific< 7, b> : public engine< 7, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
template<bool b> struct specific< 6, b> : public engine< 6, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
template<bool b> struct specific< 5, b> : public engine< 5, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
template<bool b> struct specific< 4, b> : public engine< 4, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE)> {};
template<bool b> struct specific< 3, b> : public engine< 3, VALUE(*)(VALUE, VALUE, VALUE, VALUE)> {};
template<bool b> struct specific< 2, b> : public engine< 2, VALUE(*)(VALUE, VALUE, VALUE)> {};
template<bool b> struct specific< 1, b> : public engine< 1, VALUE(*)(VALUE, VALUE)> {};
template<bool b> struct specific< 0, b> : public engine< 0, VALUE(*)(VALUE)> {};
template<bool b> struct specific<-1, b> : public engine<-1, VALUE(*)(int argc, VALUE *argv, VALUE self)> {
using engine<-1, VALUE(*)(int argc, VALUE *argv, VALUE self)>::define;
static inline void define(VALUE c, T m, VALUE(*f)(int argc, const VALUE *argv, VALUE self)) { F(c, m, reinterpret_cast<type *>(f), -1); }
};
template<bool b> struct specific<-2, b> : public engine<-2, VALUE(*)(VALUE, VALUE)> {};
/// @endcond
};
/* We could perhaps merge this struct into the one above using variadic
* template parameters if we could assume C++11, but sadly we cannot. */
/// @copydoc ruby::backward::cxxanyargs::define_method::driver
template<typename T, void (*F)(T mid, type func, int arity)>
struct driver0 {
/// @brief Defines a method
/// @tparam N Arity of the function.
/// @tparam U The function in question
template<int N, typename U>
struct engine {
RUBY_CXX_DEPRECATED("use of ANYARGS is deprecated")
/// @copydoc define(T mid, U func)
/// @deprecated Pass correctly typed function instead.
static inline void
define(T mid, type func)
{
F(mid, func, N);
}
/// @brief Defines Kernel#mid as func, whose arity is N.
/// @param[in] mid Name of the method to define.
/// @param[in] func Function that implements klass#mid.
static inline void
define(T mid, U func)
{
F(mid, reinterpret_cast<type *>(func), N);
}
/// @copydoc define(T mid, U func)
/// @deprecated Pass correctly typed function instead.
static inline void
define(T mid, notimpl_type func)
{
F(mid, reinterpret_cast<type *>(func), N);
}
};
/// @cond INTERNAL_MACRO
template<int N, bool = false> struct specific : public engine<N, type *> {};
template<bool b> struct specific<15, b> : public engine<15, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
template<bool b> struct specific<14, b> : public engine<14, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
template<bool b> struct specific<13, b> : public engine<13, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
template<bool b> struct specific<12, b> : public engine<12, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
template<bool b> struct specific<11, b> : public engine<11, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
template<bool b> struct specific<10, b> : public engine<10, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
template<bool b> struct specific< 9, b> : public engine< 9, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
template<bool b> struct specific< 8, b> : public engine< 8, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
template<bool b> struct specific< 7, b> : public engine< 7, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
template<bool b> struct specific< 6, b> : public engine< 6, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
template<bool b> struct specific< 5, b> : public engine< 5, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)> {};
template<bool b> struct specific< 4, b> : public engine< 4, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE)> {};
template<bool b> struct specific< 3, b> : public engine< 3, VALUE(*)(VALUE, VALUE, VALUE, VALUE)> {};
template<bool b> struct specific< 2, b> : public engine< 2, VALUE(*)(VALUE, VALUE, VALUE)> {};
template<bool b> struct specific< 1, b> : public engine< 1, VALUE(*)(VALUE, VALUE)> {};
template<bool b> struct specific< 0, b> : public engine< 0, VALUE(*)(VALUE)> {};
template<bool b> struct specific<-1, b> : public engine<-1, VALUE(*)(int argc, VALUE *argv, VALUE self)> {
using engine<-1, VALUE(*)(int argc, VALUE *argv, VALUE self)>::define;
static inline void define(T m, VALUE(*f)(int argc, const VALUE *argv, VALUE self)) { F(m, reinterpret_cast<type *>(f), -1); }
};
template<bool b> struct specific<-2, b> : public engine<-2, VALUE(*)(VALUE, VALUE)> {};
/// @endcond
};
struct rb_define_method : public driver <const char *, ::rb_define_method> {}; ///< Dispatches appropriate driver for ::rb_define_method.
struct rb_define_method_id : public driver <ID, ::rb_define_method_id> {}; ///< Dispatches appropriate driver for ::rb_define_method_id.
struct rb_define_private_method : public driver <const char *, ::rb_define_private_method> {}; ///< Dispatches appropriate driver for ::rb_define_private_method.
struct rb_define_protected_method : public driver <const char *, ::rb_define_protected_method> {}; ///< Dispatches appropriate driver for ::rb_define_protected_method.
struct rb_define_singleton_method : public driver <const char *, ::rb_define_singleton_method> {}; ///< Dispatches appropriate driver for ::rb_define_singleton_method.
struct rb_define_module_function : public driver <const char *, ::rb_define_module_function> {}; ///< Dispatches appropriate driver for ::rb_define_module_function.
struct rb_define_global_function : public driver0<const char *, ::rb_define_global_function> {}; ///< Dispatches appropriate driver for ::rb_define_global_function.
/// @brief Defines klass\#mid.
/// @param klass Where the method lives.
/// @copydetails #rb_define_global_function(mid, func, arity)
#define rb_define_method(klass, mid, func, arity) ::ruby::backward::cxxanyargs::define_method::rb_define_method::specific<arity>::define(klass, mid, func)
/// @copydoc #rb_define_method(klass, mid, func, arity)
#define rb_define_method_id(klass, mid, func, arity) ::ruby::backward::cxxanyargs::define_method::rb_define_method_id::specific<arity>::define(klass, mid, func)
/// @brief Defines klass\#mid and makes it private.
/// @copydetails #rb_define_method(klass, mid, func, arity)
#define rb_define_private_method(klass, mid, func, arity) ::ruby::backward::cxxanyargs::define_method::rb_define_private_method::specific<arity>::define(klass, mid, func)
/// @brief Defines klass\#mid and makes it protected.
/// @copydetails #rb_define_method
#define rb_define_protected_method(klass, mid, func, arity) ::ruby::backward::cxxanyargs::define_method::rb_define_protected_method::specific<arity>::define(klass, mid, func)
/// @brief Defines klass.mid.(klass, mid, func, arity)
/// @copydetails #rb_define_method
#define rb_define_singleton_method(klass, mid, func, arity) ::ruby::backward::cxxanyargs::define_method::rb_define_singleton_method::specific<arity>::define(klass, mid, func)
/// @brief Defines klass\#mid and makes it a module function.
/// @copydetails #rb_define_method(klass, mid, func, arity)
#define rb_define_module_function(klass, mid, func, arity) ::ruby::backward::cxxanyargs::define_method::rb_define_module_function::specific<arity>::define(klass, mid, func)
/// @brief Defines ::rb_mKernel \#mid.
/// @param mid Name of the defining method.
/// @param func Implementation of \#mid.
/// @param arity Arity of \#mid.
#define rb_define_global_function(mid, func, arity) ::ruby::backward::cxxanyargs::define_method::rb_define_global_function::specific<arity>::define(mid, func)
}}}}}
using namespace ruby::backward::cxxanyargs;
#endif // RUBY_BACKWARD_CXXANYARGS_HPP

View File

@@ -1,505 +0,0 @@
#ifndef INCLUDE_RUBY_CONFIG_H
#define INCLUDE_RUBY_CONFIG_H 1
/* confdefs.h */
#define HAVE_STDIO_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define HAVE_STRINGS_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_UNISTD_H 1
#define HAVE_WCHAR_H 1
#define STDC_HEADERS 1
#define _ALL_SOURCE 1
#define _DARWIN_C_SOURCE 1
#define _GNU_SOURCE 1
#define _HPUX_ALT_XOPEN_SOCKET_API 1
#define _NETBSD_SOURCE 1
#define _OPENBSD_SOURCE 1
#define _POSIX_PTHREAD_SEMANTICS 1
#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1
#define __STDC_WANT_IEC_60559_BFP_EXT__ 1
#define __STDC_WANT_IEC_60559_DFP_EXT__ 1
#define __STDC_WANT_IEC_60559_EXT__ 1
#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1
#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1
#define __STDC_WANT_LIB_EXT2__ 1
#define __STDC_WANT_MATH_SPEC_FUNCS__ 1
#define _TANDEM_SOURCE 1
#define __EXTENSIONS__ 1
#define RUBY_SYMBOL_EXPORT_BEGIN _Pragma("GCC visibility push(default)")
#define RUBY_SYMBOL_EXPORT_END _Pragma("GCC visibility pop")
#define HAVE_STMT_AND_DECL_IN_EXPR 1
#define HAVE_PTHREAD_H 1
#define _REENTRANT 1
#define _THREAD_SAFE 1
#define HAVE_LIBPTHREAD 1
#define THREAD_IMPL_H "thread_pthread.h"
#define THREAD_IMPL_SRC "thread_pthread.c"
#define HAVE_LIBCRYPT 1
#define HAVE_LIBDL 1
#define HAVE_DIRENT_H 1
#define HAVE__BOOL 1
#define HAVE_STDBOOL_H 1
#define HAVE_SYS_WAIT_H 1
#define HAVE_GRP_H 1
#define HAVE_FCNTL_H 1
#define HAVE_FLOAT_H 1
#define HAVE_LANGINFO_H 1
#define HAVE_LIMITS_H 1
#define HAVE_LOCALE_H 1
#define HAVE_MALLOC_H 1
#define HAVE_PWD_H 1
#define HAVE_SANITIZER_ASAN_INTERFACE_H 1
#define HAVE_STDALIGN_H 1
#define HAVE_STDIO_H 1
#define HAVE_SYS_EVENTFD_H 1
#define HAVE_SYS_FCNTL_H 1
#define HAVE_SYS_FILE_H 1
#define HAVE_SYS_IOCTL_H 1
#define HAVE_SYS_PARAM_H 1
#define HAVE_SYS_PRCTL_H 1
#define HAVE_SYS_RANDOM_H 1
#define HAVE_SYS_RESOURCE_H 1
#define HAVE_SYS_SELECT_H 1
#define HAVE_SYS_SENDFILE_H 1
#define HAVE_SYS_SOCKET_H 1
#define HAVE_SYS_SYSCALL_H 1
#define HAVE_SYS_SYSMACROS_H 1
#define HAVE_SYS_TIME_H 1
#define HAVE_SYS_TIMES_H 1
#define HAVE_SYS_UIO_H 1
#define HAVE_SYSCALL_H 1
#define HAVE_TIME_H 1
#define HAVE_UCONTEXT_H 1
#define HAVE_UTIME_H 1
#define HAVE_SYS_EPOLL_H 1
#define HAVE_STDCKDINT_H 1
#define HAVE_STDATOMIC_H 1
#define HAVE_X86INTRIN_H 1
#if defined(__x86_64__)
#define HAVE_X86INTRIN_H 1
#endif
#define HAVE_GMP_H 1
#define HAVE_LIBGMP 1
#define HAVE_TYPEOF 1
#define restrict __restrict__
#define HAVE_LONG_LONG 1
#define HAVE_OFF_T 1
#define SIZEOF_INT 4
#define SIZEOF_SHORT 2
#define SIZEOF_LONG 8
#define SIZEOF_LONG_LONG 8
#define SIZEOF___INT64 0
#define SIZEOF___INT128 16
#define SIZEOF_OFF_T 8
#define SIZEOF_VOIDP 8
#define SIZEOF_FLOAT 4
#define SIZEOF_DOUBLE 8
#define SIZEOF_TIME_T 8
#define SIZEOF_CLOCK_T 8
#define RBIMPL_ATTR_PACKED_STRUCT_BEGIN()
#define RBIMPL_ATTR_PACKED_STRUCT_END() __attribute__((packed))
#define USE_UNALIGNED_MEMBER_ACCESS 1
#define PRI_LL_PREFIX "ll"
#define HAVE_PID_T 1
#define rb_pid_t pid_t
#define SIGNEDNESS_OF_PID_T -1
#define PIDT2NUM(v) INT2NUM(v)
#define NUM2PIDT(v) NUM2INT(v)
#define PRI_PIDT_PREFIX PRI_INT_PREFIX
#define HAVE_UID_T 1
#define rb_uid_t uid_t
#define SIGNEDNESS_OF_UID_T +1
#define UIDT2NUM(v) UINT2NUM(v)
#define NUM2UIDT(v) NUM2UINT(v)
#define PRI_UIDT_PREFIX PRI_INT_PREFIX
#define HAVE_GID_T 1
#define rb_gid_t gid_t
#define SIGNEDNESS_OF_GID_T +1
#define GIDT2NUM(v) UINT2NUM(v)
#define NUM2GIDT(v) NUM2UINT(v)
#define PRI_GIDT_PREFIX PRI_INT_PREFIX
#define HAVE_TIME_T 1
#define rb_time_t time_t
#define SIGNEDNESS_OF_TIME_T -1
#define TIMET2NUM(v) LONG2NUM(v)
#define NUM2TIMET(v) NUM2LONG(v)
#define PRI_TIMET_PREFIX PRI_LONG_PREFIX
#define HAVE_DEV_T 1
#define rb_dev_t dev_t
#define SIGNEDNESS_OF_DEV_T +1
#define DEVT2NUM(v) ULONG2NUM(v)
#define NUM2DEVT(v) NUM2ULONG(v)
#define PRI_DEVT_PREFIX PRI_LONG_PREFIX
#define HAVE_MODE_T 1
#define rb_mode_t mode_t
#define SIGNEDNESS_OF_MODE_T +1
#define MODET2NUM(v) UINT2NUM(v)
#define NUM2MODET(v) NUM2UINT(v)
#define PRI_MODET_PREFIX PRI_INT_PREFIX
#define HAVE_RLIM_T 1
#define rb_rlim_t rlim_t
#define SIGNEDNESS_OF_RLIM_T +1
#define RLIM2NUM(v) ULONG2NUM(v)
#define NUM2RLIM(v) NUM2ULONG(v)
#define PRI_RLIM_PREFIX PRI_LONG_PREFIX
#define HAVE_OFF_T 1
#define rb_off_t off_t
#define SIGNEDNESS_OF_OFF_T -1
#define OFFT2NUM(v) LONG2NUM(v)
#define NUM2OFFT(v) NUM2LONG(v)
#define PRI_OFFT_PREFIX PRI_LONG_PREFIX
#define HAVE_CLOCKID_T 1
#define rb_clockid_t clockid_t
#define SIGNEDNESS_OF_CLOCKID_T -1
#define CLOCKID2NUM(v) INT2NUM(v)
#define NUM2CLOCKID(v) NUM2INT(v)
#define PRI_CLOCKID_PREFIX PRI_INT_PREFIX
#define HAVE_VA_ARGS_MACRO 1
#define HAVE__ALIGNOF 1
#define CONSTFUNC(x) __attribute__((__const__)) x
#define PUREFUNC(x) __attribute__((__pure__)) x
#define NORETURN(x) __attribute__((__noreturn__)) x
#define DEPRECATED(x) __attribute__((__deprecated__)) x
#define DEPRECATED_BY(n, x) __attribute__((__deprecated__("by " #n))) x
#define NOINLINE(x) __attribute__((__noinline__)) x
#define ALWAYS_INLINE(x) __attribute__((__always_inline__)) x
#define NO_SANITIZE(san, x) __attribute__((__no_sanitize__(san))) x
#define NO_SANITIZE_ADDRESS(x) __attribute__((__no_sanitize_address__)) x
#define NO_ADDRESS_SAFETY_ANALYSIS(x) \
__attribute__((__no_address_safety_analysis__)) x
#define WARN_UNUSED_RESULT(x) __attribute__((__warn_unused_result__)) x
#define MAYBE_UNUSED(x) __attribute__((__unused__)) x
#define ERRORFUNC(mesg, x) __attribute__((__error__ mesg)) x
#define WARNINGFUNC(mesg, x) __attribute__((__warning__ mesg)) x
#define WEAK(x) __attribute__((__weak__)) x
#define HAVE_FUNC_WEAK 1
#define RUBY_CXX_DEPRECATED(msg) __attribute__((__deprecated__(msg)))
#define HAVE_NULLPTR 1
#define FUNC_UNOPTIMIZED(x) __attribute__((__optimize__("O0"))) x
#define FUNC_MINIMIZED(x) \
__attribute__((__optimize__("-Os", "-fomit-frame-pointer"))) x
#define HAVE_ATTRIBUTE_FUNCTION_ALIAS 1
#define RUBY_ALIAS_FUNCTION_TYPE(type, prot, name, args) \
type prot __attribute__((alias(#name)));
#define RUBY_ALIAS_FUNCTION_VOID(prot, name, args) \
RUBY_ALIAS_FUNCTION_TYPE(void, prot, name, args)
#define HAVE_GCC_ATOMIC_BUILTINS 1
#define HAVE_GCC_SYNC_BUILTINS 1
#define HAVE___BUILTIN_UNREACHABLE 1
#define RUBY_FUNC_EXPORTED __attribute__((__visibility__("default"))) extern
#define RUBY_FUNC_NONNULL(n, x) __attribute__((__nonnull__(n))) x
#define RUBY_FUNCTION_NAME_STRING __func__
#define ENUM_OVER_INT 1
#define HAVE_DECL_SYS_NERR 0
#define HAVE_DECL_GETENV 1
#define SIZEOF_SIZE_T 8
#define SIZEOF_PTRDIFF_T 8
#define SIZEOF_DEV_T 8
#define PRI_SIZE_PREFIX "z"
#define PRI_PTRDIFF_PREFIX "t"
#define HAVE_STRUCT_STAT_ST_BLKSIZE 1
#define HAVE_STRUCT_STAT_ST_BLOCKS 1
#define HAVE_STRUCT_STAT_ST_RDEV 1
#define SIZEOF_STRUCT_STAT_ST_SIZE SIZEOF_OFF_T
#define SIZEOF_STRUCT_STAT_ST_BLOCKS SIZEOF_OFF_T
#define SIZEOF_STRUCT_STAT_ST_INO SIZEOF_LONG
#define SIZEOF_STRUCT_STAT_ST_DEV SIZEOF_DEV_T
#define SIZEOF_STRUCT_STAT_ST_RDEV SIZEOF_DEV_T
#define HAVE_STRUCT_STAT_ST_ATIM 1
#define HAVE_STRUCT_STAT_ST_MTIM 1
#define HAVE_STRUCT_STAT_ST_CTIM 1
#define HAVE_STRUCT_STATX_STX_BTIME 1
#define HAVE_STRUCT_TIMEVAL 1
#define SIZEOF_STRUCT_TIMEVAL_TV_SEC SIZEOF_TIME_T
#define HAVE_STRUCT_TIMESPEC 1
#define HAVE_STRUCT_TIMEZONE 1
#define HAVE_RB_FD_INIT 1
#define HAVE_INT8_T 1
#define SIZEOF_INT8_T 1
#define HAVE_UINT8_T 1
#define SIZEOF_UINT8_T 1
#define HAVE_INT16_T 1
#define SIZEOF_INT16_T 2
#define HAVE_UINT16_T 1
#define SIZEOF_UINT16_T 2
#define HAVE_INT32_T 1
#define SIZEOF_INT32_T 4
#define HAVE_UINT32_T 1
#define SIZEOF_UINT32_T 4
#define HAVE_INT64_T 1
#define SIZEOF_INT64_T 8
#define HAVE_UINT64_T 1
#define SIZEOF_UINT64_T 8
#define HAVE_INT128_T 1
#define int128_t __int128
#define SIZEOF_INT128_T SIZEOF___INT128
#define HAVE_UINT128_T 1
#define uint128_t unsigned __int128
#define SIZEOF_UINT128_T SIZEOF___INT128
#define HAVE_INTPTR_T 1
#define SIZEOF_INTPTR_T 8
#define HAVE_UINTPTR_T 1
#define SIZEOF_UINTPTR_T 8
#define HAVE_SSIZE_T 1
#define SIZEOF_SSIZE_T 8
#define STACK_END_ADDRESS __libc_stack_end
#define GETGROUPS_T gid_t
#define HAVE_ALLOCA_H 1
#define HAVE_ALLOCA 1
#define HAVE_DUP 1
#define HAVE_DUP2 1
#define HAVE_ACOSH 1
#define HAVE_CBRT 1
#define HAVE_CRYPT 1
#define HAVE_ERF 1
#define HAVE_EXPLICIT_BZERO 1
#define HAVE_FFS 1
#define HAVE_FLOCK 1
#define HAVE_HYPOT 1
#define HAVE_LGAMMA_R 1
#define HAVE_MEMMOVE 1
#define HAVE_NAN 1
#define HAVE_NEXTAFTER 1
#define HAVE_STRCHR 1
#define HAVE_STRERROR 1
#define HAVE_STRLCAT 1
#define HAVE_STRLCPY 1
#define HAVE_STRSTR 1
#define HAVE_TGAMMA 1
#define HAVE_ISFINITE 1
#define SPT_TYPE SPT_REUSEARGV
#define HAVE_SIGNBIT 1
#define HAVE_FORK 1
#define HAVE_VFORK 1
#define HAVE_WORKING_VFORK 1
#define HAVE_WORKING_FORK 1
#define HAVE__LONGJMP 1
#define HAVE_ARC4RANDOM_BUF 1
#define HAVE_ATAN2L 1
#define HAVE_ATAN2F 1
#define HAVE_DECL_ATOMIC_SIGNAL_FENCE 1
#define HAVE_CHMOD 1
#define HAVE_CHOWN 1
#define HAVE_CHROOT 1
#define HAVE_CLOCK_GETTIME 1
#define HAVE_COPY_FILE_RANGE 1
#define HAVE_COSH 1
#define HAVE_CRYPT_R 1
#define HAVE_DIRFD 1
#define HAVE_DL_ITERATE_PHDR 1
#define HAVE_DLOPEN 1
#define HAVE_DLADDR 1
#define HAVE_DUP3 1
#define HAVE_EACCESS 1
#define HAVE_ENDGRENT 1
#define HAVE_EVENTFD 1
#define HAVE_EXECL 1
#define HAVE_EXECLE 1
#define HAVE_EXECV 1
#define HAVE_EXECVE 1
#define HAVE_FCHDIR 1
#define HAVE_FCHMOD 1
#define HAVE_FCHOWN 1
#define HAVE_FCNTL 1
#define HAVE_FDATASYNC 1
#define HAVE_FDOPENDIR 1
#define HAVE_FMOD 1
#define HAVE_FSTATAT 1
#define HAVE_FSYNC 1
#define HAVE_FTRUNCATE 1
#define HAVE_FTRUNCATE64 1
#define HAVE_GETCWD 1
#define HAVE_GETEGID 1
#define HAVE_GETENTROPY 1
#define HAVE_GETEUID 1
#define HAVE_GETGID 1
#define HAVE_GETGRNAM 1
#define HAVE_GETGRNAM_R 1
#define HAVE_GETGROUPS 1
#define HAVE_GETLOGIN 1
#define HAVE_GETLOGIN_R 1
#define HAVE_GETPGID 1
#define HAVE_GETPGRP 1
#define HAVE_GETPPID 1
#define HAVE_GETPRIORITY 1
#define HAVE_GETPWNAM 1
#define HAVE_GETPWNAM_R 1
#define HAVE_GETPWUID 1
#define HAVE_GETPWUID_R 1
#define HAVE_GETRANDOM 1
#define HAVE_GETRESGID 1
#define HAVE_GETRESUID 1
#define HAVE_GETRLIMIT 1
#define HAVE_GETSID 1
#define HAVE_GETTIMEOFDAY 1
#define HAVE_GETUID 1
#define HAVE_GMTIME_R 1
#define HAVE_INITGROUPS 1
#define HAVE_IOCTL 1
#define HAVE_KILL 1
#define HAVE_KILLPG 1
#define HAVE_LCHMOD 1
#define HAVE_LCHOWN 1
#define HAVE_LINK 1
#define HAVE_LLABS 1
#define HAVE_LOCKF 1
#define HAVE_LOG2 1
#define HAVE_LSTAT 1
#define HAVE_LUTIMES 1
#define HAVE_MALLOC_USABLE_SIZE 1
#define HAVE_MALLOC_TRIM 1
#define HAVE_MBLEN 1
#define HAVE_MEMALIGN 1
#define HAVE_WRITEV 1
#define HAVE_MEMRCHR 1
#define HAVE_MEMMEM 1
#define HAVE_MKFIFO 1
#define HAVE_MKNOD 1
#define HAVE_MKTIME 1
#define HAVE_MMAP 1
#define HAVE_MREMAP 1
#define HAVE_OPENAT 1
#define HAVE_PCLOSE 1
#define HAVE_PIPE 1
#define HAVE_PIPE2 1
#define HAVE_POLL 1
#define HAVE_POPEN 1
#define HAVE_POSIX_FADVISE 1
#define HAVE_POSIX_MADVISE 1
#define HAVE_POSIX_MEMALIGN 1
#define HAVE_PPOLL 1
#define HAVE_PREAD 1
#define HAVE_PWRITE 1
#define HAVE_QSORT_R 1
#define HAVE_READLINK 1
#define HAVE_REALPATH 1
#define HAVE_ROUND 1
#define HAVE_SCHED_GETAFFINITY 1
#define HAVE_SEEKDIR 1
#define HAVE_SENDFILE 1
#define HAVE_SETEGID 1
#define HAVE_SETENV 1
#define HAVE_SETEUID 1
#define HAVE_SETGID 1
#define HAVE_SETGROUPS 1
#define HAVE_SETPGID 1
#define HAVE_SETPGRP 1
#define HAVE_SETREGID 1
#define HAVE_SETRESGID 1
#define HAVE_SETRESUID 1
#define HAVE_SETREUID 1
#define HAVE_SETRLIMIT 1
#define HAVE_SETSID 1
#define HAVE_SETUID 1
#define HAVE_SHUTDOWN 1
#define HAVE_SIGACTION 1
#define HAVE_SIGALTSTACK 1
#define HAVE_SIGPROCMASK 1
#define HAVE_SINH 1
#define HAVE_SNPRINTF 1
#define HAVE_SYMLINK 1
#define HAVE_SYSCALL 1
#define HAVE_SYSCONF 1
#define HAVE_SYSTEM 1
#define HAVE_TANH 1
#define HAVE_TELLDIR 1
#define HAVE_TIMEGM 1
#define HAVE_TIMES 1
#define HAVE_TRUNCATE 1
#define HAVE_TRUNCATE64 1
#define HAVE_TZSET 1
#define HAVE_UMASK 1
#define HAVE_UNSETENV 1
#define HAVE_UTIMENSAT 1
#define HAVE_UTIMES 1
#define HAVE_WAIT4 1
#define HAVE_WAITPID 1
#define HAVE_STATX 1
#define HAVE_CRYPT_H 1
#define HAVE_STRUCT_CRYPT_DATA_INITIALIZED 1
#define HAVE_BUILTIN___BUILTIN_ALLOCA_WITH_ALIGN 1
#define HAVE_BUILTIN___BUILTIN_ASSUME_ALIGNED 1
#define HAVE_BUILTIN___BUILTIN_BSWAP16 1
#define HAVE_BUILTIN___BUILTIN_BSWAP32 1
#define HAVE_BUILTIN___BUILTIN_BSWAP64 1
#define HAVE_BUILTIN___BUILTIN_POPCOUNT 1
#define HAVE_BUILTIN___BUILTIN_POPCOUNTLL 1
#define HAVE_BUILTIN___BUILTIN_CLZ 1
#define HAVE_BUILTIN___BUILTIN_CLZL 1
#define HAVE_BUILTIN___BUILTIN_CLZLL 1
#define HAVE_BUILTIN___BUILTIN_CTZ 1
#define HAVE_BUILTIN___BUILTIN_CTZLL 1
#define HAVE_BUILTIN___BUILTIN_CONSTANT_P 1
#define HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR 1
#define HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P 1
#define HAVE_BUILTIN___BUILTIN_TYPES_COMPATIBLE_P 1
#define HAVE_BUILTIN___BUILTIN_TRAP 1
#define HAVE_BUILTIN___BUILTIN_EXPECT 1
#define HAVE_BUILTIN___BUILTIN_ADD_OVERFLOW 1
#define HAVE_BUILTIN___BUILTIN_ADD_OVERFLOW_P 1
#define USE___BUILTIN_ADD_OVERFLOW_LONG_LONG 1
#define HAVE_BUILTIN___BUILTIN_SUB_OVERFLOW 1
#define HAVE_BUILTIN___BUILTIN_SUB_OVERFLOW_P 1
#define USE___BUILTIN_SUB_OVERFLOW_LONG_LONG 1
#define HAVE_BUILTIN___BUILTIN_MUL_OVERFLOW 1
#define HAVE_BUILTIN___BUILTIN_MUL_OVERFLOW_P 1
#define USE___BUILTIN_MUL_OVERFLOW_LONG_LONG 1
#define HAVE_GNU_QSORT_R 1
#define ATAN2_INF_C99 1
#define HAVE_CLOCK_GETRES 1
#define HAVE_LIBRT 1
#define HAVE_LIBRT 1
#define HAVE_TIMER_CREATE 1
#define HAVE_TIMER_SETTIME 1
#define HAVE_STRUCT_TM_TM_ZONE 1
#define HAVE_TM_ZONE 1
#define HAVE_STRUCT_TM_TM_GMTOFF 1
#define HAVE_DAYLIGHT 1
#define NEGATIVE_TIME_T 1
#define POSIX_SIGNAL 1
#define HAVE_SIG_T 1
#define RSHIFT(x, y) ((x) >> (int)(y))
#define USE_COPY_FILE_RANGE 1
#define HAVE__SC_CLK_TCK 1
#define STACK_GROW_DIRECTION -1
#define COROUTINE_H "coroutine/amd64/Context.h"
#define HAVE_SCHED_YIELD 1
#define HAVE_PTHREAD_ATTR_SETINHERITSCHED 1
#define HAVE_PTHREAD_ATTR_GETSTACK 1
#define HAVE_PTHREAD_ATTR_GETGUARDSIZE 1
#define HAVE_PTHREAD_CONDATTR_SETCLOCK 1
#define HAVE_PTHREAD_SETNAME_NP 1
#define HAVE_PTHREAD_SIGMASK 1
#define HAVE_PTHREAD_GETATTR_NP 1
#define SET_CURRENT_THREAD_NAME(name) pthread_setname_np(pthread_self(), name)
#define SET_ANOTHER_THREAD_NAME(thid, name) pthread_setname_np(thid, name)
#define RB_THREAD_LOCAL_SPECIFIER _Thread_local
#define DEFINE_MCONTEXT_PTR(mc, uc) mcontext_t *mc = &(uc)->uc_mcontext
#define HAVE_GETCONTEXT 1
#define HAVE_SETCONTEXT 1
#define HAVE_SYS_USER_H 1
#define HAVE_CONST_PAGE_SIZE 0
#define IOCTL_REQ_TYPE unsigned long
#define NUM2IOCTLREQ(num) NUM2ULONG(num)
#define USE_ELF 1
#define HAVE_ELF_H 1
#define HAVE_LIBZ 1
#define HAVE_BACKTRACE 1
#define DLEXT_MAXLEN 3
#define DLEXT ".so"
#define SOEXT ".so"
#define LIBDIR_BASENAME "lib"
#define HAVE__SETJMP 1
#define RUBY_SETJMP(env) _setjmp((env))
#define RUBY_LONGJMP(env, val) _longjmp((env), val)
#define RUBY_JMP_BUF jmp_buf
#define USE_MODULAR_GC 0
#define USE_YJIT 1
#define USE_RJIT 1
#define RUBY_PLATFORM "x86_64-linux"
#define RB_DEFAULT_PARSER RB_DEFAULT_PARSER_PRISM
#endif /* INCLUDE_RUBY_CONFIG_H */

View File

@@ -1,667 +0,0 @@
#ifndef RB_DEBUG_H /*-*-C++-*-vi:se ft=cpp:*/
#define RB_DEBUG_H 1
/**
* @file
* @author $Author: ko1 $
* @date Tue Nov 20 20:35:08 2012
* @copyright Copyright (C) 2012 Yukihiro Matsumoto
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
*/
#include "ruby/internal/attr/nonnull.h"
#include "ruby/internal/attr/returns_nonnull.h"
#include "ruby/internal/dllexport.h"
#include "ruby/internal/event.h"
#include "ruby/internal/value.h"
RBIMPL_SYMBOL_EXPORT_BEGIN()
/* Note: This file contains experimental APIs. */
/* APIs can be replaced at Ruby 2.0.1 or later */
/**
* @name Frame-profiling APIs
*
* @{
*/
RBIMPL_ATTR_NONNULL((3))
/**
* Queries mysterious "frame"s of the given range.
*
* The returned values are opaque backtrace pointers, which you are allowed to
* issue a very limited set of operations listed below. Don't call arbitrary
* ruby methods.
*
* @param[in] start Start position (0 means the topmost).
* @param[in] limit Number objects of `buff`.
* @param[out] buff Return buffer.
* @param[out] lines Return buffer.
* @return Number of objects filled into `buff`.
* @post `buff` is filled with backtrace pointers.
* @post `lines` is filled with `__LINE__` of each backtraces.
*
* @internal
*
* @shyouhei doesn't like this abuse of ::VALUE. It should have been
* `const struct rb_callable_method_entry_struct *`.
*/
int rb_profile_frames(int start, int limit, VALUE *buff, int *lines);
/**
* Queries the path of the passed backtrace.
*
* @param[in] frame What rb_profile_frames() returned.
* @retval RUBY_Qnil The frame is implemented in C etc.
* @retval otherwise Where `frame` is running.
*/
VALUE rb_profile_frame_path(VALUE frame);
/**
* Identical to rb_profile_frame_path(), except it tries to expand the
* returning path. In case the path is `require`-d from something else
* rb_profile_frame_path() can return relative paths. This one tries to avoid
* that.
*
* @param[in] frame What rb_profile_frames() returned.
* @retval "<cfunc>" The frame is in C.
* @retval RUBY_Qnil Can't infer real path (inside of `eval` etc.).
* @retval otherwise Where `frame` is running.
*/
VALUE rb_profile_frame_absolute_path(VALUE frame);
/**
* Queries human-readable "label" string. This is `"<main>"` for the toplevel,
* `"<compiled>"` for evaluated ones, method name for methods, class name for
* classes.
*
* @param[in] frame What rb_profile_frames() returned.
* @retval RUBY_Qnil Can't infer the label (C etc.).
* @retval "<main>" The frame is global toplevel.
* @retval "<compiled>" The frame is dynamic.
* @retval otherwise Label of the frame.
*/
VALUE rb_profile_frame_label(VALUE frame);
/**
* Identical to rb_profile_frame_label(), except it does not "qualify" the
* result. Consider the following backtrace:
*
* ```ruby
* def bar
* caller_locations
* end
*
* def foo
* [1].map { bar }.first
* end
*
* obj = foo.first
* obj.label # => "block in foo"
* obj.base_label # => "foo"
* ```
*
* @param[in] frame What rb_profile_frames() returned.
* @retval RUBY_Qnil Can't infer the label (C etc.).
* @retval "<main>" The frame is global toplevel.
* @retval "<compiled>" The frame is dynamic.
* @retval otherwise Base label of the frame.
*/
VALUE rb_profile_frame_base_label(VALUE frame);
/**
* Identical to rb_profile_frame_label(), except it returns a qualified result.
*
* @param[in] frame What rb_profile_frames() returned.
* @retval RUBY_Qnil Can't infer the label (C etc.).
* @retval "<main>" The frame is global toplevel.
* @retval "<compiled>" The frame is dynamic.
* @retval otherwise Qualified label of the frame.
*
* @internal
*
* As of writing there is no way to obtain this return value from a Ruby
* script. This may change in future (it took 8 years and still no progress,
* though).
*/
VALUE rb_profile_frame_full_label(VALUE frame);
/**
* Queries the first line of the method of the passed frame pointer. Can be
* handy when for instance a debugger want to display the frame in question.
*
* @param[in] frame What rb_profile_frames() returned.
* @retval RUBY_Qnil Can't infer the line (C etc.).
* @retval otherwise Line number of the method in question.
*/
VALUE rb_profile_frame_first_lineno(VALUE frame);
/**
* Queries the class path of the method that the passed frame represents.
*
* @param[in] frame What rb_profile_frames() returned.
* @retval RUBY_Qnil Can't infer the class (global toplevel etc.).
* @retval otherwise Class path as in rb_class_path().
*/
VALUE rb_profile_frame_classpath(VALUE frame);
/**
* Queries if the method of the passed frame is a singleton class.
*
* @param[in] frame What rb_profile_frames() returned.
* @retval RUBY_Qtrue It is a singleton method.
* @retval RUBY_Qfalse Otherwise (normal method/non-method).
*/
VALUE rb_profile_frame_singleton_method_p(VALUE frame);
/**
* Queries the name of the method of the passed frame.
*
* @param[in] frame What rb_profile_frames() returned.
* @retval RUBY_Qnil The frame in question is not a method.
* @retval otherwise Name of the method of the frame.
*/
VALUE rb_profile_frame_method_name(VALUE frame);
/**
* Identical to rb_profile_frame_method_name(), except it "qualifies" the
* return value with its defining class.
*
* @param[in] frame What rb_profile_frames() returned.
* @retval RUBY_Qnil The frame in question is not a method.
* @retval otherwise Qualified name of the method of the frame.
*/
VALUE rb_profile_frame_qualified_method_name(VALUE frame);
/** @} */
/**
* @name Debug inspector APIs
*
* @{
*/
/** Opaque struct representing a debug inspector. */
typedef struct rb_debug_inspector_struct rb_debug_inspector_t;
/**
* Type of the callback function passed to rb_debug_inspector_open().
* Inspection shall happen only inside of them. The passed pointers gets
* invalidated once after the callback returns.
*
* @param[in] dc A debug context.
* @param[in,out] data What was passed to rb_debug_inspector_open().
* @return What would be the return value of rb_debug_inspector_open().
*/
typedef VALUE (*rb_debug_inspector_func_t)(const rb_debug_inspector_t *dc, void *data);
/**
* Prepares, executes, then cleans up a debug session.
*
* @param[in] func A callback to run inside of a debug session.
* @param[in,out] data Passed as-is to `func`.
* @return What was returned from `func`.
*/
VALUE rb_debug_inspector_open(rb_debug_inspector_func_t func, void *data);
/**
* Queries the backtrace object of the context. This is as if you call
* `caller_locations` at the point of debugger.
*
* @param[in] dc A debug context.
* @return An array of `Thread::Backtrace::Location` which represents the
* current point of execution at `dc`.
*/
VALUE rb_debug_inspector_backtrace_locations(const rb_debug_inspector_t *dc);
/**
* Queries the current receiver of the passed context's upper frame.
*
* @param[in] dc A debug context.
* @param[in] index Index of the frame from top to bottom.
* @exception rb_eArgError `index` out of range.
* @return The current receiver at `index`-th frame.
*/
VALUE rb_debug_inspector_frame_self_get(const rb_debug_inspector_t *dc, long index);
/**
* Queries the current class of the passed context's upper frame.
*
* @param[in] dc A debug context.
* @param[in] index Index of the frame from top to bottom.
* @exception rb_eArgError `index` out of range.
* @return The current class at `index`-th frame.
*/
VALUE rb_debug_inspector_frame_class_get(const rb_debug_inspector_t *dc, long index);
/**
* Queries the binding of the passed context's upper frame.
*
* @param[in] dc A debug context.
* @param[in] index Index of the frame from top to bottom.
* @exception rb_eArgError `index` out of range.
* @return The binding at `index`-th frame.
*/
VALUE rb_debug_inspector_frame_binding_get(const rb_debug_inspector_t *dc, long index);
/**
* Queries the instruction sequence of the passed context's upper frame.
*
* @param[in] dc A debug context.
* @param[in] index Index of the frame from top to bottom.
* @exception rb_eArgError `index` out of range.
* @retval RUBY_Qnil `index`-th frame is not in Ruby (C etc.).
* @retval otherwise An instance of `RubyVM::InstructionSequence` which
* represents the instruction sequence at `index`-th
* frame.
*/
VALUE rb_debug_inspector_frame_iseq_get(const rb_debug_inspector_t *dc, long index);
/**
* Queries the depth of the passed context's upper frame.
*
* Note that the depth is not same as the frame index because debug_inspector
* skips some special frames but the depth counts all frames.
*
* @param[in] dc A debug context.
* @param[in] index Index of the frame from top to bottom.
* @exception rb_eArgError `index` out of range.
* @retval The depth at `index`-th frame in Integer.
*/
VALUE rb_debug_inspector_frame_depth(const rb_debug_inspector_t *dc, long index);
// A macro to recognize `rb_debug_inspector_frame_depth()` is available or not
#define RB_DEBUG_INSPECTOR_FRAME_DEPTH(dc, index) rb_debug_inspector_frame_depth(dc, index)
/**
* Return current frmae depth.
*
* @retval The depth of the current frame in Integer.
*/
VALUE rb_debug_inspector_current_depth(void);
/** @} */
/**
* @name Old style set_trace_func APIs
*
* @{
*/
/* duplicated def of include/ruby/ruby.h */
#include "ruby/internal/event.h"
/**
* Identical to rb_remove_event_hook(), except it additionally takes the data
* argument. This extra argument is the same as that of rb_add_event_hook(),
* and this function removes the hook which matches both arguments at once.
*
* @param[in] func A callback.
* @param[in] data What to be passed to `func`.
* @return Number of deleted event hooks.
* @note As multiple events can share the same `func` it is quite
* possible for the return value to become more than one.
*/
int rb_remove_event_hook_with_data(rb_event_hook_func_t func, VALUE data);
/**
* Identical to rb_add_event_hook(), except its effect is limited to the passed
* thread. Other threads are not affected by this.
*
* @param[in] thval An instance of ::rb_cThread.
* @param[in] func A callback.
* @param[in] events A set of events that `func` should run.
* @param[in] data Passed as-is to `func`.
* @exception rb_eTypeError `thval` is not a thread.
*/
void rb_thread_add_event_hook(VALUE thval, rb_event_hook_func_t func, rb_event_flag_t events, VALUE data);
/**
* Identical to rb_remove_event_hook(), except it additionally takes a thread
* argument. This extra argument is the same as that of
* rb_thread_add_event_hook(), and this function removes the hook which matches
* both arguments at once.
*
* @param[in] thval An instance of ::rb_cThread.
* @param[in] func A callback.
* @exception rb_eTypeError `thval` is not a thread.
* @return Number of deleted event hooks.
* @note As multiple events can share the same `func` it is quite
* possible for the return value to become more than one.
*/
int rb_thread_remove_event_hook(VALUE thval, rb_event_hook_func_t func);
/**
* Identical to rb_thread_remove_event_hook(), except it additionally takes the
* data argument. It can also be seen as a routine identical to
* rb_remove_event_hook_with_data(), except it additionally takes the thread.
* This function deletes hooks that satisfy all three criteria.
*
* @param[in] thval An instance of ::rb_cThread.
* @param[in] func A callback.
* @param[in] data What to be passed to `func`.
* @exception rb_eTypeError `thval` is not a thread.
* @return Number of deleted event hooks.
* @note As multiple events can share the same `func` it is quite
* possible for the return value to become more than one.
*/
int rb_thread_remove_event_hook_with_data(VALUE thval, rb_event_hook_func_t func, VALUE data);
/** @} */
/**
* @name TracePoint APIs
*
* @{
*/
/**
* Creates a tracepoint by registering a callback function for one or more
* tracepoint events. Once the tracepoint is created, you can use
* rb_tracepoint_enable to enable the tracepoint.
*
* @param[in] target_thread_not_supported_yet Meant for picking the
* thread in which the tracepoint is to be created.
* However, current implementation ignore this
* parameter, tracepoint is created for all threads.
* Simply specify Qnil.
* @param[in] events Event(s) to listen to.
* @param[in] func A callback function.
* @param[in,out] data Void pointer that will be passed to the callback
* function.
*
* When the callback function is called, it will be passed 2 parameters:
* 1. `VALUE tpval` - the TracePoint object from which trace args can be
* extracted.
* 1. `void *data` - A void pointer which helps to share scope with the
* callback function.
*
* It is important to note that you cannot register callbacks for normal events
* and internal events simultaneously because they are different purpose. You
* can use any Ruby APIs (calling methods and so on) on normal event hooks.
* However, in internal events, you can not use any Ruby APIs (even object
* creations). This is why we can't specify internal events by TracePoint
* directly. Limitations are MRI version specific.
*
* Example:
*
* ```CXX
* rb_tracepoint_new(
* Qnil,
* RUBY_INTERNAL_EVENT_NEWOBJ | RUBY_INTERNAL_EVENT_FREEOBJ,
* obj_event_i,
* data);
* ```
*
* In this example, a callback function `obj_event_i` will be registered for
* internal events #RUBY_INTERNAL_EVENT_NEWOBJ and
* #RUBY_INTERNAL_EVENT_FREEOBJ.
*/
VALUE rb_tracepoint_new(VALUE target_thread_not_supported_yet, rb_event_flag_t events, void (*func)(VALUE, void *), void *data);
/**
* Starts (enables) trace(s) defined by the passed object. A TracePoint object
* does not immediately take effect on creation. You have to explicitly call
* this API.
*
* @param[in] tpval An instance of TracePoint.
* @exception rb_eArgError A trace is already running.
* @return Undefined value. Forget this. It should have returned `void`.
* @post Trace(s) defined by `tpval` start.
*/
VALUE rb_tracepoint_enable(VALUE tpval);
/**
* Stops (disables) an already running instance of TracePoint.
*
* @param[in] tpval An instance of TracePoint.
* @return Undefined value. Forget this. It should have returned `void`.
* @post Trace(s) defined by `tpval` stop.
*/
VALUE rb_tracepoint_disable(VALUE tpval);
/**
* Queries if the passed TracePoint is up and running.
*
* @param[in] tpval An instance of TracePoint.
* @retval RUBY_Qtrue It is.
* @retval RUBY_Qfalse It isn't.
*/
VALUE rb_tracepoint_enabled_p(VALUE tpval);
/**
* Type that represents a specific trace event. Roughly resembles the
* tracepoint object that is passed to the block of `TracePoint.new`:
*
* ```ruby
* TracePoint.new(*events) do |obj|
* ... # ^^^^^ Resembles this object.
* end
* ```
*/
typedef struct rb_trace_arg_struct rb_trace_arg_t;
RBIMPL_ATTR_RETURNS_NONNULL()
/**
* Queries the current event of the passed tracepoint.
*
* @param[in] tpval An instance of TracePoint.
* @exception rb_eRuntimeError `tpval` is disabled.
* @return The current event.
*
* @internal
*
* `tpval` is a fake. There is only one instance of ::rb_trace_arg_t at one
* time. This function just returns that global variable.
*/
rb_trace_arg_t *rb_tracearg_from_tracepoint(VALUE tpval);
RBIMPL_ATTR_NONNULL(())
/**
* Queries the event of the passed trace.
*
* @param[in] trace_arg A trace instance.
* @return Its event.
*/
rb_event_flag_t rb_tracearg_event_flag(rb_trace_arg_t *trace_arg);
RBIMPL_ATTR_NONNULL(())
/**
* Identical to rb_tracearg_event_flag(), except it returns the name of the
* event in Ruby's symbol.
*
* @param[in] trace_arg A trace instance.
* @return Its event, in Ruby level Symbol object.
*/
VALUE rb_tracearg_event(rb_trace_arg_t *trace_arg);
RBIMPL_ATTR_NONNULL(())
/**
* Queries the line of the point where the trace is at.
*
* @param[in] trace_arg A trace instance.
* @retval 0 The trace is not at Ruby frame.
* @return otherwise Its line number.
*/
VALUE rb_tracearg_lineno(rb_trace_arg_t *trace_arg);
RBIMPL_ATTR_NONNULL(())
/**
* Queries the file name of the point where the trace is at.
*
* @param[in] trace_arg A trace instance.
* @retval RUBY_Qnil The trace is not at Ruby frame.
* @retval otherwise Its path.
*/
VALUE rb_tracearg_path(rb_trace_arg_t *trace_arg);
RBIMPL_ATTR_NONNULL(())
/**
* Queries the method name of the point where the trace is at.
*
* @param[in] trace_arg A trace instance.
* @retval RUBY_Qnil There is no method.
* @retval otherwise Its method name, in Ruby level Symbol.
*/
VALUE rb_tracearg_method_id(rb_trace_arg_t *trace_arg);
RBIMPL_ATTR_NONNULL(())
/**
* Identical to rb_tracearg_method_id(), except it returns callee id like
* rb_frame_callee().
*
* @param[in] trace_arg A trace instance.
* @retval RUBY_Qnil There is no method.
* @retval otherwise Its method name, in Ruby level Symbol.
*/
VALUE rb_tracearg_callee_id(rb_trace_arg_t *trace_arg);
RBIMPL_ATTR_NONNULL(())
/**
* Queries the class that defines the method that the passed trace is at. This
* can be different from the class of rb_tracearg_self()'s return value because
* of inheritance(s).
*
* @param[in] trace_arg A trace instance.
* @retval RUBY_Qnil There is no method.
* @retval otherwise Its method's class.
*/
VALUE rb_tracearg_defined_class(rb_trace_arg_t *trace_arg);
RBIMPL_ATTR_NONNULL(())
/**
* Creates a binding object of the point where the trace is at.
*
* @param[in] trace_arg A trace instance.
* @retval RUBY_Qnil The point has no binding.
* @retval otherwise Its binding.
*
* @internal
*
* @shyouhei has no idea on which situation shall this function return
* ::RUBY_Qnil.
*/
VALUE rb_tracearg_binding(rb_trace_arg_t *trace_arg);
RBIMPL_ATTR_NONNULL(())
/**
* Queries the receiver of the point trace is at.
*
* @param[in] trace_arg A trace instance.
* @return Its receiver.
*/
VALUE rb_tracearg_self(rb_trace_arg_t *trace_arg);
RBIMPL_ATTR_NONNULL(())
/**
* Queries the return value that the trace represents.
*
* @param[in] trace_arg A trace instance.
* @exception rb_eRuntimeError The tracing event is not return-related.
* @return The return value.
*/
VALUE rb_tracearg_return_value(rb_trace_arg_t *trace_arg);
RBIMPL_ATTR_NONNULL(())
/**
* Queries the raised exception that the trace represents.
*
* @param[in] trace_arg A trace instance.
* @exception rb_eRuntimeError The tracing event is not exception-related.
* @return The raised exception.
*/
VALUE rb_tracearg_raised_exception(rb_trace_arg_t *trace_arg);
RBIMPL_ATTR_NONNULL(())
/**
* Queries the allocated/deallocated object that the trace represents.
*
* @param[in] trace_arg A trace instance.
* @exception rb_eRuntimeError The tracing event is not GC-related.
* @return The allocated/deallocated object.
*/
VALUE rb_tracearg_object(rb_trace_arg_t *trace_arg);
/** @} */
/**
* @name Postponed Job API
*
* @{
*/
/*
* Postponed Job API
* rb_postponed_job_register and rb_postponed_job_register_one are
* async-signal-safe and used via SIGPROF by the "stackprof" RubyGem
*/
/**
* Type of postponed jobs.
*
* @param[in,out] arg What was passed to rb_postponed_job_register().
*/
typedef void (*rb_postponed_job_func_t)(void *arg);
/**
* Registers a postponed job.
*
* There are situations when running a ruby program is not possible. For
* instance when a program is in a signal handler; for another instance when
* the GC is busy. On such situations however, there might be needs to do
* something. We cannot but defer such operations until we are 100% sure it is
* safe to execute them. This mechanism is called postponed jobs. This
* function registers a new one. The registered job would eventually gets
* executed.
*
* @param[in] flags (Unused) reserved for future extensions.
* @param[in] func Job body.
* @param[in,out] data Passed as-is to `func`.
* @retval 0 Postponed job buffer is full. Failed.
* @retval otherwise Opaque return value.
* @post The passed job is postponed.
*/
int rb_postponed_job_register(unsigned int flags, rb_postponed_job_func_t func, void *data);
/**
* Identical to rb_postponed_job_register_one(), except it additionally checks
* for duplicated registration. In case the passed job is already in the
* postponed job buffer this function does nothing.
*
* @param[in] flags (Unused) reserved for future extensions.
* @param[in] func Job body.
* @param[in,out] data Passed as-is to `func`.
* @retval 0 Postponed job buffer is full. Failed.
* @retval otherwise Opaque return value.
*/
int rb_postponed_job_register_one(unsigned int flags, rb_postponed_job_func_t func, void *data);
/** @} */
/**
* @cond INTERNAL_MACRO
*
* Anything after this are intentionally left undocumented, to honour the
* comment below.
*/
/* undocumented advanced tracing APIs */
typedef enum {
RUBY_EVENT_HOOK_FLAG_SAFE = 0x01,
RUBY_EVENT_HOOK_FLAG_DELETED = 0x02,
RUBY_EVENT_HOOK_FLAG_RAW_ARG = 0x04
} rb_event_hook_flag_t;
void rb_add_event_hook2(rb_event_hook_func_t func, rb_event_flag_t events, VALUE data, rb_event_hook_flag_t hook_flag);
void rb_thread_add_event_hook2(VALUE thval, rb_event_hook_func_t func, rb_event_flag_t events, VALUE data, rb_event_hook_flag_t hook_flag);
/** @endcond */
RBIMPL_SYMBOL_EXPORT_END()
#endif /* RUBY_DEBUG_H */

View File

@@ -1,116 +0,0 @@
#ifndef RUBY_DEFINES_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY_DEFINES_H 1
/**
* @file
* @author $Author$
* @date Wed May 18 00:21:44 JST 1994
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
*/
#include "ruby/internal/config.h"
/* AC_INCLUDES_DEFAULT */
#include <stdio.h>
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#ifdef STDC_HEADERS
#include <stddef.h>
#include <stdlib.h>
#else
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#endif
#ifdef HAVE_STRING_H
#if !defined STDC_HEADERS && defined HAVE_MEMORY_H
#include <memory.h>
#endif
#include <string.h>
#endif
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#endif
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#ifdef HAVE_STDALIGN_H
#include <stdalign.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
#ifdef RUBY_USE_SETJMPEX
#include <setjmpex.h>
#endif
#include "ruby/backward/2/assume.h"
#include "ruby/backward/2/attributes.h"
#include "ruby/backward/2/bool.h"
#include "ruby/backward/2/long_long.h"
#include "ruby/backward/2/stdalign.h"
#include "ruby/backward/2/stdarg.h"
#include "ruby/internal/dllexport.h"
#include "ruby/internal/dosish.h"
#include "ruby/internal/xmalloc.h"
#include "ruby/missing.h"
/**
* Asserts that the compilation unit includes Ruby's CAPI. This has been here
* since the very beginning (at least since version 0.49).
*/
#define RUBY
#ifdef __GNUC__
#/** This is expanded to nothing for non-GCC compilers. */
#define RB_GNUC_EXTENSION __extension__
#/** This is expanded to the passed token for non-GCC compilers. */
#define RB_GNUC_EXTENSION_BLOCK(x) __extension__({ x; })
#else
#define RB_GNUC_EXTENSION
#define RB_GNUC_EXTENSION_BLOCK(x) (x)
#endif
/** @cond INTERNAL_MACRO */
/* :FIXME: Can someone tell us why is this macro defined here? @shyouhei
* thinks this is a truly internal macro but cannot move around because he
* doesn't understand the reason of this arrangement. */
#ifndef RUBY_MBCHAR_MAXSIZE
#define RUBY_MBCHAR_MAXSIZE INT_MAX
#/* MB_CUR_MAX will not work well in C locale */
#endif
#if defined(__sparc)
RBIMPL_SYMBOL_EXPORT_BEGIN()
void rb_sparc_flush_register_windows(void);
RBIMPL_SYMBOL_EXPORT_END()
#define FLUSH_REGISTER_WINDOWS rb_sparc_flush_register_windows()
#else
#define FLUSH_REGISTER_WINDOWS ((void)0)
#endif
/** @endcond */
#endif /* RUBY_DEFINES_H */

View File

@@ -1,72 +0,0 @@
/************************************************
digest.h - header file for ruby digest modules
$Author$
created at: Fri May 25 08:54:56 JST 2001
Copyright (C) 2001-2006 Akinori MUSHA
$RoughId: digest.h,v 1.3 2001/07/13 15:38:27 knu Exp $
$Id$
************************************************/
#include "ruby.h"
#define RUBY_DIGEST_API_VERSION 3
typedef int (*rb_digest_hash_init_func_t)(void *);
typedef void (*rb_digest_hash_update_func_t)(void *, unsigned char *, size_t);
typedef int (*rb_digest_hash_finish_func_t)(void *, unsigned char *);
typedef struct {
int api_version;
size_t digest_len;
size_t block_len;
size_t ctx_size;
rb_digest_hash_init_func_t init_func;
rb_digest_hash_update_func_t update_func;
rb_digest_hash_finish_func_t finish_func;
} rb_digest_metadata_t;
#define DEFINE_UPDATE_FUNC_FOR_UINT(name) \
void \
rb_digest_##name##_update(void *ctx, unsigned char *ptr, size_t size) \
{ \
const unsigned int stride = 16384; \
\
for (; size > stride; size -= stride, ptr += stride) { \
name##_Update(ctx, ptr, stride); \
} \
if (size > 0) name##_Update(ctx, ptr, size); \
}
#define DEFINE_FINISH_FUNC_FROM_FINAL(name) \
int \
rb_digest_##name##_finish(void *ctx, unsigned char *ptr) \
{ \
return name##_Final(ptr, ctx); \
}
static inline VALUE
rb_digest_namespace(void)
{
rb_require("digest");
return rb_path2class("Digest");
}
static inline ID
rb_id_metadata(void)
{
return rb_intern_const("metadata");
}
static inline VALUE
rb_digest_make_metadata(const rb_digest_metadata_t *meta)
{
#undef RUBY_UNTYPED_DATA_WARNING
#define RUBY_UNTYPED_DATA_WARNING 0
return rb_obj_freeze(Data_Wrap_Struct(0, 0, 0, (void *)meta));
}

View File

@@ -1,31 +0,0 @@
#ifndef RUBY_ENCODING_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY_ENCODING_H 1
/**
* @file
* @author $Author: matz $
* @date Thu May 24 11:49:41 JST 2007
* @copyright Copyright (C) 2007 Yukihiro Matsumoto
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @brief Encoding relates APIs.
*
* These APIs are mainly for implementing encodings themselves. Encodings are
* built on top of Ruby's core CAPIs. Though not prohibited, there can be
* relatively less rooms for things in this header file be useful when writing
* an extension library.
*/
#include "ruby/ruby.h"
#include "ruby/internal/encoding/coderange.h"
#include "ruby/internal/encoding/ctype.h"
#include "ruby/internal/encoding/encoding.h"
#include "ruby/internal/encoding/pathname.h"
#include "ruby/internal/encoding/re.h"
#include "ruby/internal/encoding/sprintf.h"
#include "ruby/internal/encoding/string.h"
#include "ruby/internal/encoding/symbol.h"
#include "ruby/internal/encoding/transcode.h"
#endif /* RUBY_ENCODING_H */

View File

@@ -1,374 +0,0 @@
#ifndef RUBY_FIBER_SCHEDULER_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY_FIBER_SCHEDULER_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @brief Scheduler APIs.
*/
#include "ruby/internal/config.h"
#include <errno.h>
#ifdef STDC_HEADERS
#include <stddef.h> /* size_t */
#endif
#include "ruby/ruby.h"
#include "ruby/internal/dllexport.h"
#include "ruby/internal/arithmetic.h"
RBIMPL_SYMBOL_EXPORT_BEGIN()
#define RUBY_FIBER_SCHEDULER_VERSION 2
struct timeval;
/**
* Wrap a `ssize_t` and `int errno` into a single `VALUE`. This interface should
* be used to safely capture results from system calls like `read` and `write`.
*
* You should use `rb_fiber_scheduler_io_result_apply` to unpack the result of
* this value and update `int errno`.
*
* You should not directly try to interpret the result value as it is considered
* an opaque representation. However, the general representation is an integer
* in the range of `[-int errno, size_t size]`. Linux generally restricts the
* result of system calls like `read` and `write` to `<= 2^31` which means this
* will typically fit within a single FIXNUM.
*
* @param[in] result The result of the system call.
* @param[in] error The value of `errno`.
* @return A `VALUE` which contains the result and/or errno.
*/
static inline VALUE
rb_fiber_scheduler_io_result(ssize_t result, int error)
{
if (result == -1) {
return RB_INT2NUM(-error);
}
else {
return RB_SIZE2NUM(result);
}
}
/**
* Apply an io result to the local thread, returning the value of the original
* system call that created it and updating `int errno`.
*
* You should not directly try to interpret the result value as it is considered
* an opaque representation.
*
* @param[in] result The `VALUE` which contains an errno and/or result size.
* @post Updates `int errno` with the value if negative.
* @return The original result of the system call.
*/
static inline ssize_t
rb_fiber_scheduler_io_result_apply(VALUE result)
{
if (RB_FIXNUM_P(result) && RB_NUM2INT(result) < 0) {
errno = -RB_NUM2INT(result);
return -1;
}
else {
return RB_NUM2SIZE(result);
}
}
/**
* Queries the current scheduler of the current thread that is calling this
* function.
*
* @retval RUBY_Qnil No scheduler has been set so far to this thread (which
* is the default).
* @retval otherwise The scheduler that was last set for the current thread
* with rb_fiber_scheduler_set().
*/
VALUE rb_fiber_scheduler_get(void);
/**
* Destructively assigns the passed scheduler to that of the current thread
* that is calling this function. If the scheduler is set, non-blocking fibers
* (created by `Fiber.new` with `blocking: false`, or by `Fiber.schedule`) call
* that scheduler's hook methods on potentially blocking operations, and the
* current thread will call scheduler's `#close` method on finalisation
* (allowing the scheduler to properly manage all non-finished fibers).
* `scheduler` can be an object of any class corresponding to
* `Fiber::SchedulerInterface`. Its implementation is up to the user.
*
* @param[in] scheduler The scheduler to set.
* @exception rb_eArgError `scheduler` does not conform the interface.
* @post Current thread's scheduler is `scheduler`.
*/
VALUE rb_fiber_scheduler_set(VALUE scheduler);
/**
* Identical to rb_fiber_scheduler_get(), except it also returns ::RUBY_Qnil in
* case of a blocking fiber. As blocking fibers do not participate schedulers'
* scheduling this function can be handy.
*
* @retval RUBY_Qnil No scheduler is in effect.
* @retval otherwise The scheduler that is in effect, if any.
*/
VALUE rb_fiber_scheduler_current(void);
/**
* Identical to rb_fiber_scheduler_current(), except it queries for that of the
* passed thread instead of the implicit current one.
*
* @param[in] thread Target thread.
* @exception rb_eTypeError `thread` is not a thread.
* @retval RUBY_Qnil No scheduler is in effect in `thread`.
* @retval otherwise The scheduler that is in effect in `thread`.
*/
VALUE rb_fiber_scheduler_current_for_thread(VALUE thread);
/**
* Converts the passed timeout to an expression that rb_fiber_scheduler_block()
* etc. expects.
*
* @param[in] timeout A duration (can be `NULL`).
* @retval RUBY_Qnil No timeout (blocks indefinitely).
* @retval otherwise A timeout object.
*/
VALUE rb_fiber_scheduler_make_timeout(struct timeval *timeout);
/**
* Closes the passed scheduler object. This expects the scheduler to wait for
* all fibers. Thus the scheduler's main loop tends to start here.
*
* @param[in] scheduler Target scheduler.
* @return What `scheduler.close` returns.
*/
VALUE rb_fiber_scheduler_close(VALUE scheduler);
/**
* Non-blocking `sleep`. Depending on scheduler implementation, this for
* instance switches to another fiber etc.
*
* @param[in] scheduler Target scheduler.
* @param[in] duration Passed as-is to `scheduler.kernel_sleep`.
* @return What `scheduler.kernel_sleep` returns.
*/
VALUE rb_fiber_scheduler_kernel_sleep(VALUE scheduler, VALUE duration);
/**
* Identical to rb_fiber_scheduler_kernel_sleep(), except it can pass multiple
* arguments.
*
* @param[in] scheduler Target scheduler.
* @param[in] argc Number of objects of `argv`.
* @param[in] argv Passed as-is to `scheduler.kernel_sleep`
* @return What `scheduler.kernel_sleep` returns.
*/
VALUE rb_fiber_scheduler_kernel_sleepv(VALUE scheduler, int argc, VALUE * argv);
/* Description TBW */
#if 0
VALUE rb_fiber_scheduler_timeout_after(VALUE scheduler, VALUE timeout, VALUE exception, VALUE message);
VALUE rb_fiber_scheduler_timeout_afterv(VALUE scheduler, int argc, VALUE * argv);
int rb_fiber_scheduler_supports_process_wait(VALUE scheduler);
#endif
/**
* Non-blocking `waitpid`. Depending on scheduler implementation, this for
* instance switches to another fiber etc.
*
* @param[in] scheduler Target scheduler.
* @param[in] pid Process ID to wait.
* @param[in] flags Wait flags, e.g. `WUNTRACED`.
* @return What `scheduler.process_wait` returns.
*/
VALUE rb_fiber_scheduler_process_wait(VALUE scheduler, rb_pid_t pid, int flags);
/**
* Non-blocking wait for the passed "blocker", which is for instance
* `Thread.join` or `Mutex.lock`. Depending on scheduler implementation, this
* for instance switches to another fiber etc.
*
* @param[in] scheduler Target scheduler.
* @param[in] blocker What blocks the current fiber.
* @param[in] timeout Numeric timeout.
* @return What `scheduler.block` returns.
*/
VALUE rb_fiber_scheduler_block(VALUE scheduler, VALUE blocker, VALUE timeout);
/**
* Wakes up a fiber previously blocked using rb_fiber_scheduler_block().
*
* @param[in] scheduler Target scheduler.
* @param[in] blocker What was awaited for.
* @param[in] fiber What to unblock.
* @return What `scheduler.unblock` returns.
*/
VALUE rb_fiber_scheduler_unblock(VALUE scheduler, VALUE blocker, VALUE fiber);
/**
* Non-blocking version of rb_io_wait(). Depending on scheduler
* implementation, this for instance switches to another fiber etc.
*
* The "events" here is a Ruby level integer, which is an OR-ed value of
* `IO::READABLE`, `IO::WRITABLE`, and `IO::PRIORITY`.
*
* @param[in] scheduler Target scheduler.
* @param[in] io An io object to wait.
* @param[in] events An integer set of interests.
* @param[in] timeout Numeric timeout.
* @return What `scheduler.io_wait` returns.
*/
VALUE rb_fiber_scheduler_io_wait(VALUE scheduler, VALUE io, VALUE events, VALUE timeout);
/**
* Non-blocking wait until the passed IO is ready for reading. This is a
* special case of rb_fiber_scheduler_io_wait(), where the interest is
* `IO::READABLE` and timeout is never.
*
* @param[in] scheduler Target scheduler.
* @param[in] io An io object to wait.
* @return What `scheduler.io_wait` returns.
*/
VALUE rb_fiber_scheduler_io_wait_readable(VALUE scheduler, VALUE io);
/**
* Non-blocking wait until the passed IO is ready for writing. This is a
* special case of rb_fiber_scheduler_io_wait(), where the interest is
* `IO::WRITABLE` and timeout is never.
*
* @param[in] scheduler Target scheduler.
* @param[in] io An io object to wait.
* @return What `scheduler.io_wait` returns.
*/
VALUE rb_fiber_scheduler_io_wait_writable(VALUE scheduler, VALUE io);
/**
* Non-blocking version of `IO.select`.
*
* It's possible that this will be emulated using a thread, so you should not
* rely on it for high performance.
*
* @param[in] scheduler Target scheduler.
* @param[in] readables An array of readable objects.
* @param[in] writables An array of writable objects.
* @param[in] exceptables An array of objects that might encounter exceptional conditions.
* @param[in] timeout Numeric timeout or nil.
* @return What `scheduler.io_select` returns, normally a 3-tuple of arrays of ready objects.
*/
VALUE rb_fiber_scheduler_io_select(VALUE scheduler, VALUE readables, VALUE writables, VALUE exceptables, VALUE timeout);
/**
* Non-blocking version of `IO.select`, `argv` variant.
*/
VALUE rb_fiber_scheduler_io_selectv(VALUE scheduler, int argc, VALUE *argv);
/**
* Non-blocking read from the passed IO.
*
* @param[in] scheduler Target scheduler.
* @param[out] io An io object to read from.
* @param[out] buffer Return buffer.
* @param[in] length Requested number of bytes to read.
* @param[in] offset The offset in the buffer to read to.
* @retval RUBY_Qundef `scheduler` doesn't have `#io_read`.
* @return otherwise What `scheduler.io_read` returns `[-errno, size]`.
*/
VALUE rb_fiber_scheduler_io_read(VALUE scheduler, VALUE io, VALUE buffer, size_t length, size_t offset);
/**
* Non-blocking write to the passed IO.
*
* @param[in] scheduler Target scheduler.
* @param[out] io An io object to write to.
* @param[in] buffer What to write.
* @param[in] length Number of bytes to write.
* @param[in] offset The offset in the buffer to write from.
* @retval RUBY_Qundef `scheduler` doesn't have `#io_write`.
* @return otherwise What `scheduler.io_write` returns `[-errno, size]`.
*/
VALUE rb_fiber_scheduler_io_write(VALUE scheduler, VALUE io, VALUE buffer, size_t length, size_t offset);
/**
* Non-blocking read from the passed IO at the specified offset.
*
* @param[in] scheduler Target scheduler.
* @param[out] io An io object to read from.
* @param[in] from The offset in the given IO to read the data from.
* @param[out] buffer The buffer to read the data to.
* @param[in] length Requested number of bytes to read.
* @param[in] offset The offset in the buffer to read to.
* @retval RUBY_Qundef `scheduler` doesn't have `#io_read`.
* @return otherwise What `scheduler.io_read` returns.
*/
VALUE rb_fiber_scheduler_io_pread(VALUE scheduler, VALUE io, rb_off_t from, VALUE buffer, size_t length, size_t offset);
/**
* Non-blocking write to the passed IO at the specified offset.
*
* @param[in] scheduler Target scheduler.
* @param[out] io An io object to write to.
* @param[in] from The offset in the given IO to write the data to.
* @param[in] buffer The buffer to write the data from.
* @param[in] length Number of bytes to write.
* @param[in] offset The offset in the buffer to write from.
* @retval RUBY_Qundef `scheduler` doesn't have `#io_write`.
* @return otherwise What `scheduler.io_write` returns.
*/
VALUE rb_fiber_scheduler_io_pwrite(VALUE scheduler, VALUE io, rb_off_t from, VALUE buffer, size_t length, size_t offset);
/**
* Non-blocking read from the passed IO using a native buffer.
*
* @param[in] scheduler Target scheduler.
* @param[out] io An io object to read from.
* @param[out] buffer Return buffer.
* @param[in] size Size of the return buffer.
* @param[in] length Requested number of bytes to read.
* @retval RUBY_Qundef `scheduler` doesn't have `#io_read`.
* @return otherwise What `scheduler.io_read` returns.
*/
VALUE rb_fiber_scheduler_io_read_memory(VALUE scheduler, VALUE io, void *buffer, size_t size, size_t length);
/**
* Non-blocking write to the passed IO using a native buffer.
*
* @param[in] scheduler Target scheduler.
* @param[out] io An io object to write to.
* @param[in] buffer What to write.
* @param[in] size Size of the buffer.
* @param[in] length Number of bytes to write.
* @retval RUBY_Qundef `scheduler` doesn't have `#io_write`.
* @return otherwise What `scheduler.io_write` returns.
*/
VALUE rb_fiber_scheduler_io_write_memory(VALUE scheduler, VALUE io, const void *buffer, size_t size, size_t length);
/**
* Non-blocking close the given IO.
*
* @param[in] scheduler Target scheduler.
* @param[in] io An io object to close.
* @retval RUBY_Qundef `scheduler` doesn't have `#io_close`.
* @return otherwise What `scheduler.io_close` returns.
*/
VALUE rb_fiber_scheduler_io_close(VALUE scheduler, VALUE io);
/**
* Non-blocking DNS lookup.
*
* @param[in] scheduler Target scheduler.
* @param[in] hostname A host name to query.
* @retval RUBY_Qundef `scheduler` doesn't have `#address_resolve`.
* @return otherwise What `scheduler.address_resolve` returns.
*/
VALUE rb_fiber_scheduler_address_resolve(VALUE scheduler, VALUE hostname);
/**
* Create and schedule a non-blocking fiber.
*
*/
VALUE rb_fiber_scheduler_fiber(VALUE scheduler, int argc, VALUE *argv, int kw_splat);
RBIMPL_SYMBOL_EXPORT_END()
#endif /* RUBY_FIBER_SCHEDULER_H */

View File

@@ -1,64 +0,0 @@
#ifndef RUBY_INTERN_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY_INTERN_H 1
/**
* @file
* @author $Author$
* @date Thu Jun 10 14:22:17 JST 1993
* @copyright Copyright (C) 1993-2007 Yukihiro Matsumoto
* @copyright Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
* @copyright Copyright (C) 2000 Information-technology Promotion Agency, Japan
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
*/
#include "ruby/internal/config.h"
#include "ruby/defines.h"
#include <stdarg.h>
#include "ruby/st.h"
/*
* Functions and variables that are used by more than one source file of
* the kernel.
*/
#include "ruby/internal/intern/array.h"
#include "ruby/internal/intern/bignum.h"
#include "ruby/internal/intern/class.h"
#include "ruby/internal/intern/compar.h"
#include "ruby/internal/intern/complex.h"
#include "ruby/internal/intern/cont.h"
#include "ruby/internal/intern/dir.h"
#include "ruby/internal/intern/enum.h"
#include "ruby/internal/intern/enumerator.h"
#include "ruby/internal/intern/error.h"
#include "ruby/internal/intern/eval.h"
#include "ruby/internal/intern/file.h"
#include "ruby/internal/intern/gc.h"
#include "ruby/internal/intern/hash.h"
#include "ruby/internal/intern/io.h"
#include "ruby/internal/intern/load.h"
#include "ruby/internal/intern/marshal.h"
#include "ruby/internal/intern/numeric.h"
#include "ruby/internal/intern/object.h"
#include "ruby/internal/intern/parse.h"
#include "ruby/internal/intern/proc.h"
#include "ruby/internal/intern/process.h"
#include "ruby/internal/intern/random.h"
#include "ruby/internal/intern/range.h"
#include "ruby/internal/intern/rational.h"
#include "ruby/internal/intern/re.h"
#include "ruby/internal/intern/ruby.h"
#include "ruby/internal/intern/select.h"
#include "ruby/internal/intern/signal.h"
#include "ruby/internal/intern/sprintf.h"
#include "ruby/internal/intern/string.h"
#include "ruby/internal/intern/struct.h"
#include "ruby/internal/intern/thread.h"
#include "ruby/internal/intern/time.h"
#include "ruby/internal/intern/variable.h"
#include "ruby/internal/intern/vm.h"
#endif /* RUBY_INTERN_H */

View File

@@ -1,58 +0,0 @@
#ifndef RUBY_ABI_H
#define RUBY_ABI_H
#ifdef RUBY_ABI_VERSION /* should match the definition in config.h */
/* This number represents Ruby's ABI version.
*
* In development Ruby, it should be bumped every time an ABI incompatible
* change is introduced. This will force other developers to rebuild extension
* gems.
*
* The following cases are considered as ABI incompatible changes:
* - Changing any data structures.
* - Changing macros or inline functions causing a change in behavior.
* - Deprecating or removing function declarations.
*
* The following cases are NOT considered as ABI incompatible changes:
* - Any changes that does not involve the header files in the `include`
* directory.
* - Adding macros, inline functions, or function declarations.
* - Backwards compatible refactors.
* - Editing comments.
*
* In released versions of Ruby, this number is not defined since teeny
* versions of Ruby should guarantee ABI compatibility.
*/
#define RUBY_ABI_VERSION 3
/* Windows does not support weak symbols so ruby_abi_version will not exist
* in the shared library. */
#if defined(HAVE_FUNC_WEAK) && !defined(_WIN32) && !defined(__MINGW32__) && !defined(__CYGWIN__)
# define RUBY_DLN_CHECK_ABI
#endif
#endif /* RUBY_ABI_VERSION */
#ifdef RUBY_DLN_CHECK_ABI
# ifdef __cplusplus
extern "C" {
# endif
RUBY_FUNC_EXPORTED unsigned long long __attribute__((weak))
ruby_abi_version(void)
{
# ifdef RUBY_ABI_VERSION
return RUBY_ABI_VERSION;
# else
return 0;
# endif
}
# ifdef __cplusplus
}
# endif
#endif
#endif

View File

@@ -1,376 +0,0 @@
#ifndef RBIMPL_ANYARGS_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ANYARGS_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Function overloads to issue warnings around #ANYARGS.
*
* For instance ::rb_define_method takes a pointer to #ANYARGS -ed functions,
* which in fact varies 18 different prototypes. We still need to preserve
* #ANYARGS for storages but why not check the consistencies if possible. With
* those complex macro overlays defined in this header file, use of a function
* pointer gets checked against the corresponding arity argument.
*
* ### Q&A ###
*
* - Q: Where did the magic number "18" came from in the description above?
*
* - A: Count the case branch of `vm_method.c:call_cfunc_invoker_func()`. Note
* also that the 18 branches has lasted for at least 25 years. See also
* commit 200e0ee2fd3c1c006c528874a88f684447215524.
*
* - Q: What is this `__weakref__` thing?
*
* - A: That is a kind of function overloading mechanism that GCC provides. In
* this case for instance `rb_define_method_00` is an alias of
* ::rb_define_method, with a strong type.
*
* - Q: What is this `__transparent_union__` thing?
*
* A: That is another kind of function overloading mechanism that GCC
* provides. In this case the attributed function pointer is either
* `VALUE(*)(int,VALUE*,VALUE)` or `VALUE(*)(int,const VALUE*,VALUE)`.
*
* This is better than `void*` or #ANYARGS because we can reject all other
* possibilities than the two.
*
* - Q: What does this #rb_define_method macro mean?
*
* - A: It selects appropriate alias of the ::rb_define_method function,
* depending on the last (arity) argument.
*
* - Q: Why the special case for ::rb_f_notimplement ?
*
* - A: Function pointer to ::rb_f_notimplement is special cased in
* `vm_method.c:rb_add_method_cfunc()`. That should be handled by the
* `__builtin_choose_expr` chain inside of #rb_define_method macro
* expansion. In order to do so, comparison like
* `(func == rb_f_notimplement)` is inappropriate for
* `__builtin_choose_expr`'s expression (which must be a compile-time
* integer constant but the address of ::rb_f_notimplement is not fixed
* until the linker). Instead we are using
* `__builtin_types_compatible_p`, and in doing so we need to distinguish
* ::rb_f_notimplement from others, by type.
*/
#include "ruby/internal/attr/maybe_unused.h"
#include "ruby/internal/attr/nonnull.h"
#include "ruby/internal/attr/weakref.h"
#include "ruby/internal/cast.h"
#include "ruby/internal/config.h"
#include "ruby/internal/has/attribute.h"
#include "ruby/internal/intern/class.h"
#include "ruby/internal/intern/vm.h"
#include "ruby/internal/method.h"
#include "ruby/internal/value.h"
#include "ruby/backward/2/stdarg.h"
#if defined(__cplusplus)
# include "ruby/backward/cxxanyargs.hpp"
#elif defined(_WIN32) || defined(__CYGWIN__)
# /* Skip due to [Bug #16134] */
#elif ! RBIMPL_HAS_ATTRIBUTE(transparent_union)
# /* :TODO: improve here, please find a way to support. */
#elif ! defined(HAVE_VA_ARGS_MACRO)
# /* :TODO: improve here, please find a way to support. */
#else
# /** @cond INTERNAL_MACRO */
# if ! defined(HAVE_BUILTIN___BUILTIN_TYPES_COMPATIBLE_P)
# define RBIMPL_CFUNC_IS_rb_f_notimplement(f) 0
# else
# define RBIMPL_CFUNC_IS_rb_f_notimplement(f) \
__builtin_types_compatible_p( \
__typeof__(f), \
__typeof__(rb_f_notimplement))
# endif
# if ! defined(HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P)
# define RBIMPL_ANYARGS_DISPATCH(expr, truthy, falsy) (falsy)
# else
# define RBIMPL_ANYARGS_DISPATCH(expr, truthy, falsy) \
__builtin_choose_expr( \
__builtin_choose_expr( \
__builtin_constant_p(expr), \
(expr), 0), \
(truthy), (falsy))
# endif
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_m2(n) RBIMPL_ANYARGS_DISPATCH((n) == -2, rb_define_singleton_method_m2, rb_define_singleton_method_m3)
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_m1(n) RBIMPL_ANYARGS_DISPATCH((n) == -1, rb_define_singleton_method_m1, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_m2(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_00(n) RBIMPL_ANYARGS_DISPATCH((n) == 0, rb_define_singleton_method_00, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_m1(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_01(n) RBIMPL_ANYARGS_DISPATCH((n) == 1, rb_define_singleton_method_01, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_00(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_02(n) RBIMPL_ANYARGS_DISPATCH((n) == 2, rb_define_singleton_method_02, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_01(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_03(n) RBIMPL_ANYARGS_DISPATCH((n) == 3, rb_define_singleton_method_03, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_02(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_04(n) RBIMPL_ANYARGS_DISPATCH((n) == 4, rb_define_singleton_method_04, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_03(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_05(n) RBIMPL_ANYARGS_DISPATCH((n) == 5, rb_define_singleton_method_05, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_04(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_06(n) RBIMPL_ANYARGS_DISPATCH((n) == 6, rb_define_singleton_method_06, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_05(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_07(n) RBIMPL_ANYARGS_DISPATCH((n) == 7, rb_define_singleton_method_07, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_06(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_08(n) RBIMPL_ANYARGS_DISPATCH((n) == 8, rb_define_singleton_method_08, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_07(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_09(n) RBIMPL_ANYARGS_DISPATCH((n) == 9, rb_define_singleton_method_09, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_08(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_10(n) RBIMPL_ANYARGS_DISPATCH((n) == 10, rb_define_singleton_method_10, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_09(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_11(n) RBIMPL_ANYARGS_DISPATCH((n) == 11, rb_define_singleton_method_11, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_10(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_12(n) RBIMPL_ANYARGS_DISPATCH((n) == 12, rb_define_singleton_method_12, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_11(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_13(n) RBIMPL_ANYARGS_DISPATCH((n) == 13, rb_define_singleton_method_13, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_12(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_14(n) RBIMPL_ANYARGS_DISPATCH((n) == 14, rb_define_singleton_method_14, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_13(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_15(n) RBIMPL_ANYARGS_DISPATCH((n) == 15, rb_define_singleton_method_15, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_14(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_m2(n) RBIMPL_ANYARGS_DISPATCH((n) == -2, rb_define_protected_method_m2, rb_define_protected_method_m3)
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_m1(n) RBIMPL_ANYARGS_DISPATCH((n) == -1, rb_define_protected_method_m1, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_m2(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_00(n) RBIMPL_ANYARGS_DISPATCH((n) == 0, rb_define_protected_method_00, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_m1(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_01(n) RBIMPL_ANYARGS_DISPATCH((n) == 1, rb_define_protected_method_01, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_00(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_02(n) RBIMPL_ANYARGS_DISPATCH((n) == 2, rb_define_protected_method_02, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_01(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_03(n) RBIMPL_ANYARGS_DISPATCH((n) == 3, rb_define_protected_method_03, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_02(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_04(n) RBIMPL_ANYARGS_DISPATCH((n) == 4, rb_define_protected_method_04, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_03(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_05(n) RBIMPL_ANYARGS_DISPATCH((n) == 5, rb_define_protected_method_05, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_04(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_06(n) RBIMPL_ANYARGS_DISPATCH((n) == 6, rb_define_protected_method_06, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_05(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_07(n) RBIMPL_ANYARGS_DISPATCH((n) == 7, rb_define_protected_method_07, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_06(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_08(n) RBIMPL_ANYARGS_DISPATCH((n) == 8, rb_define_protected_method_08, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_07(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_09(n) RBIMPL_ANYARGS_DISPATCH((n) == 9, rb_define_protected_method_09, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_08(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_10(n) RBIMPL_ANYARGS_DISPATCH((n) == 10, rb_define_protected_method_10, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_09(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_11(n) RBIMPL_ANYARGS_DISPATCH((n) == 11, rb_define_protected_method_11, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_10(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_12(n) RBIMPL_ANYARGS_DISPATCH((n) == 12, rb_define_protected_method_12, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_11(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_13(n) RBIMPL_ANYARGS_DISPATCH((n) == 13, rb_define_protected_method_13, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_12(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_14(n) RBIMPL_ANYARGS_DISPATCH((n) == 14, rb_define_protected_method_14, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_13(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_15(n) RBIMPL_ANYARGS_DISPATCH((n) == 15, rb_define_protected_method_15, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_14(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_m2(n) RBIMPL_ANYARGS_DISPATCH((n) == -2, rb_define_private_method_m2, rb_define_private_method_m3)
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_m1(n) RBIMPL_ANYARGS_DISPATCH((n) == -1, rb_define_private_method_m1, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_m2(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_00(n) RBIMPL_ANYARGS_DISPATCH((n) == 0, rb_define_private_method_00, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_m1(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_01(n) RBIMPL_ANYARGS_DISPATCH((n) == 1, rb_define_private_method_01, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_00(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_02(n) RBIMPL_ANYARGS_DISPATCH((n) == 2, rb_define_private_method_02, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_01(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_03(n) RBIMPL_ANYARGS_DISPATCH((n) == 3, rb_define_private_method_03, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_02(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_04(n) RBIMPL_ANYARGS_DISPATCH((n) == 4, rb_define_private_method_04, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_03(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_05(n) RBIMPL_ANYARGS_DISPATCH((n) == 5, rb_define_private_method_05, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_04(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_06(n) RBIMPL_ANYARGS_DISPATCH((n) == 6, rb_define_private_method_06, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_05(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_07(n) RBIMPL_ANYARGS_DISPATCH((n) == 7, rb_define_private_method_07, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_06(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_08(n) RBIMPL_ANYARGS_DISPATCH((n) == 8, rb_define_private_method_08, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_07(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_09(n) RBIMPL_ANYARGS_DISPATCH((n) == 9, rb_define_private_method_09, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_08(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_10(n) RBIMPL_ANYARGS_DISPATCH((n) == 10, rb_define_private_method_10, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_09(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_11(n) RBIMPL_ANYARGS_DISPATCH((n) == 11, rb_define_private_method_11, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_10(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_12(n) RBIMPL_ANYARGS_DISPATCH((n) == 12, rb_define_private_method_12, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_11(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_13(n) RBIMPL_ANYARGS_DISPATCH((n) == 13, rb_define_private_method_13, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_12(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_14(n) RBIMPL_ANYARGS_DISPATCH((n) == 14, rb_define_private_method_14, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_13(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_15(n) RBIMPL_ANYARGS_DISPATCH((n) == 15, rb_define_private_method_15, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_14(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_m2(n) RBIMPL_ANYARGS_DISPATCH((n) == -2, rb_define_module_function_m2, rb_define_module_function_m3)
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_m1(n) RBIMPL_ANYARGS_DISPATCH((n) == -1, rb_define_module_function_m1, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_m2(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_00(n) RBIMPL_ANYARGS_DISPATCH((n) == 0, rb_define_module_function_00, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_m1(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_01(n) RBIMPL_ANYARGS_DISPATCH((n) == 1, rb_define_module_function_01, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_00(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_02(n) RBIMPL_ANYARGS_DISPATCH((n) == 2, rb_define_module_function_02, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_01(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_03(n) RBIMPL_ANYARGS_DISPATCH((n) == 3, rb_define_module_function_03, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_02(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_04(n) RBIMPL_ANYARGS_DISPATCH((n) == 4, rb_define_module_function_04, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_03(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_05(n) RBIMPL_ANYARGS_DISPATCH((n) == 5, rb_define_module_function_05, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_04(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_06(n) RBIMPL_ANYARGS_DISPATCH((n) == 6, rb_define_module_function_06, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_05(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_07(n) RBIMPL_ANYARGS_DISPATCH((n) == 7, rb_define_module_function_07, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_06(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_08(n) RBIMPL_ANYARGS_DISPATCH((n) == 8, rb_define_module_function_08, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_07(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_09(n) RBIMPL_ANYARGS_DISPATCH((n) == 9, rb_define_module_function_09, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_08(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_10(n) RBIMPL_ANYARGS_DISPATCH((n) == 10, rb_define_module_function_10, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_09(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_11(n) RBIMPL_ANYARGS_DISPATCH((n) == 11, rb_define_module_function_11, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_10(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_12(n) RBIMPL_ANYARGS_DISPATCH((n) == 12, rb_define_module_function_12, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_11(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_13(n) RBIMPL_ANYARGS_DISPATCH((n) == 13, rb_define_module_function_13, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_12(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_14(n) RBIMPL_ANYARGS_DISPATCH((n) == 14, rb_define_module_function_14, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_13(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_15(n) RBIMPL_ANYARGS_DISPATCH((n) == 15, rb_define_module_function_15, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_14(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_m2(n) RBIMPL_ANYARGS_DISPATCH((n) == -2, rb_define_global_function_m2, rb_define_global_function_m3)
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_m1(n) RBIMPL_ANYARGS_DISPATCH((n) == -1, rb_define_global_function_m1, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_m2(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_00(n) RBIMPL_ANYARGS_DISPATCH((n) == 0, rb_define_global_function_00, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_m1(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_01(n) RBIMPL_ANYARGS_DISPATCH((n) == 1, rb_define_global_function_01, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_00(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_02(n) RBIMPL_ANYARGS_DISPATCH((n) == 2, rb_define_global_function_02, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_01(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_03(n) RBIMPL_ANYARGS_DISPATCH((n) == 3, rb_define_global_function_03, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_02(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_04(n) RBIMPL_ANYARGS_DISPATCH((n) == 4, rb_define_global_function_04, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_03(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_05(n) RBIMPL_ANYARGS_DISPATCH((n) == 5, rb_define_global_function_05, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_04(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_06(n) RBIMPL_ANYARGS_DISPATCH((n) == 6, rb_define_global_function_06, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_05(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_07(n) RBIMPL_ANYARGS_DISPATCH((n) == 7, rb_define_global_function_07, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_06(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_08(n) RBIMPL_ANYARGS_DISPATCH((n) == 8, rb_define_global_function_08, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_07(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_09(n) RBIMPL_ANYARGS_DISPATCH((n) == 9, rb_define_global_function_09, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_08(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_10(n) RBIMPL_ANYARGS_DISPATCH((n) == 10, rb_define_global_function_10, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_09(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_11(n) RBIMPL_ANYARGS_DISPATCH((n) == 11, rb_define_global_function_11, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_10(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_12(n) RBIMPL_ANYARGS_DISPATCH((n) == 12, rb_define_global_function_12, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_11(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_13(n) RBIMPL_ANYARGS_DISPATCH((n) == 13, rb_define_global_function_13, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_12(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_14(n) RBIMPL_ANYARGS_DISPATCH((n) == 14, rb_define_global_function_14, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_13(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_15(n) RBIMPL_ANYARGS_DISPATCH((n) == 15, rb_define_global_function_15, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_14(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_m2(n) RBIMPL_ANYARGS_DISPATCH((n) == -2, rb_define_method_id_m2, rb_define_method_id_m3)
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_m1(n) RBIMPL_ANYARGS_DISPATCH((n) == -1, rb_define_method_id_m1, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_m2(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_00(n) RBIMPL_ANYARGS_DISPATCH((n) == 0, rb_define_method_id_00, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_m1(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_01(n) RBIMPL_ANYARGS_DISPATCH((n) == 1, rb_define_method_id_01, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_00(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_02(n) RBIMPL_ANYARGS_DISPATCH((n) == 2, rb_define_method_id_02, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_01(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_03(n) RBIMPL_ANYARGS_DISPATCH((n) == 3, rb_define_method_id_03, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_02(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_04(n) RBIMPL_ANYARGS_DISPATCH((n) == 4, rb_define_method_id_04, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_03(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_05(n) RBIMPL_ANYARGS_DISPATCH((n) == 5, rb_define_method_id_05, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_04(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_06(n) RBIMPL_ANYARGS_DISPATCH((n) == 6, rb_define_method_id_06, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_05(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_07(n) RBIMPL_ANYARGS_DISPATCH((n) == 7, rb_define_method_id_07, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_06(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_08(n) RBIMPL_ANYARGS_DISPATCH((n) == 8, rb_define_method_id_08, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_07(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_09(n) RBIMPL_ANYARGS_DISPATCH((n) == 9, rb_define_method_id_09, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_08(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_10(n) RBIMPL_ANYARGS_DISPATCH((n) == 10, rb_define_method_id_10, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_09(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_11(n) RBIMPL_ANYARGS_DISPATCH((n) == 11, rb_define_method_id_11, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_10(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_12(n) RBIMPL_ANYARGS_DISPATCH((n) == 12, rb_define_method_id_12, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_11(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_13(n) RBIMPL_ANYARGS_DISPATCH((n) == 13, rb_define_method_id_13, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_12(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_14(n) RBIMPL_ANYARGS_DISPATCH((n) == 14, rb_define_method_id_14, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_13(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_15(n) RBIMPL_ANYARGS_DISPATCH((n) == 15, rb_define_method_id_15, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_14(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_m2(n) RBIMPL_ANYARGS_DISPATCH((n) == -2, rb_define_method_m2, rb_define_method_m3)
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_m1(n) RBIMPL_ANYARGS_DISPATCH((n) == -1, rb_define_method_m1, RBIMPL_ANYARGS_DISPATCH_rb_define_method_m2(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_00(n) RBIMPL_ANYARGS_DISPATCH((n) == 0, rb_define_method_00, RBIMPL_ANYARGS_DISPATCH_rb_define_method_m1(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_01(n) RBIMPL_ANYARGS_DISPATCH((n) == 1, rb_define_method_01, RBIMPL_ANYARGS_DISPATCH_rb_define_method_00(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_02(n) RBIMPL_ANYARGS_DISPATCH((n) == 2, rb_define_method_02, RBIMPL_ANYARGS_DISPATCH_rb_define_method_01(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_03(n) RBIMPL_ANYARGS_DISPATCH((n) == 3, rb_define_method_03, RBIMPL_ANYARGS_DISPATCH_rb_define_method_02(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_04(n) RBIMPL_ANYARGS_DISPATCH((n) == 4, rb_define_method_04, RBIMPL_ANYARGS_DISPATCH_rb_define_method_03(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_05(n) RBIMPL_ANYARGS_DISPATCH((n) == 5, rb_define_method_05, RBIMPL_ANYARGS_DISPATCH_rb_define_method_04(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_06(n) RBIMPL_ANYARGS_DISPATCH((n) == 6, rb_define_method_06, RBIMPL_ANYARGS_DISPATCH_rb_define_method_05(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_07(n) RBIMPL_ANYARGS_DISPATCH((n) == 7, rb_define_method_07, RBIMPL_ANYARGS_DISPATCH_rb_define_method_06(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_08(n) RBIMPL_ANYARGS_DISPATCH((n) == 8, rb_define_method_08, RBIMPL_ANYARGS_DISPATCH_rb_define_method_07(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_09(n) RBIMPL_ANYARGS_DISPATCH((n) == 9, rb_define_method_09, RBIMPL_ANYARGS_DISPATCH_rb_define_method_08(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_10(n) RBIMPL_ANYARGS_DISPATCH((n) == 10, rb_define_method_10, RBIMPL_ANYARGS_DISPATCH_rb_define_method_09(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_11(n) RBIMPL_ANYARGS_DISPATCH((n) == 11, rb_define_method_11, RBIMPL_ANYARGS_DISPATCH_rb_define_method_10(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_12(n) RBIMPL_ANYARGS_DISPATCH((n) == 12, rb_define_method_12, RBIMPL_ANYARGS_DISPATCH_rb_define_method_11(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_13(n) RBIMPL_ANYARGS_DISPATCH((n) == 13, rb_define_method_13, RBIMPL_ANYARGS_DISPATCH_rb_define_method_12(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_14(n) RBIMPL_ANYARGS_DISPATCH((n) == 14, rb_define_method_14, RBIMPL_ANYARGS_DISPATCH_rb_define_method_13(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_15(n) RBIMPL_ANYARGS_DISPATCH((n) == 15, rb_define_method_15, RBIMPL_ANYARGS_DISPATCH_rb_define_method_14(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method(n, f) RBIMPL_ANYARGS_DISPATCH(RBIMPL_CFUNC_IS_rb_f_notimplement(f), rb_define_singleton_method_notimpl, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_15(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method(n, f) RBIMPL_ANYARGS_DISPATCH(RBIMPL_CFUNC_IS_rb_f_notimplement(f), rb_define_protected_method_notimpl, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_15(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method(n, f) RBIMPL_ANYARGS_DISPATCH(RBIMPL_CFUNC_IS_rb_f_notimplement(f), rb_define_private_method_notimpl, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_15(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function(n, f) RBIMPL_ANYARGS_DISPATCH(RBIMPL_CFUNC_IS_rb_f_notimplement(f), rb_define_module_function_notimpl, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_15(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function(n, f) RBIMPL_ANYARGS_DISPATCH(RBIMPL_CFUNC_IS_rb_f_notimplement(f), rb_define_global_function_notimpl, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_15(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id(n, f) RBIMPL_ANYARGS_DISPATCH(RBIMPL_CFUNC_IS_rb_f_notimplement(f), rb_define_method_id_notimpl, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_15(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method(n, f) RBIMPL_ANYARGS_DISPATCH(RBIMPL_CFUNC_IS_rb_f_notimplement(f), rb_define_method_notimpl, RBIMPL_ANYARGS_DISPATCH_rb_define_method_15(n))
# define RBIMPL_ANYARGS_ATTRSET(sym) RBIMPL_ATTR_MAYBE_UNUSED() RBIMPL_ATTR_NONNULL(()) RBIMPL_ATTR_WEAKREF(sym)
# define RBIMPL_ANYARGS_DECL(sym, ...) \
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _notimpl(__VA_ARGS__, VALUE(*)(int, const VALUE *, VALUE, VALUE), int); \
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _m3(__VA_ARGS__, VALUE(*)(ANYARGS), int); \
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _m2(__VA_ARGS__, VALUE(*)(VALUE, VALUE), int); \
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _m1(__VA_ARGS__, VALUE(*)(int, union { VALUE *x; const VALUE *y; } __attribute__((__transparent_union__)), VALUE), int); \
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _00(__VA_ARGS__, VALUE(*)(VALUE), int); \
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _01(__VA_ARGS__, VALUE(*)(VALUE, VALUE), int); \
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _02(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE), int); \
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _03(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE), int); \
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _04(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE), int); \
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _05(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _06(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _07(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _08(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _09(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _10(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _11(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _12(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _13(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _14(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _15(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int);
RBIMPL_ANYARGS_DECL(rb_define_singleton_method, VALUE, const char *)
RBIMPL_ANYARGS_DECL(rb_define_protected_method, VALUE, const char *)
RBIMPL_ANYARGS_DECL(rb_define_private_method, VALUE, const char *)
RBIMPL_ANYARGS_DECL(rb_define_module_function, VALUE, const char *)
RBIMPL_ANYARGS_DECL(rb_define_global_function, const char *)
RBIMPL_ANYARGS_DECL(rb_define_method_id, VALUE, ID)
RBIMPL_ANYARGS_DECL(rb_define_method, VALUE, const char *)
/** @endcond */
/**
* @brief Defines klass\#mid.
* @see ::rb_define_method
* @param klass Where the method lives.
* @param mid Name of the defining method.
* @param func Implementation of klass\#mid.
* @param arity Arity of klass\#mid.
*/
#define rb_define_method(klass, mid, func, arity) RBIMPL_ANYARGS_DISPATCH_rb_define_method((arity), (func))((klass), (mid), (func), (arity))
/**
* @brief Defines klass\#mid.
* @see ::rb_define_method_id
* @param klass Where the method lives.
* @param mid Name of the defining method.
* @param func Implementation of klass\#mid.
* @param arity Arity of klass\#mid.
*/
#define rb_define_method_id(klass, mid, func, arity) RBIMPL_ANYARGS_DISPATCH_rb_define_method_id((arity), (func))((klass), (mid), (func), (arity))
/**
* @brief Defines obj.mid.
* @see ::rb_define_singleton_method
* @param obj Where the method lives.
* @param mid Name of the defining method.
* @param func Implementation of obj.mid.
* @param arity Arity of obj.mid.
*/
#define rb_define_singleton_method(obj, mid, func, arity) RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method((arity), (func))((obj), (mid), (func), (arity))
/**
* @brief Defines klass\#mid and make it protected.
* @see ::rb_define_protected_method
* @param klass Where the method lives.
* @param mid Name of the defining method.
* @param func Implementation of klass\#mid.
* @param arity Arity of klass\#mid.
*/
#define rb_define_protected_method(klass, mid, func, arity) RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method((arity), (func))((klass), (mid), (func), (arity))
/**
* @brief Defines klass\#mid and make it private.
* @see ::rb_define_private_method
* @param klass Where the method lives.
* @param mid Name of the defining method.
* @param func Implementation of klass\#mid.
* @param arity Arity of klass\#mid.
*/
#define rb_define_private_method(klass, mid, func, arity) RBIMPL_ANYARGS_DISPATCH_rb_define_private_method((arity), (func))((klass), (mid), (func), (arity))
/**
* @brief Defines mod\#mid and make it a module function.
* @see ::rb_define_module_function
* @param mod Where the method lives.
* @param mid Name of the defining method.
* @param func Implementation of mod\#mid.
* @param arity Arity of mod\#mid.
*/
#define rb_define_module_function(mod, mid, func, arity) RBIMPL_ANYARGS_DISPATCH_rb_define_module_function((arity), (func))((mod), (mid), (func), (arity))
/**
* @brief Defines ::rb_mKerbel \#mid.
* @see ::rb_define_global_function
* @param mid Name of the defining method.
* @param func Implementation of ::rb_mKernel \#mid.
* @param arity Arity of ::rb_mKernel \#mid.
*/
#define rb_define_global_function(mid, func, arity) RBIMPL_ANYARGS_DISPATCH_rb_define_global_function((arity), (func))((mid), (func), (arity))
#endif /* __cplusplus */
/**
* This macro is to properly cast a function parameter of *_define_method
* family. It has been around since 1.x era so you can maximise backwards
* compatibility by using it.
*
* ```CXX
* rb_define_method(klass, "method", RUBY_METHOD_FUNC(func), arity);
* ```
*
* @param func A pointer to a function that implements a method.
*/
#if ! defined(RUBY_DEVEL)
# define RUBY_METHOD_FUNC(func) RBIMPL_CAST((VALUE (*)(ANYARGS))(func))
#elif ! RUBY_DEVEL
# define RUBY_METHOD_FUNC(func) RBIMPL_CAST((VALUE (*)(ANYARGS))(func))
#elif ! defined(rb_define_method)
# define RUBY_METHOD_FUNC(func) RBIMPL_CAST((VALUE (*)(ANYARGS))(func))
#else
# define RUBY_METHOD_FUNC(func) (func)
#endif
#endif /* RBIMPL_ANYARGS_H */

View File

@@ -1,39 +0,0 @@
#ifndef RBIMPL_ARITHMETIC_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ARITHMETIC_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Conversion between C's arithmetic types and Ruby's numeric
* types.
*/
#include "ruby/internal/arithmetic/char.h"
#include "ruby/internal/arithmetic/double.h"
#include "ruby/internal/arithmetic/fixnum.h"
#include "ruby/internal/arithmetic/gid_t.h"
#include "ruby/internal/arithmetic/int.h"
#include "ruby/internal/arithmetic/intptr_t.h"
#include "ruby/internal/arithmetic/long.h"
#include "ruby/internal/arithmetic/long_long.h"
#include "ruby/internal/arithmetic/mode_t.h"
#include "ruby/internal/arithmetic/off_t.h"
#include "ruby/internal/arithmetic/pid_t.h"
#include "ruby/internal/arithmetic/short.h"
#include "ruby/internal/arithmetic/size_t.h"
#include "ruby/internal/arithmetic/st_data_t.h"
#include "ruby/internal/arithmetic/uid_t.h"
#endif /* RBIMPL_ARITHMETIC_H */

View File

@@ -1,81 +0,0 @@
#ifndef RBIMPL_ARITHMETIC_CHAR_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ARITHMETIC_CHAR_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Arithmetic conversion between C's `char` and Ruby's.
*/
#include "ruby/internal/arithmetic/int.h" /* NUM2INT is here, but */
#include "ruby/internal/arithmetic/long.h" /* INT2FIX is here.*/
#include "ruby/internal/attr/artificial.h"
#include "ruby/internal/attr/const.h"
#include "ruby/internal/attr/constexpr.h"
#include "ruby/internal/cast.h"
#include "ruby/internal/core/rstring.h"
#include "ruby/internal/value_type.h"
#define RB_NUM2CHR rb_num2char_inline /**< @alias{rb_num2char_inline} */
#define NUM2CHR RB_NUM2CHR /**< @old{RB_NUM2CHR} */
#define CHR2FIX RB_CHR2FIX /**< @old{RB_CHR2FIX} */
/** @cond INTERNAL_MACRO */
#define RB_CHR2FIX RB_CHR2FIX
/** @endcond */
RBIMPL_ATTR_CONST_UNLESS_DEBUG()
RBIMPL_ATTR_CONSTEXPR_UNLESS_DEBUG(CXX14)
RBIMPL_ATTR_ARTIFICIAL()
/**
* Converts a C's `unsigned char` into an instance of ::rb_cInteger.
*
* @param[in] c Arbitrary `unsigned char` value.
* @return An instance of ::rb_cInteger.
*
* @internal
*
* Nobody explicitly states this but in Ruby, a char means an unsigned integer
* value of range 0..255. This is a general principle. AFAIK there is no
* single line of code where char is signed.
*/
static inline VALUE
RB_CHR2FIX(unsigned char c)
{
return RB_INT2FIX(c);
}
/**
* Converts an instance of ::rb_cNumeric into C's `char`. At the same time it
* accepts a String of more than one character, and returns its first byte. In
* the early days there was a Ruby level "character" literal `?c`, which
* roughly worked this way.
*
* @param[in] x Either a string or a numeric.
* @exception rb_eTypeError `x` is not a numeric.
* @exception rb_eRangeError `x` is out of range of `unsigned int`.
* @return The passed value converted into C's `char`.
*/
static inline char
rb_num2char_inline(VALUE x)
{
if (RB_TYPE_P(x, RUBY_T_STRING) && (RSTRING_LEN(x)>=1))
return RSTRING_PTR(x)[0];
else
return RBIMPL_CAST((char)RB_NUM2INT(x));
}
#endif /* RBIMPL_ARITHMETIC_CHAR_H */

View File

@@ -1,72 +0,0 @@
#ifndef RBIMPL_ARITHMETIC_DOUBLE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ARITHMETIC_DOUBLE_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Arithmetic conversion between C's `double` and Ruby's.
*/
#include "ruby/internal/attr/pure.h"
#include "ruby/internal/dllexport.h"
#include "ruby/internal/value.h"
#define NUM2DBL rb_num2dbl /**< @old{rb_num2dbl} */
#define RFLOAT_VALUE rb_float_value /**< @old{rb_float_value} */
#define DBL2NUM rb_float_new /**< @old{rb_float_new} */
RBIMPL_SYMBOL_EXPORT_BEGIN()
/**
* Converts an instance of ::rb_cNumeric into C's `double`.
*
* @param[in] num Something numeric.
* @exception rb_eTypeError `num` is not a numeric.
* @return The passed value converted into C's `double`.
*/
double rb_num2dbl(VALUE num);
RBIMPL_ATTR_PURE()
/**
* Extracts its double value from an instance of ::rb_cFloat.
*
* @param[in] num An instance of ::rb_cFloat.
* @pre Must not pass anything other than a Fixnum.
* @return The passed value converted into C's `double`.
*/
double rb_float_value(VALUE num);
/**
* Converts a C's `double` into an instance of ::rb_cFloat.
*
* @param[in] d Arbitrary `double` value.
* @return An instance of ::rb_cFloat.
*/
VALUE rb_float_new(double d);
/**
* Identical to rb_float_new(), except it does not generate Flonums.
*
* @param[in] d Arbitrary `double` value.
* @return An instance of ::rb_cFloat.
*
* @internal
*
* @shyouhei has no idea why it is here.
*/
VALUE rb_float_new_in_heap(double d);
RBIMPL_SYMBOL_EXPORT_END()
#endif /* RBIMPL_ARITHMETIC_DOUBLE_H */

View File

@@ -1,60 +0,0 @@
#ifndef RBIMPL_ARITHMETIC_FIXNUM_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ARITHMETIC_FIXNUM_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Handling of integers formerly known as Fixnums.
*/
#include "ruby/backward/2/limits.h"
#define FIXABLE RB_FIXABLE /**< @old{RB_FIXABLE} */
#define FIXNUM_MAX RUBY_FIXNUM_MAX /**< @old{RUBY_FIXNUM_MAX} */
#define FIXNUM_MIN RUBY_FIXNUM_MIN /**< @old{RUBY_FIXNUM_MIN} */
#define NEGFIXABLE RB_NEGFIXABLE /**< @old{RB_NEGFIXABLE} */
#define POSFIXABLE RB_POSFIXABLE /**< @old{RB_POSFIXABLE} */
/**
* Checks if the passed value is in range of fixnum, assuming it is a positive
* number. Can sometimes be useful for C's unsigned integer types.
*
* @internal
*
* FIXABLE can be applied to anything, from double to intmax_t. The problem is
* double. On a 64bit system RUBY_FIXNUM_MAX is 4,611,686,018,427,387,903,
* which is not representable by a double. The nearest value that a double can
* represent is 4,611,686,018,427,387,904, which is not fixable. The
* seemingly-strange "< FIXNUM_MAX + 1" expression below is due to this.
*/
#define RB_POSFIXABLE(_) ((_) < RUBY_FIXNUM_MAX + 1)
/**
* Checks if the passed value is in range of fixnum, assuming it is a negative
* number. This is an implementation of #RB_FIXABLE. Rarely used stand alone.
*/
#define RB_NEGFIXABLE(_) ((_) >= RUBY_FIXNUM_MIN)
/** Checks if the passed value is in range of fixnum */
#define RB_FIXABLE(_) (RB_POSFIXABLE(_) && RB_NEGFIXABLE(_))
/** Maximum possible value that a fixnum can represent. */
#define RUBY_FIXNUM_MAX (LONG_MAX / 2)
/** Minimum possible value that a fixnum can represent. */
#define RUBY_FIXNUM_MIN (LONG_MIN / 2)
#endif /* RBIMPL_ARITHMETIC_FIXNUM_H */

View File

@@ -1,41 +0,0 @@
#ifndef RBIMPL_ARITHMETIC_GID_T_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ARITHMETIC_GID_T_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Arithmetic conversion between C's `gid_t` and Ruby's.
*/
#include "ruby/internal/config.h"
#include "ruby/internal/arithmetic/long.h"
/** Converts a C's `gid_t` into an instance of ::rb_cInteger. */
#ifndef GIDT2NUM
# define GIDT2NUM RB_LONG2NUM
#endif
/** Converts an instance of ::rb_cNumeric into C's `gid_t`. */
#ifndef NUM2GIDT
# define NUM2GIDT RB_NUM2LONG
#endif
/** A rb_sprintf() format prefix to be used for a `gid_t` parameter. */
#ifndef PRI_GIDT_PREFIX
# define PRI_GIDT_PREFIX PRI_LONG_PREFIX
#endif
#endif /* RBIMPL_ARITHMETIC_GID_T_H */

View File

@@ -1,264 +0,0 @@
#ifndef RBIMPL_ARITHMETIC_INT_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ARITHMETIC_INT_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Arithmetic conversion between C's `int` and Ruby's.
*/
#include "ruby/internal/config.h"
#include "ruby/internal/arithmetic/fixnum.h"
#include "ruby/internal/arithmetic/intptr_t.h"
#include "ruby/internal/arithmetic/long.h"
#include "ruby/internal/attr/artificial.h"
#include "ruby/internal/attr/const.h"
#include "ruby/internal/attr/constexpr.h"
#include "ruby/internal/compiler_is.h"
#include "ruby/internal/dllexport.h"
#include "ruby/internal/special_consts.h"
#include "ruby/internal/value.h"
#include "ruby/internal/warning_push.h"
#include "ruby/assert.h"
#define RB_INT2NUM rb_int2num_inline /**< @alias{rb_int2num_inline} */
#define RB_NUM2INT rb_num2int_inline /**< @alias{rb_num2int_inline} */
#define RB_UINT2NUM rb_uint2num_inline /**< @alias{rb_uint2num_inline} */
#define FIX2INT RB_FIX2INT /**< @old{RB_FIX2INT} */
#define FIX2UINT RB_FIX2UINT /**< @old{RB_FIX2UINT} */
#define INT2NUM RB_INT2NUM /**< @old{RB_INT2NUM} */
#define NUM2INT RB_NUM2INT /**< @old{RB_NUM2INT} */
#define NUM2UINT RB_NUM2UINT /**< @old{RB_NUM2UINT} */
#define UINT2NUM RB_UINT2NUM /**< @old{RB_UINT2NUM} */
/** @cond INTERNAL_MACRO */
#define RB_FIX2INT RB_FIX2INT
#define RB_NUM2UINT RB_NUM2UINT
#define RB_FIX2UINT RB_FIX2UINT
/** @endcond */
RBIMPL_SYMBOL_EXPORT_BEGIN()
/**
* Converts an instance of ::rb_cNumeric into C's `long`.
*
* @param[in] num Something numeric.
* @exception rb_eTypeError `num` is not a numeric.
* @exception rb_eRangeError `num` is out of range of `int`.
* @return The passed value converted into C's `long`.
*
* @internal
*
* Yes, the API is really strange. It returns `long`, but raises when the
* value is out of `int`. This seems to be due to the fact that Matz favoured
* K&R before, and his machine at that moment was an ILP32 architecture.
*/
long rb_num2int(VALUE num);
/**
* Identical to rb_num2int().
*
* @param[in] num Something numeric.
* @exception rb_eTypeError `num` is not a numeric.
* @exception rb_eRangeError `num` is out of range of `int`.
* @return The passed value converted into C's `long`.
*
* @internal
*
* This function seems to be a complete waste of disk space. @shyouhei has no
* idea why this is a different thing from rb_num2short().
*/
long rb_fix2int(VALUE num);
/**
* Converts an instance of ::rb_cNumeric into C's `unsigned long`.
*
* @param[in] num Something numeric.
* @exception rb_eTypeError `num` is not a numeric.
* @exception rb_eRangeError `num` is out of range of `unsigned int`.
* @return The passed value converted into C's `unsigned long`.
*
* @internal
*
* Yes, the API is really strange. It returns `unsigned long`, but raises when
* the value is out of `unsigned int`. This seems to be due to the fact that
* Matz favoured K&R before, and his machine at that moment was an ILP32
* architecture.
*/
unsigned long rb_num2uint(VALUE num);
/**
* Identical to rb_num2uint().
*
* @param[in] num Something numeric.
* @exception rb_eTypeError `num` is not a numeric.
* @exception rb_eRangeError `num` is out of range of `unsigned int`.
* @return The passed value converted into C's `unsigned long`.
*
* @internal
*
* This function seems to be a complete waste of disk space. @shyouhei has no
* idea why this is a different thing from rb_num2short().
*/
unsigned long rb_fix2uint(VALUE num);
RBIMPL_SYMBOL_EXPORT_END()
RBIMPL_ATTR_ARTIFICIAL()
/**
* Converts a Fixnum into C's `int`.
*
* @param[in] x Some Fixnum.
* @pre Must not pass anything other than a Fixnum.
* @return The passed value converted into C's `int`.
*/
static inline int
RB_FIX2INT(VALUE x)
{
/* "FIX2INT raises a TypeError if passed nil", says rubyspec. Not sure if
* that is a desired behaviour but just preserve backwards compatilibily.
*/
#if 0
RBIMPL_ASSERT_OR_ASSUME(RB_FIXNUM_P(x));
#endif
long ret;
if /* constexpr */ (sizeof(int) < sizeof(long)) {
ret = rb_fix2int(x);
}
else {
ret = RB_FIX2LONG(x);
}
return RBIMPL_CAST((int)ret);
}
/**
* Converts an instance of ::rb_cNumeric into C's `int`.
*
* @param[in] x Something numeric.
* @exception rb_eTypeError `x` is not a numeric.
* @exception rb_eRangeError `x` is out of range of `int`.
* @return The passed value converted into C's `int`.
*/
static inline int
rb_num2int_inline(VALUE x)
{
long ret;
if /* constexpr */ (sizeof(int) == sizeof(long)) {
ret = RB_NUM2LONG(x);
}
else if (RB_FIXNUM_P(x)) {
ret = rb_fix2int(x);
}
else {
ret = rb_num2int(x);
}
return RBIMPL_CAST((int)ret);
}
/**
* Converts an instance of ::rb_cNumeric into C's `unsigned int`.
*
* @param[in] x Something numeric.
* @exception rb_eTypeError `x` is not a numeric.
* @exception rb_eRangeError `x` is out of range of `unsigned int`.
* @return The passed value converted into C's `unsigned int`.
*/
RBIMPL_ATTR_ARTIFICIAL()
static inline unsigned int
RB_NUM2UINT(VALUE x)
{
unsigned long ret;
if /* constexpr */ (sizeof(int) < sizeof(long)) {
ret = rb_num2uint(x);
}
else {
ret = RB_NUM2ULONG(x);
}
return RBIMPL_CAST((unsigned int)ret);
}
RBIMPL_ATTR_ARTIFICIAL()
/**
* Converts a Fixnum into C's `int`.
*
* @param[in] x Some Fixnum.
* @pre Must not pass anything other than a Fixnum.
* @return The passed value converted into C's `int`.
*/
static inline unsigned int
RB_FIX2UINT(VALUE x)
{
#if 0 /* Ditto for RB_FIX2INT. */
RBIMPL_ASSERT_OR_ASSUME(RB_FIXNUM_P(x));
#endif
unsigned long ret;
if /* constexpr */ (sizeof(int) < sizeof(long)) {
ret = rb_fix2uint(x);
}
else {
ret = RB_FIX2ULONG(x);
}
return RBIMPL_CAST((unsigned int)ret);
}
RBIMPL_WARNING_PUSH()
#if RBIMPL_COMPILER_IS(GCC)
RBIMPL_WARNING_IGNORED(-Wtype-limits) /* We can ignore them here. */
#elif RBIMPL_HAS_WARNING("-Wtautological-constant-out-of-range-compare")
RBIMPL_WARNING_IGNORED(-Wtautological-constant-out-of-range-compare)
#endif
/**
* Converts a C's `int` into an instance of ::rb_cInteger.
*
* @param[in] v Arbitrary `int` value.
* @return An instance of ::rb_cInteger.
*/
static inline VALUE
rb_int2num_inline(int v)
{
if (RB_FIXABLE(v))
return RB_INT2FIX(v);
else
return rb_int2big(v);
}
/**
* Converts a C's `unsigned int` into an instance of ::rb_cInteger.
*
* @param[in] v Arbitrary `unsigned int` value.
* @return An instance of ::rb_cInteger.
*/
static inline VALUE
rb_uint2num_inline(unsigned int v)
{
if (RB_POSFIXABLE(v))
return RB_LONG2FIX(v);
else
return rb_uint2big(v);
}
RBIMPL_WARNING_POP()
#endif /* RBIMPL_ARITHMETIC_INT_H */

View File

@@ -1,74 +0,0 @@
#ifndef RBIMPL_ARITHMETIC_INTPTR_T_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ARITHMETIC_INTPTR_T_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Arithmetic conversion between C's `intptr_t` and Ruby's.
*/
#include "ruby/internal/config.h"
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#include "ruby/internal/value.h"
#include "ruby/internal/dllexport.h"
#define rb_int_new rb_int2inum /**< @alias{rb_int2inum} */
#define rb_uint_new rb_uint2inum /**< @alias{rb_uint2inum} */
RBIMPL_SYMBOL_EXPORT_BEGIN()
/**
* Converts a C's `intptr_t` into an instance of ::rb_cInteger.
*
* @param[in] i Arbitrary `intptr_t` value.
* @return An instance of ::rb_cInteger.
* @note This function always allocates Bignums, even if the given number
* is small enough to fit into a Fixnum.
*/
VALUE rb_int2big(intptr_t i);
/**
* Converts a C's `intptr_t` into an instance of ::rb_cInteger.
*
* @param[in] i Arbitrary `intptr_t` value.
* @return An instance of ::rb_cInteger.
*/
VALUE rb_int2inum(intptr_t i);
/**
* Converts a C's `intptr_t` into an instance of ::rb_cInteger.
*
* @param[in] i Arbitrary `intptr_t` value.
* @return An instance of ::rb_cInteger.
* @note This function always allocates Bignums, even if the given number
* is small enough to fit into a Fixnum.
*/
VALUE rb_uint2big(uintptr_t i);
/**
* Converts a C's `uintptr_t` into an instance of ::rb_cInteger.
*
* @param[in] i Arbitrary `uintptr_t` value.
* @return An instance of ::rb_cInteger.
*/
VALUE rb_uint2inum(uintptr_t i);
RBIMPL_SYMBOL_EXPORT_END()
#endif /* RBIMPL_ARITHMETIC_INTPTR_T_H */

View File

@@ -1,356 +0,0 @@
#ifndef RBIMPL_ARITHMETIC_LONG_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ARITHMETIC_LONG_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Arithmetic conversion between C's `long` and Ruby's.
*
* ### Q&A ###
*
* - Q: Why are INT2FIX etc. here, not in `int.h`?
*
* - A: Because they are in fact handling `long`. It seems someone did not
* understand the difference of `int` and `long` when they designed those
* macros.
*/
#include "ruby/internal/config.h"
#include "ruby/internal/arithmetic/fixnum.h" /* FIXABLE */
#include "ruby/internal/arithmetic/intptr_t.h" /* rb_int2big etc.*/
#include "ruby/internal/assume.h"
#include "ruby/internal/attr/artificial.h"
#include "ruby/internal/attr/cold.h"
#include "ruby/internal/attr/const.h"
#include "ruby/internal/attr/constexpr.h"
#include "ruby/internal/attr/noreturn.h"
#include "ruby/internal/cast.h"
#include "ruby/internal/dllexport.h"
#include "ruby/internal/special_consts.h" /* FIXNUM_FLAG */
#include "ruby/internal/value.h"
#include "ruby/assert.h"
#define FIX2LONG RB_FIX2LONG /**< @old{RB_FIX2LONG} */
#define FIX2ULONG RB_FIX2ULONG /**< @old{RB_FIX2ULONG} */
#define INT2FIX RB_INT2FIX /**< @old{RB_INT2FIX} */
#define LONG2FIX RB_INT2FIX /**< @old{RB_INT2FIX} */
#define LONG2NUM RB_LONG2NUM /**< @old{RB_LONG2NUM} */
#define NUM2LONG RB_NUM2LONG /**< @old{RB_NUM2LONG} */
#define NUM2ULONG RB_NUM2ULONG /**< @old{RB_NUM2ULONG} */
#define RB_FIX2LONG rb_fix2long /**< @alias{rb_fix2long} */
#define RB_FIX2ULONG rb_fix2ulong /**< @alias{rb_fix2ulong} */
#define RB_LONG2FIX RB_INT2FIX /**< @alias{RB_INT2FIX} */
#define RB_LONG2NUM rb_long2num_inline /**< @alias{rb_long2num_inline} */
#define RB_NUM2LONG rb_num2long_inline /**< @alias{rb_num2long_inline} */
#define RB_NUM2ULONG rb_num2ulong_inline /**< @alias{rb_num2ulong_inline} */
#define RB_ULONG2NUM rb_ulong2num_inline /**< @alias{rb_ulong2num_inline} */
#define ULONG2NUM RB_ULONG2NUM /**< @old{RB_ULONG2NUM} */
#define rb_fix_new RB_INT2FIX /**< @alias{RB_INT2FIX} */
#define rb_long2int rb_long2int_inline /**< @alias{rb_long2int_inline} */
/** @cond INTERNAL_MACRO */
#define RB_INT2FIX RB_INT2FIX
/** @endcond */
RBIMPL_SYMBOL_EXPORT_BEGIN()
RBIMPL_ATTR_NORETURN()
RBIMPL_ATTR_COLD()
/**
* This is an utility function to raise an ::rb_eRangeError.
*
* @param[in] num A signed value about to overflow.
* @exception rb_eRangeError `num` is out of range of `int`.
*/
void rb_out_of_int(SIGNED_VALUE num);
/**
* Converts an instance of ::rb_cNumeric into C's `long`.
*
* @param[in] num Something numeric.
* @exception rb_eTypeError `num` is not a numeric.
* @exception rb_eRangeError `num` is out of range of `long`.
* @return The passed value converted into C's `long`.
*/
long rb_num2long(VALUE num);
/**
* Converts an instance of ::rb_cNumeric into C's `unsigned long`.
*
* @param[in] num Something numeric.
* @exception rb_eTypeError `num` is not a numeric.
* @exception rb_eRangeError `num` is out of range of `unsigned long`.
* @return The passed value converted into C's `unsigned long`.
*/
unsigned long rb_num2ulong(VALUE num);
RBIMPL_SYMBOL_EXPORT_END()
RBIMPL_ATTR_CONST_UNLESS_DEBUG()
RBIMPL_ATTR_CONSTEXPR_UNLESS_DEBUG(CXX14)
RBIMPL_ATTR_ARTIFICIAL()
/**
* Converts a C's `long` into an instance of ::rb_cInteger.
*
* @param[in] i Arbitrary `long` value.
* @return An instance of ::rb_cInteger.
*/
static inline VALUE
RB_INT2FIX(long i)
{
RBIMPL_ASSERT_OR_ASSUME(RB_FIXABLE(i));
/* :NOTE: VALUE can be wider than long. As j being unsigned, 2j+1 is fully
* defined. Also it can be compiled into a single LEA instruction. */
const unsigned long j = i;
const unsigned long k = (j << 1) + RUBY_FIXNUM_FLAG;
const long l = k;
const SIGNED_VALUE m = l; /* Sign extend */
const VALUE n = m;
RBIMPL_ASSERT_OR_ASSUME(RB_FIXNUM_P(n));
return n;
}
/**
* Checks if `int` can hold the given integer.
*
* @param[in] n Arbitrary `long` value.
* @exception rb_eRangeError `n` is out of range of `int`.
* @return Identical value of type `int`
*/
static inline int
rb_long2int_inline(long n)
{
int i = RBIMPL_CAST((int)n);
if /* constexpr */ (sizeof(long) <= sizeof(int)) {
RBIMPL_ASSUME(i == n);
}
if (i != n)
rb_out_of_int(n);
return i;
}
RBIMPL_ATTR_CONST_UNLESS_DEBUG()
RBIMPL_ATTR_CONSTEXPR_UNLESS_DEBUG(CXX14)
/**
* @private
*
* This is an implementation detail of rb_fix2long(). People don't use it
* directly.
*
* @param[in] x A Fixnum.
* @return Identical value of type `long`
* @pre Must not pass anything other than a Fixnum.
*/
static inline long
rbimpl_fix2long_by_idiv(VALUE x)
{
RBIMPL_ASSERT_OR_ASSUME(RB_FIXNUM_P(x));
/* :NOTE: VALUE can be wider than long. (x-1)/2 never overflows because
* RB_FIXNUM_P(x) holds. Also it has no portability issue like y>>1
* below. */
const SIGNED_VALUE y = x - RUBY_FIXNUM_FLAG;
const SIGNED_VALUE z = y / 2;
const long w = RBIMPL_CAST((long)z);
RBIMPL_ASSERT_OR_ASSUME(RB_FIXABLE(w));
return w;
}
RBIMPL_ATTR_CONST_UNLESS_DEBUG()
RBIMPL_ATTR_CONSTEXPR_UNLESS_DEBUG(CXX14)
/**
* @private
*
* This is an implementation detail of rb_fix2long(). People don't use it
* directly.
*
* @param[in] x A Fixnum.
* @return Identical value of type `long`
* @pre Must not pass anything other than a Fixnum.
*/
static inline long
rbimpl_fix2long_by_shift(VALUE x)
{
RBIMPL_ASSERT_OR_ASSUME(RB_FIXNUM_P(x));
/* :NOTE: VALUE can be wider than long. If right shift is arithmetic, this
* is noticeably faster than above. */
const SIGNED_VALUE y = x;
const SIGNED_VALUE z = y >> 1;
const long w = RBIMPL_CAST((long)z);
RBIMPL_ASSERT_OR_ASSUME(RB_FIXABLE(w));
return w;
}
RBIMPL_ATTR_CONST()
RBIMPL_ATTR_CONSTEXPR(CXX11)
/**
* @private
*
* This is an implementation detail of rb_fix2long(). People don't use it
* directly.
*
* @retval true This C compiler's right shift operator is arithmetic.
* @retval false This C compiler's right shift operator is logical.
*/
static inline bool
rbimpl_right_shift_is_arithmetic_p(void)
{
return (-1 >> 1) == -1;
}
RBIMPL_ATTR_CONST_UNLESS_DEBUG()
RBIMPL_ATTR_CONSTEXPR_UNLESS_DEBUG(CXX14)
/**
* Converts a Fixnum into C's `long`.
*
* @param[in] x Some Fixnum.
* @pre Must not pass anything other than a Fixnum.
* @return The passed value converted into C's `long`.
*/
static inline long
rb_fix2long(VALUE x)
{
if /* constexpr */ (rbimpl_right_shift_is_arithmetic_p()) {
return rbimpl_fix2long_by_shift(x);
}
else {
return rbimpl_fix2long_by_idiv(x);
}
}
RBIMPL_ATTR_CONST_UNLESS_DEBUG()
RBIMPL_ATTR_CONSTEXPR_UNLESS_DEBUG(CXX14)
/**
* Converts a Fixnum into C's `unsigned long`.
*
* @param[in] x Some Fixnum.
* @pre Must not pass anything other than a Fixnum.
* @return The passed value converted into C's `unsigned long`.
* @note Negative fixnums will be converted into large unsigned longs.
*/
static inline unsigned long
rb_fix2ulong(VALUE x)
{
RBIMPL_ASSERT_OR_ASSUME(RB_FIXNUM_P(x));
return rb_fix2long(x);
}
/**
* Converts an instance of ::rb_cNumeric into C's `long`.
*
* @param[in] x Something numeric.
* @exception rb_eTypeError `x` is not a numeric.
* @exception rb_eRangeError `x` is out of range of `long`.
* @return The passed value converted into C's `long`.
*/
static inline long
rb_num2long_inline(VALUE x)
{
if (RB_FIXNUM_P(x))
return RB_FIX2LONG(x);
else
return rb_num2long(x);
}
/**
* Converts an instance of ::rb_cNumeric into C's `unsigned long`.
*
* @param[in] x Something numeric.
* @exception rb_eTypeError `x` is not a numeric.
* @exception rb_eRangeError `x` is out of range of `unsigned long`.
* @return The passed value converted into C's `unsigned long`.
*
* @internal
*
* This (negative fixnum would become a large unsigned long while negative
* bignum is an exception) has been THE behaviour of NUM2ULONG since the
* beginning. It is strange, but we can no longer change how it works at this
* moment. We have to get by with it.
*
* @see https://bugs.ruby-lang.org/issues/9089
*/
static inline unsigned long
rb_num2ulong_inline(VALUE x)
{
if (RB_FIXNUM_P(x))
return RB_FIX2ULONG(x);
else
return rb_num2ulong(x);
}
/**
* Converts a C's `long` into an instance of ::rb_cInteger.
*
* @param[in] v Arbitrary `long` value.
* @return An instance of ::rb_cInteger.
*/
static inline VALUE
rb_long2num_inline(long v)
{
if (RB_FIXABLE(v))
return RB_LONG2FIX(v);
else
return rb_int2big(v);
}
/**
* Converts a C's `unsigned long` into an instance of ::rb_cInteger.
*
* @param[in] v Arbitrary `unsigned long` value.
* @return An instance of ::rb_cInteger.
*/
static inline VALUE
rb_ulong2num_inline(unsigned long v)
{
if (RB_POSFIXABLE(v))
return RB_LONG2FIX(v);
else
return rb_uint2big(v);
}
/**
* @cond INTERNAL_MACRO
*
* Following overload is necessary because sometimes INT2FIX is used as a enum
* value (e.g. `enum { FOO = INT2FIX(0) };`). THIS IS NG in theory because a
* VALUE does not fit into an enum (which must be a signed int). But we cannot
* break existing codes.
*/
#if RBIMPL_HAS_ATTR_CONSTEXPR_CXX14
# /* C++ can write constexpr as enum values. */
#elif ! defined(HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P)
# undef INT2FIX
# define INT2FIX(i) (RBIMPL_CAST((VALUE)(i)) << 1 | RUBY_FIXNUM_FLAG)
#else
# undef INT2FIX
# define INT2FIX(i) \
__builtin_choose_expr( \
__builtin_constant_p(i), \
RBIMPL_CAST((VALUE)(i)) << 1 | RUBY_FIXNUM_FLAG, \
RB_INT2FIX(i))
#endif
/** @endcond */
#endif /* RBIMPL_ARITHMETIC_LONG_H */

View File

@@ -1,135 +0,0 @@
#ifndef RBIMPL_ARITHMETIC_LONG_LONG_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ARITHMETIC_LONG_LONG_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Arithmetic conversion between C's `long long` and Ruby's.
*/
#include "ruby/internal/value.h"
#include "ruby/internal/dllexport.h"
#include "ruby/internal/special_consts.h"
#include "ruby/backward/2/long_long.h"
#define RB_LL2NUM rb_ll2num_inline /**< @alias{rb_ll2num_inline} */
#define RB_ULL2NUM rb_ull2num_inline /**< @alias{rb_ull2num_inline} */
#define LL2NUM RB_LL2NUM /**< @old{RB_LL2NUM} */
#define ULL2NUM RB_ULL2NUM /**< @old{RB_ULL2NUM} */
#define RB_NUM2LL rb_num2ll_inline /**< @alias{rb_num2ll_inline} */
#define RB_NUM2ULL rb_num2ull_inline /**< @alias{rb_num2ull_inline} */
#define NUM2LL RB_NUM2LL /**< @old{RB_NUM2LL} */
#define NUM2ULL RB_NUM2ULL /**< @old{RB_NUM2ULL} */
RBIMPL_SYMBOL_EXPORT_BEGIN()
/**
* Converts a C's `long long` into an instance of ::rb_cInteger.
*
* @param[in] num Arbitrary `long long` value.
* @return An instance of ::rb_cInteger.
*/
VALUE rb_ll2inum(LONG_LONG num);
/**
* Converts a C's `unsigned long long` into an instance of ::rb_cInteger.
*
* @param[in] num Arbitrary `unsigned long long` value.
* @return An instance of ::rb_cInteger.
*/
VALUE rb_ull2inum(unsigned LONG_LONG num);
/**
* Converts an instance of ::rb_cNumeric into C's `long long`.
*
* @param[in] num Something numeric.
* @exception rb_eTypeError `num` is not a numeric.
* @exception rb_eRangeError `num` is out of range of `long long`.
* @return The passed value converted into C's `long long`.
*/
LONG_LONG rb_num2ll(VALUE num);
/**
* Converts an instance of ::rb_cNumeric into C's `unsigned long long`.
*
* @param[in] num Something numeric.
* @exception rb_eTypeError `num` is not a numeric.
* @exception rb_eRangeError `num` is out of range of `unsigned long long`.
* @return The passed value converted into C's `unsigned long long`.
*/
unsigned LONG_LONG rb_num2ull(VALUE num);
RBIMPL_SYMBOL_EXPORT_END()
/**
* Converts a C's `long long` into an instance of ::rb_cInteger.
*
* @param[in] n Arbitrary `long long` value.
* @return An instance of ::rb_cInteger
*/
static inline VALUE
rb_ll2num_inline(LONG_LONG n)
{
if (FIXABLE(n)) return LONG2FIX((long)n);
return rb_ll2inum(n);
}
/**
* Converts a C's `unsigned long long` into an instance of ::rb_cInteger.
*
* @param[in] n Arbitrary `unsigned long long` value.
* @return An instance of ::rb_cInteger
*/
static inline VALUE
rb_ull2num_inline(unsigned LONG_LONG n)
{
if (POSFIXABLE(n)) return LONG2FIX((long)n);
return rb_ull2inum(n);
}
/**
* Converts an instance of ::rb_cNumeric into C's `long long`.
*
* @param[in] x Something numeric.
* @exception rb_eTypeError `x` is not a numeric.
* @exception rb_eRangeError `x` is out of range of `long long`.
* @return The passed value converted into C's `long long`.
*/
static inline LONG_LONG
rb_num2ll_inline(VALUE x)
{
if (RB_FIXNUM_P(x))
return RB_FIX2LONG(x);
else
return rb_num2ll(x);
}
/**
* Converts an instance of ::rb_cNumeric into C's `unsigned long long`.
*
* @param[in] x Something numeric.
* @exception rb_eTypeError `x` is not a numeric.
* @exception rb_eRangeError `x` is out of range of `unsigned long long`.
* @return The passed value converted into C's `unsigned long long`.
*/
static inline unsigned LONG_LONG
rb_num2ull_inline(VALUE x)
{
if (RB_FIXNUM_P(x))
return RB_FIX2LONG(x);
else
return rb_num2ull(x);
}
#endif /* RBIMPL_ARITHMETIC_LONG_LONG_H */

View File

@@ -1,41 +0,0 @@
#ifndef RBIMPL_ARITHMETIC_MODE_T_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ARITHMETIC_MODE_T_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Arithmetic conversion between C's `mode_t` and Ruby's.
*/
#include "ruby/internal/config.h"
#include "ruby/internal/arithmetic/int.h"
/** Converts a C's `mode_t` into an instance of ::rb_cInteger. */
#ifndef NUM2MODET
# define NUM2MODET RB_NUM2INT
#endif
/** Converts an instance of ::rb_cNumeric into C's `mode_t`. */
#ifndef MODET2NUM
# define MODET2NUM RB_INT2NUM
#endif
/** A rb_sprintf() format prefix to be used for a `mode_t` parameter. */
#ifndef PRI_MODET_PREFIX
# define PRI_MODET_PREFIX PRI_INT_PREFIX
#endif
#endif /* RBIMPL_ARITHMETIC_MODE_T_H */

View File

@@ -1,62 +0,0 @@
#ifndef RBIMPL_ARITHMETIC_OFF_T_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ARITHMETIC_OFF_T_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Arithmetic conversion between C's `off_t` and Ruby's.
*/
#include "ruby/internal/config.h"
#include "ruby/internal/arithmetic/int.h"
#include "ruby/internal/arithmetic/long.h"
#include "ruby/internal/arithmetic/long_long.h"
#include "ruby/backward/2/long_long.h"
/** Converts a C's `off_t` into an instance of ::rb_cInteger. */
#ifdef OFFT2NUM
# /* take that. */
#elif SIZEOF_OFF_T == SIZEOF_LONG_LONG
# define OFFT2NUM RB_LL2NUM
#elif SIZEOF_OFF_T == SIZEOF_LONG
# define OFFT2NUM RB_LONG2NUM
#else
# define OFFT2NUM RB_INT2NUM
#endif
/** Converts an instance of ::rb_cNumeric into C's `off_t`. */
#ifdef NUM2OFFT
# /* take that. */
#elif SIZEOF_OFF_T == SIZEOF_LONG_LONG
# define NUM2OFFT RB_NUM2LL
#elif SIZEOF_OFF_T == SIZEOF_LONG
# define NUM2OFFT RB_NUM2LONG
#else
# define NUM2OFFT RB_NUM2INT
#endif
/** A rb_sprintf() format prefix to be used for an `off_t` parameter. */
#ifdef PRI_OFFT_PREFIX
# /* take that. */
#elif SIZEOF_OFF_T == SIZEOF_LONG_LONG
# define PRI_OFFT_PREFIX PRI_LL_PREFIX
#elif SIZEOF_OFF_T == SIZEOF_LONG
# define PRI_OFFT_PREFIX PRI_LONG_PREFIX
#else
# define PRI_OFFT_PREFIX PRI_INT_PREFIX
#endif
#endif /* RBIMPL_ARITHMETIC_OFF_T_H */

View File

@@ -1,41 +0,0 @@
#ifndef RBIMPL_ARITHMETIC_PID_T_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ARITHMETIC_PID_T_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Arithmetic conversion between C's `pid_t` and Ruby's.
*/
#include "ruby/internal/config.h"
#include "ruby/internal/arithmetic/long.h"
/** Converts a C's `pid_t` into an instance of ::rb_cInteger. */
#ifndef PIDT2NUM
# define PIDT2NUM RB_LONG2NUM
#endif
/** Converts an instance of ::rb_cNumeric into C's `pid_t`. */
#ifndef NUM2PIDT
# define NUM2PIDT RB_NUM2LONG
#endif
/** A rb_sprintf() format prefix to be used for a `pid_t` parameter. */
#ifndef PRI_PIDT_PREFIX
# define PRI_PIDT_PREFIX PRI_LONG_PREFIX
#endif
#endif /* RBIMPL_ARITHMETIC_PID_T_H */

View File

@@ -1,113 +0,0 @@
#ifndef RBIMPL_ARITHMETIC_SHORT_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ARITHMETIC_SHORT_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Arithmetic conversion between C's `short` and Ruby's.
*
* Shyouhei wonders: why there is no SHORT2NUM, given there are both
* #USHORT2NUM and #CHR2FIX?
*/
#include "ruby/internal/value.h"
#include "ruby/internal/dllexport.h"
#include "ruby/internal/special_consts.h"
#define RB_NUM2SHORT rb_num2short_inline /**< @alias{rb_num2short_inline} */
#define RB_NUM2USHORT rb_num2ushort /**< @alias{rb_num2ushort} */
#define NUM2SHORT RB_NUM2SHORT /**< @old{RB_NUM2SHORT} */
#define NUM2USHORT RB_NUM2USHORT /**< @old{RB_NUM2USHORT} */
#define USHORT2NUM RB_INT2FIX /**< @old{RB_INT2FIX} */
#define RB_FIX2SHORT rb_fix2short /**< @alias{rb_fix2ushort} */
#define FIX2SHORT RB_FIX2SHORT /**< @old{RB_FIX2SHORT} */
RBIMPL_SYMBOL_EXPORT_BEGIN()
/**
* Converts an instance of ::rb_cNumeric into C's `short`.
*
* @param[in] num Something numeric.
* @exception rb_eTypeError `num` is not a numeric.
* @exception rb_eRangeError `num` is out of range of `short`.
* @return The passed value converted into C's `short`.
*/
short rb_num2short(VALUE num);
/**
* Converts an instance of ::rb_cNumeric into C's `unsigned short`.
*
* @param[in] num Something numeric.
* @exception rb_eTypeError `num` is not a numeric.
* @exception rb_eRangeError `num` is out of range of `unsigned short`.
* @return The passed value converted into C's `unsigned short`.
*/
unsigned short rb_num2ushort(VALUE num);
/**
* Identical to rb_num2short().
*
* @param[in] num Something numeric.
* @exception rb_eTypeError `num` is not a numeric.
* @exception rb_eRangeError `num` is out of range of `short`.
* @return The passed value converted into C's `short`.
*
* @internal
*
* This function seems to be a complete waste of disk space. @shyouhei has no
* idea why this is a different thing from rb_num2short().
*/
short rb_fix2short(VALUE num);
/**
* Identical to rb_num2ushort().
*
* @param[in] num Something numeric.
* @exception rb_eTypeError `num` is not a numeric.
* @exception rb_eRangeError `num` is out of range of `unsigned short`.
* @return The passed value converted into C's `unsigned short`.
*
* @internal
*
* This function seems to be a complete waste of disk space. @shyouhei has no
* idea why this is a different thing from rb_num2ushort().
*/
unsigned short rb_fix2ushort(VALUE num);
RBIMPL_SYMBOL_EXPORT_END()
/**
* Identical to rb_num2short().
*
* @param[in] x Something numeric.
* @exception rb_eTypeError `x` is not a numeric.
* @exception rb_eRangeError `x` is out of range of `short`.
* @return The passed value converted into C's `short`.
*
* @internal
*
* This function seems to be a complete waste of time. @shyouhei has no idea
* why this is a different thing from rb_num2short().
*/
static inline short
rb_num2short_inline(VALUE x)
{
if (RB_FIXNUM_P(x))
return rb_fix2short(x);
else
return rb_num2short(x);
}
#endif /* RBIMPL_ARITHMETIC_SHORT_H */

View File

@@ -1,66 +0,0 @@
#ifndef RBIMPL_ARITHMETIC_SIZE_T_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ARITHMETIC_SIZE_T_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Arithmetic conversion between C's `size_t` and Ruby's.
*/
#include "ruby/internal/config.h"
#include "ruby/internal/arithmetic/int.h"
#include "ruby/internal/arithmetic/long.h"
#include "ruby/internal/arithmetic/long_long.h"
#include "ruby/backward/2/long_long.h"
#if defined(__DOXYGEN__)
# /** Converts a C's `size_t` into an instance of ::rb_cInteger. */
# define RB_SIZE2NUM RB_ULONG2NUM
# /** Converts a C's `ssize_t` into an instance of ::rb_cInteger. */
# define RB_SSIZE2NUM RB_LONG2NUM
#elif SIZEOF_SIZE_T == SIZEOF_LONG_LONG
# define RB_SIZE2NUM RB_ULL2NUM
# define RB_SSIZE2NUM RB_LL2NUM
#elif SIZEOF_SIZE_T == SIZEOF_LONG
# define RB_SIZE2NUM RB_ULONG2NUM
# define RB_SSIZE2NUM RB_LONG2NUM
#else
# define RB_SIZE2NUM RB_UINT2NUM
# define RB_SSIZE2NUM RB_INT2NUM
#endif
#if defined(__DOXYGEN__)
# /** Converts an instance of ::rb_cInteger into C's `size_t`. */
# define RB_NUM2SIZE RB_NUM2ULONG
# /** Converts an instance of ::rb_cInteger into C's `ssize_t`. */
# define RB_NUM2SSIZE RB_NUM2LONG
#elif SIZEOF_SIZE_T == SIZEOF_LONG_LONG
# define RB_NUM2SIZE RB_NUM2ULL
# define RB_NUM2SSIZE RB_NUM2LL
#elif SIZEOF_SIZE_T == SIZEOF_LONG
# define RB_NUM2SIZE RB_NUM2ULONG
# define RB_NUM2SSIZE RB_NUM2LONG
#else
# define RB_NUM2SIZE RB_NUM2UINT
# define RB_NUM2SSIZE RB_NUM2INT
#endif
#define NUM2SIZET RB_NUM2SIZE /**< @old{RB_NUM2SIZE} */
#define SIZET2NUM RB_SIZE2NUM /**< @old{RB_SIZE2NUM} */
#define NUM2SSIZET RB_NUM2SSIZE /**< @old{RB_NUM2SSIZE} */
#define SSIZET2NUM RB_SSIZE2NUM /**< @old{RB_SSIZE2NUM} */
#endif /* RBIMPL_ARITHMETIC_SIZE_T_H */

View File

@@ -1,75 +0,0 @@
#ifndef RBIMPL_ARITHMERIC_ST_DATA_T_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ARITHMERIC_ST_DATA_T_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Arithmetic conversion between C's `st_data_t` and Ruby's.
*/
#include "ruby/internal/arithmetic/fixnum.h"
#include "ruby/internal/arithmetic/long.h"
#include "ruby/internal/attr/artificial.h"
#include "ruby/internal/attr/const.h"
#include "ruby/internal/attr/constexpr.h"
#include "ruby/internal/cast.h"
#include "ruby/internal/value.h"
#include "ruby/assert.h"
#include "ruby/st.h"
#define ST2FIX RB_ST2FIX /**< @old{RB_ST2FIX} */
/** @cond INTERNAL_MACRO */
#define RB_ST2FIX RB_ST2FIX
/** @endcond */
RBIMPL_ATTR_CONST_UNLESS_DEBUG()
RBIMPL_ATTR_CONSTEXPR_UNLESS_DEBUG(CXX14)
RBIMPL_ATTR_ARTIFICIAL()
/**
* Converts a C's `st_data_t` into an instance of ::rb_cInteger.
*
* @param[in] i The data in question.
* @return A converted result
* @warning THIS CONVERSION LOSES DATA! Be warned.
* @see https://bugs.ruby-lang.org/issues/13877
* @see https://bugs.ruby-lang.org/issues/14218
*
* @internal
*
* This is needed because of hash functions. Hash functions return
* `st_data_t`, which could theoretically be bigger than Fixnums. However
* allocating Bignums for them every time we calculate hash values is just too
* heavy. To avoid penalty we need to ignore some upper bit(s) and stick to
* Fixnums. This function is used for that purpose.
*/
static inline VALUE
RB_ST2FIX(st_data_t i)
{
SIGNED_VALUE x = i;
if (x >= 0) {
x &= RUBY_FIXNUM_MAX;
}
else {
x |= RUBY_FIXNUM_MIN;
}
RBIMPL_ASSERT_OR_ASSUME(RB_FIXABLE(x));
unsigned long y = RBIMPL_CAST((unsigned long)x);
return RB_LONG2FIX(y);
}
#endif /* RBIMPL_ARITHMETIC_ST_DATA_T_H */

View File

@@ -1,41 +0,0 @@
#ifndef RBIMPL_ARITHMETIC_UID_T_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ARITHMETIC_UID_T_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Arithmetic conversion between C's `uid_t` and Ruby's.
*/
#include "ruby/internal/config.h"
#include "ruby/internal/arithmetic/long.h"
/** Converts a C's `uid_t` into an instance of ::rb_cInteger. */
#ifndef UIDT2NUM
# define UIDT2NUM RB_LONG2NUM
#endif
/** Converts an instance of ::rb_cNumeric into C's `uid_t`. */
#ifndef NUM2UIDT
# define NUM2UIDT RB_NUM2LONG
#endif
/** A rb_sprintf() format prefix to be used for a `uid_t` parameter. */
#ifndef PRI_UIDT_PREFIX
# define PRI_UIDT_PREFIX PRI_LONG_PREFIX
#endif
#endif /* RBIMPL_ARITHMETIC_UID_T_H */

View File

@@ -1,87 +0,0 @@
#ifndef RBIMPL_ASSUME_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ASSUME_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Defines #RBIMPL_ASSUME / #RBIMPL_UNREACHABLE.
*
* These macros must be defined at once because:
*
* - #RBIMPL_ASSUME could fallback to #RBIMPL_UNREACHABLE.
* - #RBIMPL_UNREACHABLE could fallback to #RBIMPL_ASSUME.
*/
#include "ruby/internal/config.h"
#include "ruby/internal/cast.h"
#include "ruby/internal/compiler_since.h"
#include "ruby/internal/has/builtin.h"
#include "ruby/internal/warning_push.h"
/** @cond INTERNAL_MACRO */
#if defined(HAVE___ASSUME)
# define RBIMPL_HAVE___ASSUME
#endif
/** @endcond */
/** Wraps (or simulates) `__builtin_unreachable`. */
#if RBIMPL_HAS_BUILTIN(__builtin_unreachable)
# define RBIMPL_UNREACHABLE_RETURN(_) __builtin_unreachable()
#elif defined(RBIMPL_HAVE___ASSUME)
# define RBIMPL_UNREACHABLE_RETURN(_) return (__assume(0), (_))
#else
# define RBIMPL_UNREACHABLE_RETURN(_) return (_)
#endif
/** Wraps (or simulates) `__builtin_unreachable`. */
#if RBIMPL_HAS_BUILTIN(__builtin_unreachable)
# define RBIMPL_UNREACHABLE __builtin_unreachable
#elif defined(RBIMPL_HAVE___ASSUME)
# define RBIMPL_UNREACHABLE() __assume(0)
#endif
/** Wraps (or simulates) `__assume`. */
#if RBIMPL_COMPILER_SINCE(Intel, 13, 0, 0)
# /* icc warnings are false positives. Ignore them. */
# /* "warning #2261: __assume expression with side effects discarded" */
# define RBIMPL_ASSUME(expr) \
RBIMPL_WARNING_PUSH() \
RBIMPL_WARNING_IGNORED(2261) \
__assume(expr) \
RBIMPL_WARNING_POP()
#elif defined(RBIMPL_HAVE___ASSUME)
# define RBIMPL_ASSUME __assume
#elif RBIMPL_HAS_BUILTIN(__builtin_assume)
# define RBIMPL_ASSUME __builtin_assume
#elif ! defined(RBIMPL_UNREACHABLE)
# define RBIMPL_ASSUME(_) RBIMPL_CAST((void)(_))
#else
# define RBIMPL_ASSUME(_) \
(RB_LIKELY(!!(_)) ? RBIMPL_CAST((void)0) : RBIMPL_UNREACHABLE())
#endif
#if ! defined(RBIMPL_UNREACHABLE)
# define RBIMPL_UNREACHABLE() RBIMPL_ASSUME(0)
#endif
#endif /* RBIMPL_ASSUME_H */

View File

@@ -1,32 +0,0 @@
#ifndef RBIMPL_ATTR_ALLOC_SIZE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ATTR_ALLOC_SIZE_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Defines #RBIMPL_ATTR_ALLOC_SIZE.
*/
#include "ruby/internal/has/attribute.h"
/** Wraps (or simulates) `__attribute__((alloc_size))` */
#if RBIMPL_HAS_ATTRIBUTE(alloc_size)
# define RBIMPL_ATTR_ALLOC_SIZE(tuple) __attribute__((__alloc_size__ tuple))
#else
# define RBIMPL_ATTR_ALLOC_SIZE(tuple) /* void */
#endif
#endif /* RBIMPL_ATTR_ALLOC_SIZE_H */

View File

@@ -1,46 +0,0 @@
#ifndef RBIMPL_ATTR_ARTIFICIAL_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ATTR_ARTIFICIAL_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Defines #RBIMPL_ATTR_ARTIFICIAL.
*
* ### Q&A ###
*
* - Q: What is this attribute? I don't get what GCC manual is talking about.
*
* - A: In short it is an attribute to manipulate GDB backtraces. The
* attribute makes the best sense when it comes with
* __attribute__((always_inline)). When a function annotated with this
* attribute gets inlined, and when you somehow look at a backtrace which
* includes such inlined call site, then the backtrace shows the caller
* and not the callee. This is handy for instance when an identical
* function is inlined more than once in a single big function. On such
* case it gets vital to know where the inlining happened in the callee.
* See also https://stackoverflow.com/a/21936099
*/
#include "ruby/internal/has/attribute.h"
/** Wraps (or simulates) `__attribute__((artificial))` */
#if RBIMPL_HAS_ATTRIBUTE(artificial)
# define RBIMPL_ATTR_ARTIFICIAL() __attribute__((__artificial__))
#else
# define RBIMPL_ATTR_ARTIFICIAL() /* void */
#endif
#endif /* RBIMPL_ATTR_ARTIFICIAL_H */

View File

@@ -1,37 +0,0 @@
#ifndef RBIMPL_ATTR_COLD_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ATTR_COLD_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Defines #RBIMPL_ATTR_COLD.
*/
#include "ruby/internal/compiler_is.h"
#include "ruby/internal/has/attribute.h"
/** Wraps (or simulates) `__attribute__((cold))` */
#if RBIMPL_COMPILER_IS(SunPro)
# /* Recent SunPro has __has_attribute, and is broken. */
# /* It reports it has attribute cold, reality isn't (warnings issued). */
# define RBIMPL_ATTR_COLD() /* void */
#elif RBIMPL_HAS_ATTRIBUTE(cold)
# define RBIMPL_ATTR_COLD() __attribute__((__cold__))
#else
# define RBIMPL_ATTR_COLD() /* void */
#endif
#endif /* RBIMPL_ATTR_COLD_H */

View File

@@ -1,46 +0,0 @@
#ifndef RBIMPL_ATTR_CONST_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ATTR_CONST_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Defines #RBIMPL_ATTR_CONST.
*/
#include "ruby/internal/compiler_since.h"
#include "ruby/internal/has/attribute.h"
#include "ruby/internal/has/declspec_attribute.h"
/** Wraps (or simulates) `__attribute__((const))` */
#if RBIMPL_HAS_ATTRIBUTE(const)
# define RBIMPL_ATTR_CONST() __attribute__((__const__))
#elif RBIMPL_HAS_DECLSPEC_ATTRIBUTE(noalias)
# /* If a function can be a const, that is also a noalias. */
# define RBIMPL_ATTR_CONST() __declspec(noalias)
#elif RBIMPL_COMPILER_SINCE(SunPro, 5, 10, 0)
# define RBIMPL_ATTR_CONST() _Pragma("no_side_effect")
#else
# define RBIMPL_ATTR_CONST() /* void */
#endif
/** Enables #RBIMPL_ATTR_CONST if and only if. ! #RUBY_DEBUG. */
#if !defined(RUBY_DEBUG) || !RUBY_DEBUG
# define RBIMPL_ATTR_CONST_UNLESS_DEBUG() RBIMPL_ATTR_CONST()
#else
# define RBIMPL_ATTR_CONST_UNLESS_DEBUG() /* void */
#endif
#endif /* RBIMPL_ATTR_CONST_H */

View File

@@ -1,84 +0,0 @@
#ifndef RBIMPL_ATTR_CONSTEXPR_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ATTR_CONSTEXPR_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief #RBIMPL_ATTR_CONSTEXPR.
*/
#include "ruby/internal/has/feature.h"
#include "ruby/internal/compiler_is.h"
/** @cond INTERNAL_MACRO */
#if ! defined(__cplusplus)
# /* Makes no sense. */
# define RBIMPL_HAS_ATTR_CONSTEXPR_CXX11 0
# define RBIMPL_HAS_ATTR_CONSTEXPR_CXX14 0
#elif defined(__cpp_constexpr)
# /* https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations */
# define RBIMPL_HAS_ATTR_CONSTEXPR_CXX11 (__cpp_constexpr >= 200704L)
# define RBIMPL_HAS_ATTR_CONSTEXPR_CXX14 (__cpp_constexpr >= 201304L)
#elif RBIMPL_COMPILER_SINCE(MSVC, 19, 0, 0)
# define RBIMPL_HAS_ATTR_CONSTEXPR_CXX11 RBIMPL_COMPILER_SINCE(MSVC, 19, 00, 00)
# define RBIMPL_HAS_ATTR_CONSTEXPR_CXX14 RBIMPL_COMPILER_SINCE(MSVC, 19, 11, 00)
#elif RBIMPL_COMPILER_SINCE(SunPro, 5, 13, 0)
# define RBIMPL_HAS_ATTR_CONSTEXPR_CXX11 (__cplusplus >= 201103L)
# define RBIMPL_HAS_ATTR_CONSTEXPR_CXX14 (__cplusplus >= 201402L)
#elif RBIMPL_COMPILER_SINCE(GCC, 4, 9, 0)
# define RBIMPL_HAS_ATTR_CONSTEXPR_CXX11 (__cplusplus >= 201103L)
# define RBIMPL_HAS_ATTR_CONSTEXPR_CXX14 (__cplusplus >= 201402L)
#elif RBIMPL_HAS_FEATURE(cxx_relaxed_constexpr)
# define RBIMPL_HAS_ATTR_CONSTEXPR_CXX11 1
# define RBIMPL_HAS_ATTR_CONSTEXPR_CXX14 1
#elif RBIMPL_HAS_FEATURE(cxx_constexpr)
# define RBIMPL_HAS_ATTR_CONSTEXPR_CXX11 1
# define RBIMPL_HAS_ATTR_CONSTEXPR_CXX14 0
#else
# /* :FIXME: icpc must have constexpr but don't know how to detect. */
# define RBIMPL_HAS_ATTR_CONSTEXPR_CXX11 0
# define RBIMPL_HAS_ATTR_CONSTEXPR_CXX14 0
#endif
/** @endcond */
/** Wraps (or simulates) C++11 `constexpr`. */
#if RBIMPL_HAS_ATTR_CONSTEXPR_CXX14
# define RBIMPL_ATTR_CONSTEXPR(_) constexpr
#elif RBIMPL_HAS_ATTR_CONSTEXPR_CXX11
# define RBIMPL_ATTR_CONSTEXPR(_) RBIMPL_ATTR_CONSTEXPR_ ## _
# define RBIMPL_ATTR_CONSTEXPR_CXX11 constexpr
# define RBIMPL_ATTR_CONSTEXPR_CXX14 /* void */
#else
# define RBIMPL_ATTR_CONSTEXPR(_) /* void */
#endif
/** Enables #RBIMPL_ATTR_CONSTEXPR if and only if. ! #RUBY_DEBUG. */
#if !RUBY_DEBUG
# define RBIMPL_ATTR_CONSTEXPR_UNLESS_DEBUG(_) RBIMPL_ATTR_CONSTEXPR(_)
#else
# define RBIMPL_ATTR_CONSTEXPR_UNLESS_DEBUG(_) /* void */
#endif
#endif /* RBIMPL_ATTR_CONSTEXPR_H */

View File

@@ -1,75 +0,0 @@
#ifndef RBIMPL_ATTR_DEPRECATED_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ATTR_DEPRECATED_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Defines #RBIMPL_ATTR_DEPRECATED.
*/
#include "ruby/internal/compiler_since.h"
#include "ruby/internal/has/attribute.h"
#include "ruby/internal/has/c_attribute.h"
#include "ruby/internal/has/cpp_attribute.h"
#include "ruby/internal/has/declspec_attribute.h"
#include "ruby/internal/has/extension.h"
/** Wraps (or simulates) `[[deprecated]]` */
#if defined(__COVERITY__)
/* Coverity Scan emulates gcc but seems not to support this attribute correctly */
# define RBIMPL_ATTR_DEPRECATED(msg)
#elif RBIMPL_HAS_EXTENSION(attribute_deprecated_with_message)
# define RBIMPL_ATTR_DEPRECATED(msg) __attribute__((__deprecated__ msg))
#elif defined(__cplusplus) && RBIMPL_COMPILER_SINCE(GCC, 10, 1, 0) && RBIMPL_COMPILER_BEFORE(GCC, 10, 3, 0)
# /* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95302 */
# define RBIMPL_ATTR_DEPRECATED(msg) /* disable until they fix this bug */
#elif RBIMPL_COMPILER_SINCE(GCC, 4, 5, 0)
# define RBIMPL_ATTR_DEPRECATED(msg) __attribute__((__deprecated__ msg))
#elif RBIMPL_COMPILER_SINCE(Intel, 13, 0, 0)
# define RBIMPL_ATTR_DEPRECATED(msg) __attribute__((__deprecated__ msg))
#elif RBIMPL_HAS_ATTRIBUTE(deprecated) /* but not with message. */
# define RBIMPL_ATTR_DEPRECATED(msg) __attribute__((__deprecated__))
#elif RBIMPL_COMPILER_SINCE(MSVC, 14, 0, 0)
# define RBIMPL_ATTR_DEPRECATED(msg) __declspec(deprecated msg)
#elif RBIMPL_HAS_DECLSPEC_ATTRIBUTE(deprecated)
# define RBIMPL_ATTR_DEPRECATED(msg) __declspec(deprecated)
#elif RBIMPL_HAS_CPP_ATTRIBUTE(deprecated)
# define RBIMPL_ATTR_DEPRECATED(msg) [[deprecated msg]]
#elif RBIMPL_HAS_C_ATTRIBUTE(deprecated)
# define RBIMPL_ATTR_DEPRECATED(msg) [[deprecated msg]]
#else
# define RBIMPL_ATTR_DEPRECATED(msg) /* void */
#endif
/** This is when a function is used internally (for backwards compatibility
* etc.), but extension libraries must consider it deprecated. */
#if defined(RUBY_EXPORT)
# define RBIMPL_ATTR_DEPRECATED_EXT(msg) /* void */
#else
# define RBIMPL_ATTR_DEPRECATED_EXT(msg) RBIMPL_ATTR_DEPRECATED(msg)
#endif
#endif /* RBIMPL_ATTR_DEPRECATED_H */

View File

@@ -1,42 +0,0 @@
#ifndef RBIMPL_ATTR_DIAGNOSE_IF_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ATTR_DIAGNOSE_IF_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Defines #RBIMPL_ATTR_DIAGNOSE_IF.
*/
#include "ruby/internal/has/attribute.h"
#include "ruby/internal/warning_push.h"
/** Wraps (or simulates) `__attribute__((diagnose_if))` */
#if RBIMPL_COMPILER_BEFORE(Clang, 5, 0, 0)
# /* https://bugs.llvm.org/show_bug.cgi?id=34319 */
# define RBIMPL_ATTR_DIAGNOSE_IF(_, __, ___) /* void */
#elif RBIMPL_HAS_ATTRIBUTE(diagnose_if)
# define RBIMPL_ATTR_DIAGNOSE_IF(_, __, ___) \
RBIMPL_WARNING_PUSH() \
RBIMPL_WARNING_IGNORED(-Wgcc-compat) \
__attribute__((__diagnose_if__(_, __, ___))) \
RBIMPL_WARNING_POP()
#else
# define RBIMPL_ATTR_DIAGNOSE_IF(_, __, ___) /* void */
#endif
#endif /* RBIMPL_ATTR_DIAGNOSE_IF_H */

View File

@@ -1,32 +0,0 @@
#ifndef RBIMPL_ATTR_ENUM_EXTENSIBILITY_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ATTR_ENUM_EXTENSIBILITY_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief #RBIMPL_ATTR_ENUM_EXTENSIBILITY.
*/
#include "ruby/internal/has/attribute.h"
/** Wraps (or simulates) `__attribute__((enum_extensibility))` */
#if RBIMPL_HAS_ATTRIBUTE(enum_extensibility)
# define RBIMPL_ATTR_ENUM_EXTENSIBILITY(_) __attribute__((__enum_extensibility__(_)))
#else
# define RBIMPL_ATTR_ENUM_EXTENSIBILITY(_) /* void */
#endif
#endif /* RBIMPL_ATTR_ENUM_EXTENSIBILITY_H */

View File

@@ -1,32 +0,0 @@
#ifndef RBIMPL_ATTR_ERROR_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ATTR_ERROR_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Defines #RBIMPL_ATTR_ERROR.
*/
#include "ruby/internal/has/attribute.h"
/** Wraps (or simulates) `__attribute__((error))` */
#if RBIMPL_HAS_ATTRIBUTE(error)
# define RBIMPL_ATTR_ERROR(msg) __attribute__((__error__ msg))
#else
# define RBIMPL_ATTR_ERROR(msg) /* void */
#endif
#endif /* RBIMPL_ATTR_ERROR_H */

View File

@@ -1,33 +0,0 @@
#ifndef RBIMPL_ATTR_FLAG_ENUM_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ATTR_FLAG_ENUM_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Defines #RBIMPL_ATTR_FLAG_ENUM.
* @see https://clang.llvm.org/docs/AttributeReference.html#flag_enum
*/
#include "ruby/internal/has/attribute.h"
/** Wraps (or simulates) `__attribute__((flag_enum)` */
#if RBIMPL_HAS_ATTRIBUTE(flag_enum)
# define RBIMPL_ATTR_FLAG_ENUM() __attribute__((__flag_enum__))
#else
# define RBIMPL_ATTR_FLAG_ENUM() /* void */
#endif
#endif /* RBIMPLATTR_FLAG_ENUM_H */

View File

@@ -1,40 +0,0 @@
#ifndef RBIMPL_ATTR_FORCEINLINE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ATTR_FORCEINLINE_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Defines #RBIMPL_ATTR_FORCEINLINE.
*/
#include "ruby/internal/compiler_since.h"
#include "ruby/internal/has/attribute.h"
/**
* Wraps (or simulates) `__forceinline`. MSVC complains on declarations like
* `static inline __forceinline void foo()`. It seems MSVC's `inline` and
* `__forceinline` are mutually exclusive. We have to mimic that behaviour for
* non-MSVC compilers.
*/
#if RBIMPL_COMPILER_SINCE(MSVC, 12, 0, 0)
# define RBIMPL_ATTR_FORCEINLINE() __forceinline
#elif RBIMPL_HAS_ATTRIBUTE(always_inline)
# define RBIMPL_ATTR_FORCEINLINE() __attribute__((__always_inline__)) inline
#else
# define RBIMPL_ATTR_FORCEINLINE() inline
#endif
#endif /* RBIMPL_ATTR_FORCEINLINE_H */

View File

@@ -1,38 +0,0 @@
#ifndef RBIMPL_ATTR_FORMAT_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ATTR_FORMAT_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Defines #RBIMPL_ATTR_FORMAT.
*/
#include "ruby/internal/has/attribute.h"
/** Wraps (or simulates) `__attribute__((format))` */
#if RBIMPL_HAS_ATTRIBUTE(format)
# define RBIMPL_ATTR_FORMAT(x, y, z) __attribute__((__format__(x, y, z)))
#else
# define RBIMPL_ATTR_FORMAT(x, y, z) /* void */
#endif
#if defined(__MINGW_PRINTF_FORMAT)
# define RBIMPL_PRINTF_FORMAT __MINGW_PRINTF_FORMAT
#else
# define RBIMPL_PRINTF_FORMAT __printf__
#endif
#endif /* RBIMPL_ATTR_FORMAT_H */

View File

@@ -1,38 +0,0 @@
#ifndef RBIMPL_ATTR_MAYBE_UNUSED_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ATTR_MAYBE_UNUSED_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Defines #RBIMPL_ATTR_MAYBE_UNUSED.
*/
#include "ruby/internal/has/attribute.h"
#include "ruby/internal/has/c_attribute.h"
#include "ruby/internal/has/cpp_attribute.h"
/** Wraps (or simulates) `[[maybe_unused]]` */
#if RBIMPL_HAS_CPP_ATTRIBUTE(maybe_unused)
# define RBIMPL_ATTR_MAYBE_UNUSED() [[maybe_unused]]
#elif RBIMPL_HAS_C_ATTRIBUTE(maybe_unused)
# define RBIMPL_ATTR_MAYBE_UNUSED() [[maybe_unused]]
#elif RBIMPL_HAS_ATTRIBUTE(unused)
# define RBIMPL_ATTR_MAYBE_UNUSED() __attribute__((__unused__))
#else
# define RBIMPL_ATTR_MAYBE_UNUSED() /* void */
#endif
#endif /* RBIMPL_ATTR_MAYBE_UNUSED */

View File

@@ -1,69 +0,0 @@
#ifndef RBIMPL_ATTR_NOALIAS_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ATTR_NOALIAS_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Defines #RBIMPL_ATTR_NOALIAS.
*
* ### Q&A ###
*
* - Q: There are seemingly similar attributes named #RBIMPL_ATTR_CONST,
* #RBIMPL_ATTR_PURE, and #RBIMPL_ATTR_NOALIAS. What are the difference?
*
* - A: Allowed operations are different.
*
* - #RBIMPL_ATTR_CONST ... Functions attributed by this are not allowed to
* read/write _any_ pointers at all (there are exceptional situations
* when reading a pointer is possible but forget that; they are too
* exceptional to be useful). Just remember that everything pointer-
* related are NG.
*
* - #RBIMPL_ATTR_PURE ... Functions attributed by this can read any
* nonvolatile pointers, but no writes are allowed at all. The ability
* to read _any_ nonvolatile pointers makes it possible to mark ::VALUE-
* taking functions as being pure, as long as they are read-only.
*
* - #RBIMPL_ATTR_NOALIAS ... Can both read/write, but only through
* pointers passed to the function as parameters. This is a typical
* situation when you create a C++ non-static member function which only
* concerns `this`. No global variables are allowed to read/write. So
* this is not a super-set of being pure. If you want to read something,
* that has to be passed to the function as a pointer. ::VALUE -taking
* functions thus cannot be attributed as such.
*/
#include "ruby/internal/compiler_since.h"
#include "ruby/internal/has/declspec_attribute.h"
/** Wraps (or simulates) `__declspec((noalias))` */
#if RBIMPL_COMPILER_BEFORE(Clang, 12, 0, 0)
# /*
# * `::llvm::Attribute::ArgMemOnly` was buggy before. Maybe because nobody
# * actually seriously used it. It seems they somehow mitigated the situation
# * in LLVM 12. Still not found the exact changeset which fiexed the
# * attribute, though.
# *
# * :FIXME: others (armclang, xlclang, ...) can also be affected?
# */
# define RBIMPL_ATTR_NOALIAS() /* void */
#elif RBIMPL_HAS_DECLSPEC_ATTRIBUTE(noalias)
# define RBIMPL_ATTR_NOALIAS() __declspec(noalias)
#else
# define RBIMPL_ATTR_NOALIAS() /* void */
#endif
#endif /* RBIMPL_ATTR_NOALIAS_H */

View File

@@ -1,45 +0,0 @@
#ifndef RBIMPL_ATTR_NODISCARD_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ATTR_NODISCARD_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Defines #RBIMPL_ATTR_NODISCARD.
*/
#include "ruby/internal/has/attribute.h"
#include "ruby/internal/has/c_attribute.h"
#include "ruby/internal/has/cpp_attribute.h"
/**
* Wraps (or simulates) `[[nodiscard]]`. In C++ (at least since C++20) a
* nodiscard attribute can have a message why the result shall not be ignored.
* However GCC attribute and SAL annotation cannot take them.
*/
#if RBIMPL_HAS_CPP_ATTRIBUTE(nodiscard)
# define RBIMPL_ATTR_NODISCARD() [[nodiscard]]
#elif RBIMPL_HAS_C_ATTRIBUTE(nodiscard)
# define RBIMPL_ATTR_NODISCARD() [[nodiscard]]
#elif RBIMPL_HAS_ATTRIBUTE(warn_unused_result)
# define RBIMPL_ATTR_NODISCARD() __attribute__((__warn_unused_result__))
#elif defined(_Check_return_)
# /* Take SAL definition. */
# define RBIMPL_ATTR_NODISCARD() _Check_return_
#else
# define RBIMPL_ATTR_NODISCARD() /* void */
#endif
#endif /* RBIMPL_ATTR_NODISCARD_H */

View File

@@ -1,91 +0,0 @@
#ifndef RBIMPL_ATTR_NOEXCEPT_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ATTR_NOEXCEPT_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Defines #RBIMPL_ATTR_NOEXCEPT.
*
* This isn't actually an attribute in C++ but who cares...
*
* Mainly due to aesthetic reasons, this one is rarely used in the project.
* But can be handy on occasions, especially when a function's noexcept-ness
* depends on its calling functions.
*
* ### Q&A ###
*
* - Q: Can a function that raises Ruby exceptions be attributed `noexcept`?
*
* - A: Yes. `noexcept` is about C++ exceptions, not Ruby's. They don't
* interface each other. You can safely attribute a function that raises
* Ruby exceptions as `noexcept`.
*
* - Q: How, then, can I assert that a function I wrote doesn't raise any Ruby
* exceptions?
*
* - A: `__attribute__((__leaf__))` is for that purpose. A function attributed
* as leaf can still throw C++ exceptions, but not Ruby's. Note however,
* that it's extremely difficult -- if not impossible -- to assert that a
* function doesn't raise any Ruby exceptions at all. Use of that
* attribute is not recommended; mere mortals can't properly use that by
* hand.
*
* - Q: Does it make sense to attribute an inline function `noexcept`?
*
* - A: I thought so before. But no, I don't think they are useful any longer.
*
* - When an inline function attributed `noexcept` actually doesn't throw
* any exceptions at all: these days I don't see any difference in
* generated assembly by adding/removing this attribute. C++ compilers
* get smarter and smarter. Today they can infer if it actually throws
* or not without any annotations by humans (correct me if I'm wrong).
*
* - When an inline function attributed `noexcepr` actually _does_ throw an
* exception: they have to call `std::terminate` then (C++ standard
* mandates so). This means exception handling routines are actually
* enforced, not omitted. This doesn't impact runtime performance (The
* Itanium C++ ABI has zero-cost exception handling), but does impact on
* generated binary size. This is bad.
*/
#include "ruby/internal/compiler_since.h"
#include "ruby/internal/has/feature.h"
/** Wraps (or simulates) C++11 `noexcept` */
#if ! defined(__cplusplus)
# /* Doesn't make sense. */
# define RBIMPL_ATTR_NOEXCEPT(_) /* void */
#elif RBIMPL_HAS_FEATURE(cxx_noexcept)
# define RBIMPL_ATTR_NOEXCEPT(_) noexcept(noexcept(_))
#elif defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__
# define RBIMPL_ATTR_NOEXCEPT(_) noexcept(noexcept(_))
#elif defined(__INTEL_CXX11_MODE__)
# define RBIMPL_ATTR_NOEXCEPT(_) noexcept(noexcept(_))
#elif RBIMPL_COMPILER_SINCE(MSVC, 19, 0, 0)
# define RBIMPL_ATTR_NOEXCEPT(_) noexcept(noexcept(_))
#elif __cplusplus >= 201103L
# define RBIMPL_ATTR_NOEXCEPT(_) noexcept(noexcept(_))
#else
# define RBIMPL_ATTR_NOEXCEPT(_) /* void */
#endif
#endif /* RBIMPL_ATTR_NOEXCEPT_H */

View File

@@ -1,35 +0,0 @@
#ifndef RBIMPL_ATTR_NOINLINE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ATTR_NOINLINE_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Defines #RBIMPL_ATTR_NOINLINE.
*/
#include "ruby/internal/has/attribute.h"
#include "ruby/internal/has/declspec_attribute.h"
/** Wraps (or simulates) `__declspec(noinline)` */
#if RBIMPL_HAS_DECLSPEC_ATTRIBUTE(noinline)
# define RBIMPL_ATTR_NOINLINE() __declspec(noinline)
#elif RBIMPL_HAS_ATTRIBUTE(noinline)
# define RBIMPL_ATTR_NOINLINE() __attribute__((__noinline__))
#else
# define RBIMPL_ATTR_NOINLINE() /* void */
#endif
#endif /* RBIMPL_ATTR_NOINLINE_H */

View File

@@ -1,34 +0,0 @@
#ifndef RBIMPL_ATTR_NONNULL_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ATTR_NONNULL_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Defines #RBIMPL_ATTR_NONNULL.
*/
#include "ruby/internal/has/attribute.h"
/** Wraps (or simulates) `__attribute__((nonnull))` */
#if RBIMPL_HAS_ATTRIBUTE(nonnull)
# define RBIMPL_ATTR_NONNULL(list) __attribute__((__nonnull__ list))
# define RBIMPL_NONNULL_ARG(arg) RBIMPL_ASSERT_NOTHING
#else
# define RBIMPL_ATTR_NONNULL(list) /* void */
# define RBIMPL_NONNULL_ARG(arg) RUBY_ASSERT(arg)
#endif
#endif /* RBIMPL_ATTR_NONNULL_H */

View File

@@ -1,48 +0,0 @@
#ifndef RBIMPL_ATTR_NORETURN_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ATTR_NORETURN_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Defines #RBIMPL_ATTR_NORETURN.
*/
#include "ruby/internal/has/attribute.h"
#include "ruby/internal/has/cpp_attribute.h"
#include "ruby/internal/has/declspec_attribute.h"
/** Wraps (or simulates) `[[noreturn]]` */
#if RBIMPL_HAS_DECLSPEC_ATTRIBUTE(noreturn)
# define RBIMPL_ATTR_NORETURN() __declspec(noreturn)
#elif RBIMPL_HAS_ATTRIBUTE(noreturn)
# define RBIMPL_ATTR_NORETURN() __attribute__((__noreturn__))
#elif RBIMPL_HAS_CPP_ATTRIBUTE(noreturn)
# define RBIMPL_ATTR_NORETURN() [[noreturn]]
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112)
# define RBIMPL_ATTR_NORETURN() _Noreturn
#elif defined(_Noreturn)
# /* glibc <sys/cdefs.h> has this macro. */
# define RBIMPL_ATTR_NORETURN() _Noreturn
#else
# define RBIMPL_ATTR_NORETURN() /* void */
#endif
#endif /* RBIMPL_ATTR_NORETURN_H */

View File

@@ -1,43 +0,0 @@
#ifndef RBIMPL_ATTR_PURE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ATTR_PURE_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Defines #RBIMPL_ATTR_PURE.
*/
#include "ruby/internal/compiler_since.h"
#include "ruby/internal/has/attribute.h"
#include "ruby/assert.h"
/** Wraps (or simulates) `__attribute__((pure))` */
#if RBIMPL_HAS_ATTRIBUTE(pure)
# define RBIMPL_ATTR_PURE() __attribute__((__pure__))
#elif RBIMPL_COMPILER_SINCE(SunPro, 5, 10, 0)
# define RBIMPL_ATTR_PURE() _Pragma("does_not_write_global_data")
#else
# define RBIMPL_ATTR_PURE() /* void */
#endif
/** Enables #RBIMPL_ATTR_PURE if and only if. ! #RUBY_DEBUG. */
#if !RUBY_DEBUG
# define RBIMPL_ATTR_PURE_UNLESS_DEBUG() RBIMPL_ATTR_PURE()
#else
# define RBIMPL_ATTR_PURE_UNLESS_DEBUG() /* void */
#endif
#endif /* RBIMPL_ATTR_PURE_H */

View File

@@ -1,44 +0,0 @@
#ifndef RBIMPL_ATTR_RESTRICT_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ATTR_RESTRICT_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Defines #RBIMPL_ATTR_RESTRICT.
*/
#include "ruby/internal/compiler_since.h"
#include "ruby/internal/has/attribute.h"
/* :FIXME: config.h includes conflicting `#define restrict`. MSVC can be
* detected using `RBIMPL_COMPILER_SINCE()`, but Clang & family cannot use
* `__has_declspec_attribute()` which involves macro substitution. */
/** Wraps (or simulates) `__declspec(restrict)` */
#if RBIMPL_COMPILER_SINCE(MSVC, 14, 0, 0)
# define RBIMPL_ATTR_RESTRICT() __declspec(re ## strict)
#elif RBIMPL_HAS_ATTRIBUTE(malloc)
# define RBIMPL_ATTR_RESTRICT() __attribute__((__malloc__))
#elif RBIMPL_COMPILER_SINCE(SunPro, 5, 10, 0)
# define RBIMPL_ATTR_RESTRICT() _Pragma("returns_new_memory")
#else
# define RBIMPL_ATTR_RESTRICT() /* void */
#endif
#endif /* RBIMPL_ATTR_RESTRICT_H */

View File

@@ -1,37 +0,0 @@
#ifndef RBIMPL_ATTR_RETURNS_NONNULL_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ATTR_RETURNS_NONNULL_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Defines #RBIMPL_ATTR_RETURNS_NONNULL.
*/
#include "ruby/internal/has/attribute.h"
/** Wraps (or simulates) `__attribute__((returns_nonnull))` */
#if defined(_Ret_nonnull_)
# /* Take SAL definition. */
# define RBIMPL_ATTR_RETURNS_NONNULL() _Ret_nonnull_
#elif RBIMPL_HAS_ATTRIBUTE(returns_nonnull)
# define RBIMPL_ATTR_RETURNS_NONNULL() __attribute__((__returns_nonnull__))
#else
# define RBIMPL_ATTR_RETURNS_NONNULL() /* void */
#endif
#endif /* RBIMPL_ATTR_RETURNS_NONNULL_H */

View File

@@ -1,32 +0,0 @@
#ifndef RBIMPL_ATTR_WARNING_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ATTR_WARNING_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Defines #RBIMPL_ATTR_WARNING.
*/
#include "ruby/internal/has/attribute.h"
/** Wraps (or simulates) `__attribute__((warning))` */
#if RBIMPL_HAS_ATTRIBUTE(warning)
# define RBIMPL_ATTR_WARNING(msg) __attribute__((__warning__ msg))
#else
# define RBIMPL_ATTR_WARNING(msg) /* void */
#endif
#endif /* RBIMPL_ATTR_WARNING_H */

View File

@@ -1,32 +0,0 @@
#ifndef RBIMPL_ATTR_WEAKREF_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ATTR_WEAKREF_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Defines #RBIMPL_ATTR_WEAKREF.
*/
#include "ruby/internal/has/attribute.h"
/** Wraps (or simulates) `__attribute__((weakref))` */
#if RBIMPL_HAS_ATTRIBUTE(weakref)
# define RBIMPL_ATTR_WEAKREF(sym) __attribute__((__weakref__(# sym)))
#else
# define RBIMPL_ATTR_WEAKREF(sym) /* void */
#endif
#endif /* RBIMPL_ATTR_WEAKREF_H */

View File

@@ -1,50 +0,0 @@
#ifndef RBIMPL_CAST_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_CAST_H
/**
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Defines RBIMPL_CAST.
*
* This casting macro makes sense only inside of other macros that are part of
* public headers. They could be used from C++, and C-style casts could issue
* warnings. Ruby internals are pure C so they should not bother.
*/
#include "ruby/internal/compiler_since.h"
#include "ruby/internal/has/warning.h"
#include "ruby/internal/warning_push.h"
#if ! defined(__cplusplus)
# define RBIMPL_CAST(expr) (expr)
#elif RBIMPL_COMPILER_SINCE(GCC, 4, 6, 0)
# /* g++ has -Wold-style-cast since 1997 or so, but its _Pragma is broken. */
# /* See https://gcc.godbolt.org/z/XWhU6J */
# define RBIMPL_CAST(expr) (expr)
# pragma GCC diagnostic ignored "-Wold-style-cast"
#elif RBIMPL_HAS_WARNING("-Wold-style-cast")
# define RBIMPL_CAST(expr) \
RBIMPL_WARNING_PUSH() \
RBIMPL_WARNING_IGNORED(-Wold-style-cast) \
(expr) \
RBIMPL_WARNING_POP()
#else
# define RBIMPL_CAST(expr) (expr)
#endif
#endif /* RBIMPL_CAST_H */

View File

@@ -1,45 +0,0 @@
#ifndef RBIMPL_COMPILER_IS_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_COMPILER_IS_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Defines #RBIMPL_COMPILER_IS.
*/
/**
* @brief Checks if the compiler is of given brand.
* @param cc Compiler brand, like `MSVC`.
* @retval true It is.
* @retval false It isn't.
*/
#define RBIMPL_COMPILER_IS(cc) RBIMPL_COMPILER_IS_ ## cc
#include "ruby/internal/compiler_is/apple.h"
#include "ruby/internal/compiler_is/clang.h"
#include "ruby/internal/compiler_is/gcc.h"
#include "ruby/internal/compiler_is/intel.h"
#include "ruby/internal/compiler_is/msvc.h"
#include "ruby/internal/compiler_is/sunpro.h"
/* :TODO: Other possible compilers to support:
*
* - IBM XL: recent XL are clang-backended so some tweaks like we do for
* Apple's might be needed.
*
* - ARM's armclang: ditto, it can be clang-backended. */
#endif /* RBIMPL_COMPILER_IS_H */

View File

@@ -1,40 +0,0 @@
#ifndef RBIMPL_COMPILER_IS_APPLE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_COMPILER_IS_APPLE_H
/**
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Defines RBIMPL_COMPILER_IS_Apple.
*
* Apple ships clang. Problem is, its `__clang_major__` etc. are not the
* upstream LLVM version, but XCode's. We have to think Apple's is distinct
* from LLVM's, when it comes to compiler detection business in this header
* file.
*/
#if ! defined(__clang__)
# define RBIMPL_COMPILER_IS_Apple 0
#elif ! defined(__apple_build_version__)
# define RBIMPL_COMPILER_IS_Apple 0
#else
# define RBIMPL_COMPILER_IS_Apple 1
# define RBIMPL_COMPILER_VERSION_MAJOR __clang_major__
# define RBIMPL_COMPILER_VERSION_MINOR __clang_minor__
# define RBIMPL_COMPILER_VERSION_PATCH __clang_patchlevel__
#endif
#endif /* RBIMPL_COMPILER_IS_APPLE_H */

View File

@@ -1,37 +0,0 @@
#ifndef RBIMPL_COMPILER_IS_CLANG_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_COMPILER_IS_CLANG_H
/**
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Defines RBIMPL_COMPILER_IS_Clang.
*/
#include "ruby/internal/compiler_is/apple.h"
#if ! defined(__clang__)
# define RBIMPL_COMPILER_IS_Clang 0
#elif RBIMPL_COMPILER_IS(Apple)
# define RBIMPL_COMPILER_IS_Clang 0
#else
# define RBIMPL_COMPILER_IS_Clang 1
# define RBIMPL_COMPILER_VERSION_MAJOR __clang_major__
# define RBIMPL_COMPILER_VERSION_MINOR __clang_minor__
# define RBIMPL_COMPILER_VERSION_PATCH __clang_patchlevel__
#endif
#endif /* RBIMPL_COMPILER_IS_CLANG_H */

View File

@@ -1,45 +0,0 @@
#ifndef RBIMPL_COMPILER_IS_GCC_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_COMPILER_IS_GCC_H
/**
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Defines RBIMPL_COMPILER_IS_GCC.
*/
#include "ruby/internal/compiler_is/apple.h"
#include "ruby/internal/compiler_is/clang.h"
#include "ruby/internal/compiler_is/intel.h"
#if ! defined(__GNUC__)
# define RBIMPL_COMPILER_IS_GCC 0
#elif RBIMPL_COMPILER_IS(Apple)
# define RBIMPL_COMPILER_IS_GCC 0
#elif RBIMPL_COMPILER_IS(Clang)
# define RBIMPL_COMPILER_IS_GCC 0
#elif RBIMPL_COMPILER_IS(Intel)
# define RBIMPL_COMPILER_IS_GCC 0
#else
# define RBIMPL_COMPILER_IS_GCC 1
# define RBIMPL_COMPILER_VERSION_MAJOR __GNUC__
# define RBIMPL_COMPILER_VERSION_MINOR __GNUC_MINOR__
# define RBIMPL_COMPILER_VERSION_PATCH __GNUC_PATCHLEVEL__
#endif
#endif /* RBIMPL_COMPILER_IS_GCC_H */

View File

@@ -1,40 +0,0 @@
#ifndef RBIMPL_COMPILER_IS_INTEL_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_COMPILER_IS_INTEL_H
/**
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
* implementation details. Don't take them as canon. They could
* rapidly appear then vanish. The name (path) of this header file
* is also an implementation detail. Do not expect it to persist
* at the place it is now. Developers are free to move it anywhere
* anytime at will.
* @note To ruby-core: remember that this header can be possibly
* recursively included from extension libraries written in C++.
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
* @brief Defines RBIMPL_COMPILER_IS_Intel.
*/
#if ! defined(__INTEL_COMPILER)
# define RBIMPL_COMPILER_IS_Intel 0
#elif ! defined(__INTEL_COMPILER_UPDATE)
# define RBIMPL_COMPILER_IS_Intel 1
# /* __INTEL_COMPILER = XXYZ */
# define RBIMPL_COMPILER_VERSION_MAJOR (__INTEL_COMPILER / 100)
# define RBIMPL_COMPILER_VERSION_MINOR (__INTEL_COMPILER % 100 / 10)
# define RBIMPL_COMPILER_VERSION_PATCH (__INTEL_COMPILER % 10)
#else
# define RBIMPL_COMPILER_IS_Intel 1
# /* __INTEL_COMPILER = XXYZ */
# define RBIMPL_COMPILER_VERSION_MAJOR (__INTEL_COMPILER / 100)
# define RBIMPL_COMPILER_VERSION_MINOR (__INTEL_COMPILER % 100 / 10)
# define RBIMPL_COMPILER_VERSION_PATCH __INTEL_COMPILER_UPDATE
#endif
#endif /* RBIMPL_COMPILER_IS_INTEL_H */

Some files were not shown because too many files have changed in this diff Show More