• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #ifndef NATIVE_PARAMETERS_JS_H
16 #define NATIVE_PARAMETERS_JS_H
17 
18 #include <cstdarg>
19 #include <cstdio>
20 #include <cstdlib>
21 #include <cstring>
22 #include <fcntl.h>
23 #include <map>
24 #include <mutex>
25 #include <sstream>
26 #include <string>
27 #include <unistd.h>
28 
29 #include "hilog/log.h"
30 #include "napi/native_api.h"
31 #include "napi/native_node_api.h"
32 #include "param_wrapper.h"
33 #include "parameter.h"
34 
35 #define PARAM_JS_CHECK(retCode, exper, ...) \
36     if (!(retCode)) {                       \
37         HiLog::Error(LABEL, __VA_ARGS__);   \
38         exper;                              \
39     }
40 
41 EXTERN_C_START
42 napi_value GetWatcher(napi_env env, napi_callback_info info);
43 napi_value ParamWait(napi_env env, napi_callback_info info);
44 napi_value RegisterWatcher(napi_env env, napi_value exports);
45 EXTERN_C_END
46 
47 #endif // NATIVE_PARAMETERS_JS_H