* limitations under the License.
*
*/
+#ifndef bool
+typedef int bool;
+#ifndef true
+#define true 1
+#endif
+#ifndef false
+#define false 0
+#endif
+#endif
<xsl:apply-templates select="configlists/config"></xsl:apply-templates>
</xsl:template>
-
<xsl:template match="config">
char* <xsl:value-of select="./@name"/>_plugin_path();<xsl:text>
</xsl:text>
<xsl:apply-templates select="plugin/function"></xsl:apply-templates>
</xsl:choose>
<!-- end choose INT -->
</xsl:when>
+ <xsl:when test="../../@type='bool'">
+<!-- begin choose INT-->
+<xsl:choose>
+ <xsl:when test="./@type='init'">
+int <xsl:value-of select="../../@name"/>_<xsl:value-of select="./@type"/>();<xsl:text>
</xsl:text>
+ </xsl:when>
+
+ <xsl:when test="./@type='destroy'">
+int <xsl:value-of select="../../@name"/>_<xsl:value-of select="./@type"/>();<xsl:text>
</xsl:text>
+ </xsl:when>
+
+ <xsl:when test="./@type='get'">
+bool <xsl:value-of select="../../@name"/>_<xsl:value-of select="./@type"/>(char* key);<xsl:text>
</xsl:text>
+ </xsl:when>
+
+ <xsl:when test="./@type='set'">
+int <xsl:value-of select="../../@name"/>_<xsl:value-of select="./@type"/>(char* key, bool value);<xsl:text>
</xsl:text>
+ </xsl:when>
+</xsl:choose>
+<!-- end choose INT -->
+ </xsl:when>
+
</xsl:choose>
</xsl:template>
</xsl:when>
</xsl:choose>
<!-- end choose INT -->
+ </xsl:when>
+ <xsl:when test="../../@type='bool'">
+<!-- begin choose INT-->
+<xsl:choose>
+ <xsl:when test="./@type='init'">
+int <xsl:value-of select="../../@name"/>_<xsl:value-of select="./@type"/>()<xsl:text>
</xsl:text>
+{
+ return 0;
+}
+ </xsl:when>
+
+ <xsl:when test="./@type='destroy'">
+int <xsl:value-of select="../../@name"/>_<xsl:value-of select="./@type"/>()<xsl:text>
</xsl:text>
+{
+ return 0;
+}
+ </xsl:when>
+
+ <xsl:when test="./@type='get'">
+bool <xsl:value-of select="../../@name"/>_<xsl:value-of select="./@type"/>(char* key)<xsl:text>
</xsl:text>
+{
+ PluginTizenConfig* (*fn)(int *);
+ fn = config_manager(<xsl:value-of select="../../@name"/>_plugin_path(), "<xsl:value-of select="../@name"/>");
+ bool val = config_manager_get_bool(fn, key);
+ config_manager_close();
+ return val;
+}
+ </xsl:when>
+
+ <xsl:when test="./@type='set'">
+int <xsl:value-of select="../../@name"/>_<xsl:value-of select="./@type"/>(char* key, bool value)<xsl:text>
</xsl:text>
+{
+ PluginTizenConfig* (*fn)(int *);
+ fn = config_manager(<xsl:value-of select="../../@name"/>_plugin_path(), "<xsl:value-of select="../@name"/>");
+ config_manager_set_bool(fn, key, value);
+ config_manager_close();
+ return 0;
+}
+ </xsl:when>
+</xsl:choose>
+<!-- end choose INT -->
</xsl:when>
+
+
</xsl:choose>
return 0;
}
-#if 0
bool config_manager_get_bool(PluginTizenConfig* (*fn)(),char* key)
{
PluginTizenConfig* pt_table = (*fn)();
return 0;
}
-#endif
void config_manager_close()
{
extern "C" {
#endif
-//PluginTizenConfig* (*fn)(int *);
-
// config_manager
PluginTizenConfig* (*config_manager(char* plugin_path, char* plugin_id))();
// plugin_manager_set
int config_manager_set_int(PluginTizenConfig* (*fn)(int *), char* key, int value);
+// plugin_manager_get
+bool config_manager_get_bool(PluginTizenConfig* (*fn)(int *), char* key);
+
+// plugin_manager_set
+int config_manager_set_bool(PluginTizenConfig* (*fn)(int *), char* key, bool value);
-// plugin_manager_close
void config_manager_close();
#ifdef __cplusplus
* limitations under the License.
*
*/
+#ifndef bool
+typedef int bool;
+#ifndef true
+#define true 1
+#endif
+#ifndef false
+#define false 0
+#endif
+#endif
char* airplane_mode_on_plugin_path();
char* airplane_mode_on_get(char* key);
int airplane_mode_on_set(char* key, char* value);
return val;
}
+char* get_bool_version_plugin_path()
+{
+ return "/usr/lib/libhelloworld_plugin.so";
+}
+bool get_bool_version_get(char* key)
+{
+ PluginTizenConfig* (*fn)(int *);
+ fn = config_manager(get_bool_version_plugin_path(), "get_plugin_hellobool_object");
+ bool val = config_manager_get_bool(fn, key);
+ config_manager_close();
+ return val;
+}
+
+int get_bool_version_set(char* key, bool value)
+{
+ PluginTizenConfig* (*fn)(int *);
+ fn = config_manager(get_bool_version_plugin_path(), "get_plugin_hellobool_object");
+ config_manager_set_bool(fn, key, value);
+ config_manager_close();
+ return 0;
+}
+
char* get_int_version_plugin_path()
{
return "/usr/lib/libhelloworld_plugin.so";
* limitations under the License.
*
*/
+#ifndef bool
+typedef int bool;
+#ifndef true
+#define true 1
+#endif
+#ifndef false
+#define false 0
+#endif
+#endif
char* get_complex_string_plugin_path();
char* get_complex_string_get(char* key);
char* get_simple_text_plugin_path();
char* get_simple_text_get(char* key);
+char* get_bool_version_plugin_path();
+bool get_bool_version_get(char* key);
+int get_bool_version_set(char* key, bool value);
char* get_int_version_plugin_path();
int get_int_version_get(char* key);
int get_int_version_set(char* key, int value);
<desc>simple text example</desc>
</config>
+ <config name="get_bool_version" type="bool">
+ <plugin name="get_plugin_hellobool_object" path="/usr/lib/libhelloworld_plugin.so">
+ <function type="get"/>
+ <function type="set"/>
+ </plugin>
+ <desc>get_bool_version</desc>
+ </config>
+
<config name="get_int_version" type="int">
<plugin name="get_plugin_helloint_object" path="/usr/lib/libhelloworld_plugin.so">
<function type="get"/>
<function type="set"/>
</plugin>
- <desc>ini plugin example</desc>
+ <desc>get_int_version</desc>
</config>
-
<config name="get_sw_version" type="string">
<plugin name="get_plugin_ini_object" path="/usr/lib/libplugin2.so">
<!--<plugin name="get_plugin_helloworld_object" path="/usr/lib/libhelloworld_plugin.so">-->
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Werror-implicit-function-declaration")
SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
-ADD_LIBRARY(helloworld_plugin SHARED helloworld_plugin.c helloint_plugin.c)
+ADD_LIBRARY(helloworld_plugin SHARED helloworld_plugin.c helloint_plugin.c hellobool_plugin.c)
SET(PLUGIN1_VERSION_MAJOR 1)
SET(PLUGIN1_VERSION_MINOR 1)
SET(PLUGIN1_VERSION_PATCH 0)
--- /dev/null
+#include <stdio.h>
+#include <plugin1.h>
+
+static int hellobool_init()
+{
+ printf("hellobool_init \n");
+ return 0;
+}
+
+static bool hellobool_get_config(char* key)
+{
+ printf("hellobool_get_config : %s \n", key);
+ return true;
+}
+
+static int hellobool_set_config(char* key, bool value)
+{
+ printf("hellobool_set_config key : %s, value : %d \n", key, value);
+ return 0;
+}
+
+static int hellobool_destroy()
+{
+ printf("hellobool_destroy \n");
+ return 0;
+}
+
+static PluginTizenConfig config = {
+ .init = hellobool_init,
+ .get_config_bool = hellobool_get_config,
+ .set_config_bool = hellobool_set_config,
+ .destroy = hellobool_destroy
+};
+
+PluginTizenConfig* get_plugin_hellobool_object()
+{
+ return &config;
+}
extern "C" {
#endif
+#ifndef bool
+typedef int bool;
+#ifndef true
+#define true 1
+#endif
+#ifndef false
+#define false 0
+#endif
+#endif
+
typedef struct _tagPluginTizenConfig
{
int (*init)(void);
int (*get_config_int)(char * key);
int (*set_config_int)(char * key, int value);
+ // int type
+ bool (*get_config_bool)(char * key);
+ int (*set_config_bool)(char * key, bool value);
+
int (*destroy)(void);
} PluginTizenConfig;