Init basesystem source codes.
[staging/basesystem.git] / nsframework / backup_manager / server / src / backupmanager_main.cpp
1 /*
2  * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #include <native_service/ns_version_if.h>
18 #include <native_service/frameworkunified_dispatcher.h>
19 #include <agl_thread.h>
20 #include <system_service/ss_system_if.h>
21 #include <cerrno>
22 #include <cstdio>
23 #include "bkup_backupmanagerlog.h"
24
25 CFrameworkunifiedVersion g_FrameworkunifiedVersion(0, 0, 0);  // NOLINT(readability/nolint).
26
27 FRAMEWORKUNIFIEDLOGPARAM g_FrameworkunifiedLogParams = {  // NOLINT(readability/nolint) The varable is used by FW
28   FRAMEWORKUNIFIEDLOGOPTIONS,
29   {
30     ZONE_TEXT_10, ZONE_TEXT_11, ZONE_TEXT_12,
31     ZONE_TEXT_13, ZONE_TEXT_14, ZONE_TEXT_15,
32     ZONE_TEXT_16, ZONE_TEXT_17, ZONE_TEXT_18,
33     ZONE_TEXT_19, ZONE_TEXT_20, ZONE_TEXT_21,
34     ZONE_TEXT_22, ZONE_TEXT_23, ZONE_TEXT_24,
35     ZONE_TEXT_25, ZONE_TEXT_26, ZONE_TEXT_27,
36     ZONE_TEXT_28, ZONE_TEXT_29, ZONE_TEXT_30,
37     ZONE_TEXT_31
38   },
39   FRAMEWORKUNIFIEDLOGZONES
40 };
41
42 int main(int argc, char *argv[]) {
43   // LCOV_EXCL_BR_START 11:unexpected branch
44   FrameworkunifiedDefaultCallbackHandler cb_funcs;
45   FRAMEWORKUNIFIED_MAKE_DEFAULT_CALLBACK(cb_funcs);
46   FRAMEWORKUNIFIED_SET_ZONES();
47   // LCOV_EXCL_BR_STOP 11:unexpected branch
48
49   // LCOV_EXCL_BR_START 11:unexpected branch
50   EFrameworkunifiedStatus e_status = FrameworkunifiedDispatcherWithArguments(MN_NS_BACKUPMGR, argc, argv, &cb_funcs);
51   // LCOV_EXCL_BR_STOP 11:unexpected branch
52   if (e_status != eFrameworkunifiedStatusOK) {  // LCOV_EXCL_BR_LINE 4: NSFW error case
53     // LCOV_EXCL_START 4: NSFW error case
54     AGL_ASSERT_NOT_TESTED();  // LCOV_EXCL_LINE 200: test assert
55     FRAMEWORKUNIFIEDLOG(ZONE_ERR, __func__, "FrameworkunifiedDispatcherWithArguments: %d", e_status);
56     return EXIT_FAILURE;
57     // LCOV_EXCL_STOP 4: NSFW error case
58   }
59
60   return EXIT_SUCCESS;
61 }  // LCOV_EXCL_BR_LINE 10:The final line