-
-
Notifications
You must be signed in to change notification settings - Fork 35
Closed
Description
- Version: All
- Platform: ALL
- Subsystem: API
Suggestions from Ben on nodejs/node-eps#20 (comment)
- 00X-ABI-Stable-Module-API.md
+
+### Types
+```C
+typedef struct napi_env__ *napi_env;
@bnoordhuis
bnoordhuis 5 hours ago Node.js Foundation member
Using typedef'd pointers has the issue that they will silently decay to void* when used in a void* context. Can be avoided by wrapping the pointer in a struct, like so:
typedef struct napi_value { struct napi_value *v; } napi_value;
- 00X-ABI-Stable-Module-API.md
+
+struct napi_method_descriptor {
+ napi_callback callback;
+ char* utf8name;
@bnoordhuis
bnoordhuis 5 hours ago Node.js Foundation member
const char*?
- 00X-ABI-Stable-Module-API.md
+NODE_EXTERN int napi_get_string_length(napi_env e, napi_value v);
+NODE_EXTERN int napi_get_string_utf8_length(napi_env e, napi_value v);
+NODE_EXTERN int napi_get_string_utf8(napi_env e, napi_value v,
+ char* buf, int bufsize);
@bnoordhuis
bnoordhuis 5 hours ago Node.js Foundation member
Why int instead of size_t?
- 00X-ABI-Stable-Module-API.md
+// Methods to support error handling
+NODE_EXTERN void napi_throw(napi_env e, napi_value error);
+NODE_EXTERN void napi_throw_error(napi_env e, char* msg);
+NODE_EXTERN void napi_throw_type_error(napi_env e, char* msg);
@bnoordhuis
bnoordhuis 5 hours ago Node.js Foundation member
const char*
Metadata
Metadata
Assignees
Labels
No labels