Ruby: internal/cmdlineopt.h Source File

Ruby 3.4.5p51 (2025-07-16 revision 20cda200d3ce092571d0b5d342dadca69636cb0f)

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