Ruby 3.2.1p31 (2023-02-08 revision 31819e82c88c6f8ecfaeb162519bfa26a14b21fd)
cmdlineopt.h
1#ifndef INTERNAL_CMDLINEOPT_H /*-*-C-*-vi:se ft=c:*/
2#define INTERNAL_CMDLINEOPT_H
3
4#include "mjit.h"
5#include "yjit.h"
6
7typedef struct {
8 unsigned int mask;
9 unsigned int set;
11
12typedef 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#if USE_MJIT
27 struct mjit_options mjit;
28#endif
29
30 int sflag, xflag;
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
43
45 const char *str;
46 unsigned short namelen, secondlen;
47};
48
49#define RUBY_OPT_MESSAGE(shortopt, longopt, desc) { \
50 shortopt " " longopt " " desc, \
51 (unsigned short)sizeof(shortopt), \
52 (unsigned short)sizeof(longopt), \
53}
54
55#define opt_match(s, l, name) \
56 ((((l) > rb_strlen_lit(name)) ? (s)[rb_strlen_lit(name)] == '=' : \
57 (l) == rb_strlen_lit(name)) && \
58 memcmp((s), name, rb_strlen_lit(name)) == 0 && \
59 (((s) += rb_strlen_lit(name)), 1))
60
61#endif
uintptr_t VALUE
Type that represents a Ruby object.
Definition value.h:40