Ruby  3.4.0dev (2024-11-05 revision 348a53415339076afc4a02fcd09f3ae36e9c4c61)
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;
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
47 
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
uintptr_t VALUE
Type that represents a Ruby object.
Definition: value.h:40