Ruby: internal/cmdlineopt.h Source File

Ruby 3.2.5p208 (2024-07-26 revision 31d0f1a2e7dbfb60731d1f05b868e1d578cda493)

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
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#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
42} ruby_cmdline_options_t;
43
44 struct ruby_opt_message {
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
ruby_cmdline_options
Definition cmdlineopt.h:12
ruby_features_t
Definition cmdlineopt.h:7
ruby_opt_message
Definition cmdlineopt.h:44
VALUE
uintptr_t VALUE
Type that represents a Ruby object.
Definition value.h:40