includes/hex: Added library files

This commit is contained in:
Nik
2022-09-14 14:01:54 +02:00
committed by GitHub
parent 36b107f0ca
commit caea4544ef
4 changed files with 43 additions and 9 deletions

29
includes/hex/core.pat Normal file
View File

@@ -0,0 +1,29 @@
#pragma once
#include <hex/impl/imhex_check.pat>
namespace hex::core {
struct Selection {
bool valid;
u64 address, size;
};
fn get_selection() {
u128 result = builtin::hex::core::get_selection();
Selection result;
if (result == u128(-1)) {
result.valid = false;
result.address = 0x00;
result.size = 0x00;
} else {
result.valid = true;
result.address = result >> 64;
result.size = result & u64(-1);
}
return result;
};
}

11
includes/hex/http.pat Normal file
View File

@@ -0,0 +1,11 @@
#pragma once
#include <hex/impl/imhex_check.pat>
namespace hex::http {
fn get(str url) {
return builtin::hex::http::get(url);
};
}

View File

@@ -0,0 +1,3 @@
#ifndef __IMHEX__
#error This library is only available in the ImHex Hex editor
#endif

View File

@@ -1,9 +0,0 @@
#pragma once
namespace std::http {
fn get(str url) {
return builtin::std::http::get(url);
};
}