4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jayoun Lee <airjany@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
22 #include <linux/limits.h>
29 #include <sys/types.h>
31 #include "ug-engine.h"
34 #define UG_ENGINE_INIT_SYM "UG_ENGINE_INIT"
35 #define UG_ENGINE_EXIT_SYM "UG_ENGINE_EXIT"
41 struct ug_engine *ug_engine_load()
44 struct ug_engine *engine;
45 int (*engine_init)(struct ug_engine_ops *ops);
47 engine = calloc(1, sizeof(struct ug_engine));
56 handle = dlopen(UG_LIB_DIR"/libui-gadget-1-efl-engine.so", RTLD_LAZY);
59 _ERR("dlopen failed: %s", dlerror());
64 engine_init = dlsym(handle, UG_ENGINE_INIT_SYM);
66 _ERR("dlsym failed: %s", dlerror());
70 if (engine_init(&engine->ops))
73 engine->handle = handle;
87 int ug_engine_unload(struct ug_engine *engine)
89 void (*engine_exit)(struct ug_engine_ops *ops);
97 engine_exit = dlsym(engine->handle, UG_ENGINE_EXIT_SYM);
99 engine_exit(&engine->ops);
101 _ERR("dlsym failed: %s", dlerror());
103 dlclose(engine->handle);