File: buffer_no_external.cc

package info (click to toggle)
node-addon-api 8.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,248 kB
  • sloc: cpp: 15,431; javascript: 5,631; ansic: 157; makefile: 7
file content (24 lines) | stat: -rw-r--r-- 662 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#define NODE_API_NO_EXTERNAL_BUFFERS_ALLOWED
// Should compile without errors
#include "buffer.h"
#include "napi.h"

using namespace Napi;
using namespace test_buffer;

namespace {
#include "buffer_new_or_copy-inl.h"
}

Object InitBufferNoExternal(Env env) {
  Object exports = Object::New(env);

  exports["createOrCopyExternalBuffer"] =
      Function::New(env, CreateOrCopyExternalBuffer);
  exports["createOrCopyExternalBufferWithFinalize"] =
      Function::New(env, CreateOrCopyExternalBufferWithFinalize);
  exports["createOrCopyExternalBufferWithFinalizeHint"] =
      Function::New(env, CreateOrCopyExternalBufferWithFinalizeHint);

  return exports;
}