2 * Copyright (c) 2018 Samsung Electronics Co., Ltd.
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
8 * http://floralicense.org/license/
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.
19 #include "ttd-app-data.h"
21 struct __ttd_app_data {
26 ttd_app_data *ttd_app_data_new(const char *project, const char *data)
28 ttd_app_data *app_data = NULL;
30 retv_if(!project, NULL);
33 app_data = g_try_malloc0(sizeof(ttd_app_data));
34 retv_if(!app_data, NULL);
36 app_data->p_name = g_strdup(project);
37 app_data->data = g_strdup(data);
42 void ttd_app_data_free(ttd_app_data *app_data)
47 g_free(app_data->p_name);
48 g_free(app_data->data);
52 const char *ttd_app_data_get_project_name(ttd_app_data *app_data)
54 retv_if(!app_data, NULL);
55 return app_data->p_name;
58 const char *ttd_app_data_get_data(ttd_app_data *app_data)
60 retv_if(!app_data, NULL);
61 return app_data->data;