2022-01-10 17:38:16 +03:00
|
|
|
#ifndef INTERNAL_CMDLINEOPT_H /*-*-C-*-vi:se ft=c:*/
|
|
|
|
#define INTERNAL_CMDLINEOPT_H
|
|
|
|
|
2023-03-07 10:17:25 +03:00
|
|
|
#include "rjit.h"
|
2022-01-10 17:38:16 +03:00
|
|
|
#include "yjit.h"
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
unsigned int mask;
|
|
|
|
unsigned int set;
|
|
|
|
} ruby_features_t;
|
|
|
|
|
|
|
|
typedef struct ruby_cmdline_options {
|
|
|
|
const char *script;
|
|
|
|
VALUE script_name;
|
|
|
|
VALUE e_script;
|
|
|
|
struct {
|
2022-01-15 14:10:30 +03:00
|
|
|
struct {
|
|
|
|
VALUE name;
|
|
|
|
int index;
|
|
|
|
} enc;
|
2022-01-10 17:38:16 +03:00
|
|
|
} src, ext, intern;
|
|
|
|
VALUE req_list;
|
|
|
|
ruby_features_t features;
|
|
|
|
ruby_features_t warn;
|
|
|
|
unsigned int dump;
|
2023-03-07 10:15:30 +03:00
|
|
|
#if USE_RJIT
|
2023-03-19 07:27:07 +03:00
|
|
|
struct rb_rjit_options rjit;
|
2022-01-10 17:38:16 +03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
int sflag, xflag;
|
|
|
|
unsigned int warning: 1;
|
|
|
|
unsigned int verbose: 1;
|
|
|
|
unsigned int do_loop: 1;
|
|
|
|
unsigned int do_print: 1;
|
|
|
|
unsigned int do_line: 1;
|
|
|
|
unsigned int do_split: 1;
|
|
|
|
unsigned int do_search: 1;
|
|
|
|
unsigned int setids: 2;
|
2022-10-24 19:20:44 +03:00
|
|
|
#if USE_YJIT
|
|
|
|
unsigned int yjit: 1;
|
|
|
|
#endif
|
2022-01-10 17:38:16 +03:00
|
|
|
} ruby_cmdline_options_t;
|
|
|
|
|
|
|
|
struct ruby_opt_message {
|
|
|
|
const char *str;
|
|
|
|
unsigned short namelen, secondlen;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define RUBY_OPT_MESSAGE(shortopt, longopt, desc) { \
|
|
|
|
shortopt " " longopt " " desc, \
|
|
|
|
(unsigned short)sizeof(shortopt), \
|
|
|
|
(unsigned short)sizeof(longopt), \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define opt_match(s, l, name) \
|
|
|
|
((((l) > rb_strlen_lit(name)) ? (s)[rb_strlen_lit(name)] == '=' : \
|
|
|
|
(l) == rb_strlen_lit(name)) && \
|
|
|
|
memcmp((s), name, rb_strlen_lit(name)) == 0 && \
|
|
|
|
(((s) += rb_strlen_lit(name)), 1))
|
|
|
|
|
|
|
|
#endif
|