Ruby: internal/cmdlineopt.h Source File

Ruby 4.0.5p0 (2026-05-20 revision 64336ffd0ee9e1f4c05891695a3d7b49cb709721)

cmdlineopt.h
1#ifndef INTERNAL_CMDLINEOPT_H /*-*-C-*-vi:se ft=c:*/
2#define INTERNAL_CMDLINEOPT_H
3
4#include "yjit.h"
5
6 typedef struct {
7 unsigned int mask;
8 unsigned int set;
9} ruby_features_t;
10
11 typedef struct ruby_cmdline_options {
12 const char *script;
13 VALUE script_name;
14 VALUE e_script;
15 struct {
16 struct {
17 VALUE name;
18 int index;
19 } enc;
20 } src, ext, intern;
21 VALUE req_list;
22 ruby_features_t features;
23 ruby_features_t warn;
24 unsigned int dump;
25 long backtrace_length_limit;
26
27 const char *crash_report;
28
29 signed int sflag: 2;
30 unsigned int xflag: 1;
31 unsigned int warning: 1;
32 unsigned int verbose: 1;
33 unsigned int do_loop: 1;
34 unsigned int do_print: 1;
35 unsigned int do_line: 1;
36 unsigned int do_split: 1;
37 unsigned int do_search: 1;
38 unsigned int setids: 2;
39#if USE_YJIT
40 unsigned int yjit: 1;
41#endif
42#if USE_ZJIT
43 unsigned int zjit: 1;
44#endif
45} ruby_cmdline_options_t;
46
47 struct ruby_opt_message {
48 const char *str;
49 unsigned short namelen, secondlen;
50};
51
52#define RUBY_OPT_MESSAGE(shortopt, longopt, desc) { \
53 shortopt " " longopt " " desc, \
54 (unsigned short)sizeof(shortopt), \
55 (unsigned short)sizeof(longopt), \
56}
57
58#define opt_match(s, l, name) \
59 ((((l) > rb_strlen_lit(name)) ? (s)[rb_strlen_lit(name)] == '=' : \
60 (l) == rb_strlen_lit(name)) && \
61 memcmp((s), name, rb_strlen_lit(name)) == 0 && \
62 (((s) += rb_strlen_lit(name)), 1))
63
64#endif
ruby_cmdline_options
Definition cmdlineopt.h:11
ruby_features_t
Definition cmdlineopt.h:6
ruby_opt_message
Definition cmdlineopt.h:47
VALUE
uintptr_t VALUE
Type that represents a Ruby object.
Definition value.h:40