refactor des clibs et suppression de file.cc qui etait inutile

This commit is contained in:
Marc
2022-02-15 12:26:30 +01:00
parent bb8f751606
commit 205de4293b
6 changed files with 110 additions and 76 deletions
+2 -8
View File
@@ -9,19 +9,13 @@
namespace ioctlNode {
void nodeIoctl(const nodeparam& args) {
v8::Isolate* isolate = args.GetIsolate();
if (args.Length() < 2 || !args[0]->IsString() || !args[1]->IsUint32()) {
if (args.Length() < 2 || !args[0]->IsUint32() || !args[1]->IsUint32()) {
isolate->ThrowException(v8::Exception::TypeError(
v8::String::NewFromUtf8(isolate, "Argument 1& 2 must be a number").ToLocalChecked()));
return;
}
v8::String::Utf8Value str(isolate, args[0]);
std::string cppStr(*str);
int fd = open(cppStr.c_str(), 'r');
u_int32_t fd = args[0].As<v8::Number>()->Value();
unsigned long request = args[1].As<v8::Number>()->Value();
int params[args.Length() - 2];
for(int i = 1 ; i < args.Length(); i++ ) {