-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Hosung Kim [email protected]
- Loading branch information
Showing
9 changed files
with
122 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
* Copyright (c) 2024-present Samsung Electronics Co., Ltd | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#include <uv.h> | ||
|
||
#include "lwnode-public.h" | ||
#include "lwnode.h" | ||
#include "lwnode/aul-event-receiver.h" | ||
#include "node.h" | ||
#include "trace.h" | ||
|
||
namespace lwnode { | ||
|
||
bool ParseAULEvent(int argc, char** argv) { | ||
bool result = AULEventReceiver::getInstance()->start(argc, argv); | ||
if (result) { | ||
LWNode::SystemInfo::getInstance()->add("aul"); | ||
} | ||
|
||
return result; | ||
} | ||
|
||
bool InitScriptRootPath(const std::string path) { | ||
#if defined(HOST_TIZEN) | ||
int result; | ||
if (path.empty()) { | ||
char* path = app_get_resource_path(); | ||
result = uv_chdir(path); | ||
free(path); | ||
} else { | ||
result = uv_chdir(path.c_str()); | ||
} | ||
|
||
if (result != 0) { | ||
LWNODE_DEV_LOGF("ERROR: Failed to change directory. (%d)\n", -errno); | ||
|
||
return false; | ||
} | ||
|
||
return true; | ||
#else | ||
return false; | ||
#endif | ||
} | ||
|
||
int Start(int argc, char** argv) { | ||
return node::Start(argc, argv); | ||
} | ||
|
||
} // namespace LWNode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright (c) 2024-present Samsung Electronics Co., Ltd | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <string> | ||
|
||
#ifndef LWNODE_EXPORT | ||
#define LWNODE_EXPORT __attribute__((visibility("default"))) | ||
#endif | ||
|
||
namespace lwnode { | ||
|
||
LWNODE_EXPORT bool ParseAULEvent(int argc, char** argv); | ||
|
||
// Support only Tizen platform. | ||
// Sets the path of the root directory of the JavaScript. If you do not put the | ||
// path argument, the root path is the app's resource path | ||
// by default. Be sure to call this function before lwnode::Start function. | ||
LWNODE_EXPORT bool InitScriptRootPath(const std::string path = ""); | ||
|
||
LWNODE_EXPORT int Start(int argc, char** argv); | ||
|
||
} // namespace lwnode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters