forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathnode_sea.h
More file actions
44 lines (33 loc) · 1.2 KB
/
node_sea.h
File metadata and controls
44 lines (33 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef SRC_NODE_SEA_H_
#define SRC_NODE_SEA_H_
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#if !defined(DISABLE_SINGLE_EXECUTABLE_APPLICATION)
#include <cinttypes>
#include <string_view>
#include <tuple>
#include "node_exit_code.h"
namespace node {
namespace sea {
// A special number that will appear at the beginning of the single executable
// preparation blobs ready to be injected into the binary. We use this to check
// that the data given to us are intended for building single executable
// applications.
const uint32_t kMagic = 0x143da20;
enum class SeaFlags : uint32_t {
kDefault = 0,
kDisableExperimentalSeaWarning = 1 << 0,
};
struct SeaResource {
SeaFlags flags = SeaFlags::kDefault;
std::string_view code;
static constexpr size_t kHeaderSize = sizeof(kMagic) + sizeof(SeaFlags);
};
bool IsSingleExecutable();
SeaResource FindSingleExecutableResource();
std::tuple<int, char**> FixupArgsForSEA(int argc, char** argv);
node::ExitCode BuildSingleExecutableBlob(const std::string& config_path);
} // namespace sea
} // namespace node
#endif // !defined(DISABLE_SINGLE_EXECUTABLE_APPLICATION)
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#endif // SRC_NODE_SEA_H_