Skip to content

Commit 5d5ce87

Browse files
committed
query: Remove string and symbol capabilities to convert flags of EvtQuery
Signed-off-by: Hiroshi Hatake <[email protected]>
1 parent c1f85b7 commit 5d5ce87

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

ext/winevt/winevt_query.c

-26
Original file line numberDiff line numberDiff line change
@@ -71,26 +71,6 @@ rb_winevt_query_alloc(VALUE klass)
7171
return obj;
7272
}
7373

74-
static DWORD
75-
get_evt_query_flag_from_cstr(char* flag_str)
76-
{
77-
if (strcmp(flag_str, "channel") == 0)
78-
return EvtQueryChannelPath;
79-
else if (strcmp(flag_str, "file") == 0)
80-
return EvtQueryFilePath;
81-
else if (strcmp(flag_str, "forward") == 0)
82-
return EvtQueryForwardDirection;
83-
else if (strcmp(flag_str, "reverse") == 0)
84-
return EvtQueryReverseDirection;
85-
else if (strcmp(flag_str, "tolerate_query_errors") == 0 ||
86-
strcmp(flag_str, "tolerate_errors") == 0)
87-
return EvtQueryTolerateQueryErrors;
88-
else
89-
rb_raise(rb_eArgError, "Unknown query flag: %s", flag_str);
90-
91-
return 0;
92-
}
93-
9474
/*
9575
* Initalize Query class.
9676
*
@@ -132,12 +112,6 @@ rb_winevt_query_initialize(VALUE argc, VALUE *argv, VALUE self)
132112
}
133113

134114
switch (TYPE(rb_flags)) {
135-
case T_SYMBOL:
136-
flags = get_evt_query_flag_from_cstr(RSTRING_PTR(rb_sym2str(rb_flags)));
137-
break;
138-
case T_STRING:
139-
flags = get_evt_query_flag_from_cstr(StringValuePtr(rb_flags));
140-
break;
141115
case T_FIXNUM:
142116
flags = NUM2LONG(rb_flags);
143117
break;

0 commit comments

Comments
 (0)