Code sync from tizen_2.4
[platform/core/telephony/tel-plugin-indicator.git] / src / desc.c
1 /*
2  * tel-plugin-indicator
3  *
4  * Copyright (c) 2014 Samsung Electronics Co. Ltd. All rights reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18
19 #include <tcore.h>
20 #include <plugin.h>
21
22 #include "s_indi_main.h"
23 #include "s_indi_util.h"
24
25 #ifndef PLUGIN_VERSION
26 #define PLUGIN_VERSION 1
27 #endif
28
29 static gboolean on_load()
30 {
31         dbg("i'm load");
32         return TRUE;
33 }
34
35 static gboolean on_init(TcorePlugin *plugin)
36 {
37         gboolean result = FALSE;
38         s_indi_assert(NULL != plugin);
39
40         result = s_indi_init(plugin);
41         if (result == FALSE)
42                 err("Failed intializing the plugin");
43         else
44                 dbg("indicator-plugin INIT SUCCESS");
45
46         return result;
47 }
48
49 static void on_unload(TcorePlugin *plugin)
50 {
51         s_indi_assert(NULL != plugin);
52
53         s_indi_deinit(plugin);
54         dbg("indicator-plugin UNLOAD COMPLETE");
55 }
56
57 EXPORT_API struct tcore_plugin_define_desc plugin_define_desc = {
58         .name = "INDICATOR",
59         .priority = TCORE_PLUGIN_PRIORITY_MID + 2,
60         .version = PLUGIN_VERSION,
61         .load = on_load,
62         .init = on_init,
63         .unload = on_unload
64 };