-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBlock.h
More file actions
38 lines (28 loc) · 1.05 KB
/
Block.h
File metadata and controls
38 lines (28 loc) · 1.05 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
#ifndef BLOCK_H
#define BLOCK_H
#include <cstdlib>
#include "Cif.h"
#include "Closure.h"
#include "node_api_util.h"
namespace nativescript {
class FunctionPointer {
public:
void* function;
metagen::MDSectionOffset offset;
Cif* cif;
bool ownsCif = false;
static napi_value wrap(napi_env env, void* function,
metagen::MDSectionOffset offset, bool isBlock);
static napi_value wrapWithEncoding(napi_env env, void* function,
const char* encoding, bool isBlock);
static void finalize(napi_env env, void* finalize_data, void* finalize_hint);
static napi_value jsCallAsCFunction(napi_env env, napi_callback_info cbinfo);
static napi_value jsCallAsBlock(napi_env env, napi_callback_info cbinfo);
};
id registerBlock(napi_env env, Closure* closure, napi_value callback);
napi_value getCachedBlockCallback(napi_env env, void* blockPtr);
bool isObjCBlockObject(id obj);
const char* getObjCBlockSignature(void* blockPtr);
NAPI_FUNCTION(registerBlock);
} // namespace nativescript
#endif /* BLOCK_H */