Added lap counter module stub
[apps/native/gear-racing-car.git] / src / lap_counter / lap_counter.c
1 /*
2  * Copyright (c) 2018 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Flora License, Version 1.1 (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://floralicense.org/license/
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 "lap_counter/lap_counter.h"
18 #include <stdlib.h>
19 #include <string.h>
20 #include "log.h"
21
22 typedef struct lap_counter_data {
23         const char *user_name;
24 } lap_counter_data_t;
25
26 static lap_counter_data_t s_info = {0, };
27
28 int lap_counter_init()
29 {
30         s_info.user_name = NULL;
31         return 0;
32 }
33
34 int lap_counter_set_user_name(const char *user_name)
35 {
36         free((void*)s_info.user_name);
37         s_info.user_name = strdup(user_name);
38         if(!s_info.user_name) {
39                 return -1;
40         }
41         _D("User name set to %s", s_info.user_name);
42         return 0;
43 }
44
45 int lap_counter_shutdown()
46 {
47         free((void*)s_info.user_name);
48         return 0;
49 }