* @see account_update_to_db_by_id()
* @see account_update_to_db_by_user_name()
*/
-ACCOUNT_API int account_delete_from_db_by_package_name(char *package_name);
+ACCOUNT_API int account_delete_from_db_by_package_name(const char *package_name);
/**
*/
ACCOUNT_API int account_update_sync_status_by_id(int account_db_id, const account_sync_state_e sync_status);
-/**
- * @brief Called once for each service provider of account
- *
- * @param[in] package_name package name of the service
- * @param[in] icon_path icon path of the service
- * @param[in] multiple if true supports multiple account else only one account support
- * @param[in] user_data The user data passed from the account_query_service_list_by_capability function
- *
- * @return @c true to continue with the next iteration of the loop or @c false to break out of the loop.
- *
- * @pre account_query_service_list_by_capability() invokes this callback.
- *
- * @see account_query_service_list_by_capability()
- */
-typedef bool (*service_list_cb)(char *package_name, char *icon_path, bool multiple, void *user_data);
-
-/**
- * @brief Retrieves all services which supports specified capability.
- *
- * @param[in] callback The callback function to invoke
- * @param[in] capability_type The capablity type to search
- * @param[in] user_data The user data to be passed to the callback function
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #ACCOUNT_ERROR_NONE Successful
- * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #ACCOUNT_ERROR_XML_PARSE_FAILED XML Parsing failed
- * @retval #ACCOUNT_ERROR_XML_FILE_NOT_FOUND XML file not found
- *
- * @post This function invokes service_list_cb().
- *
- */
-ACCOUNT_API int account_query_service_list_by_capability(service_list_cb callback, const char* capability_type, void *user_data);
-
-
-/**
- * @brief Get whether application supports desired capability or not.
- *
- * @param[in] package_name The application's package name
- * @param[in] capability_filter which capability to check for
- * @param[out] supported whether desired capability is supported, Returns true otherwise false
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #ACCOUNT_ERROR_NONE Successful
- * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #ACCOUNT_ERROR_XML_PARSE_FAILED XML Parsing failed
- * @retval #ACCOUNT_ERROR_XML_FILE_NOT_FOUND XML file not found
- *
- */
-ACCOUNT_API int account_get_application_capability_support(char *package_name, char *capability_filter, bool *supported);
-
-
-/**
- * @brief Get whether application supports multiple accounts or not.
- *
- * @param[in] package_name The application's package name
- * @param[out] supported if multiple account is supported returns true otherwise false
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #ACCOUNT_ERROR_NONE Successful
- * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #ACCOUNT_ERROR_XML_PARSE_FAILED XML Parsing failed
- * @retval #ACCOUNT_ERROR_XML_FILE_NOT_FOUND XML file not found
- *
- */
-ACCOUNT_API int account_get_application_multiple_account_support(char * package_name, bool * supported);
-
-/**
- * @brief Get application's icon path.
- *
- * @remarks @a icon_path must be released with free() by you.
- *
- * @param[in] package_name The application's package name
- * @param[out] icon_path if path is availabe it will have icon_path, otherwise NULL
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #ACCOUNT_ERROR_NONE Successful
- * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #ACCOUNT_ERROR_XML_PARSE_FAILED XML Parsing failed
- * @retval #ACCOUNT_ERROR_XML_FILE_NOT_FOUND XML file not found
- *
- */
-ACCOUNT_API int account_get_application_icon_path(const char *package_name, char **icon_path);
-
/* Account type API */
+++ /dev/null
-/*
- * account
- *
- * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Wonyoung Lee <wy1115.lee@samsung.com>, Sungchan Kim <sungchan81.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <account.h>
-#include <glib.h>
-#include <account-private.h>
-#include <libxml/xmlmemory.h>
-#include <libxml/parser.h>
-#include <app.h>
-
-#ifndef ACCOUNT_API
-#define ACCOUNT_API __attribute__ ((visibility("default")))
-#endif
-
-#define ACCOUNT_XML_DIR "/usr/share/account"
-#define ACCOUNT_XML_OPT_DIR "/opt/usr/share/account"
-#define BUFSIZE 1024
-
-static void _account_parse_doc(xmlDocPtr doc, xmlNodePtr cur,
- char *capability_filter, bool *supported)
-{
- xmlChar *key;
- cur = cur->xmlChildrenNode;
- while ((cur != NULL) && (*supported != true)) {
- if ((!xmlStrcmp(cur->name, (const xmlChar *)"capability"))) {
- key = xmlNodeGetContent(cur);
- ACCOUNT_DEBUG("Capability String is : %s\n", key);
- if (!strcmp(capability_filter, (char *)key)) {
- *supported = true;
- }
- xmlFree(key);
- }
- cur = cur->next;
- }
- return;
-}
-
-static bool _account_check_file_exists(char *f_path)
-{
- FILE *file;
- if ((file = fopen(f_path, "r")) != NULL) {
- fclose(file);
- return TRUE;
- }
- return FALSE;
-}
-
-ACCOUNT_API int account_get_application_capability_support(char *package_name,
- char *capability_filter, bool *supported)
-{
- if (!package_name) {
- ACCOUNT_ERROR("package_name can not be NULL \n");
- return ACCOUNT_ERROR_INVALID_PARAMETER;
- }
- if (!capability_filter) {
- ACCOUNT_ERROR("capability_filter can not be NULL \n");
- return ACCOUNT_ERROR_INVALID_PARAMETER;
- }
- if (!supported) {
- ACCOUNT_ERROR("supported pointer can not be NULL \n");
- return ACCOUNT_ERROR_INVALID_PARAMETER;
- }
- char xml_file_path[BUFSIZE] = {0, };
- xmlDocPtr doc = NULL;
- xmlNodePtr cur = NULL;
- *supported = false;
-
- ACCOUNT_MEMSET(xml_file_path, 0, sizeof(xml_file_path));
- ACCOUNT_SNPRINTF(xml_file_path, BUFSIZE, "%s/%s.account.xml",
- ACCOUNT_XML_DIR, package_name);
-
- ACCOUNT_INFO("xml_file_path = %s \n",xml_file_path);
-
- if (!_account_check_file_exists(xml_file_path)) {
- ACCOUNT_ERROR("XML file not found for %s \n", package_name);
-
- /*Check if file exists in /opt directory*/
- ACCOUNT_MEMSET(xml_file_path, 0, sizeof(xml_file_path));
- ACCOUNT_SNPRINTF(xml_file_path, BUFSIZE, "%s/%s.account.xml",
- ACCOUNT_XML_OPT_DIR, package_name);
-
- ACCOUNT_INFO("xml_file_path = %s \n",xml_file_path);
-
- if (!_account_check_file_exists(xml_file_path)) {
- ACCOUNT_ERROR("XML file not found for %s \n", package_name);
- return ACCOUNT_ERROR_XML_FILE_NOT_FOUND;
- }
- }
-
- doc = xmlParseFile(xml_file_path);
- if (doc == NULL ) {
- ACCOUNT_ERROR("Document not parsed successfully. \n");
- return ACCOUNT_ERROR_XML_PARSE_FAILED;
- }
-
- cur = xmlDocGetRootElement(doc);
- if (cur == NULL) {
- ACCOUNT_ERROR("empty document\n");
- xmlFreeDoc(doc);
- return ACCOUNT_ERROR_XML_PARSE_FAILED;
- }
-
- if (xmlStrcmp(cur->name, (const xmlChar *) "account")) {
- ACCOUNT_ERROR("document of the wrong type, root node != account");
- xmlFreeDoc(doc);
- return ACCOUNT_ERROR_XML_PARSE_FAILED;
- }
- _account_parse_doc(doc, cur, capability_filter, supported);
- xmlFreeDoc(doc);
-
- return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_get_application_multiple_account_support(
- char *package_name,
- bool *supported)
-{
- if (!package_name) {
- ACCOUNT_ERROR("package_name can not be NULL \n");
- return ACCOUNT_ERROR_INVALID_PARAMETER;
- }
- if (!supported) {
- ACCOUNT_ERROR("supported pointer can not be NULL \n");
- return ACCOUNT_ERROR_INVALID_PARAMETER;
- }
- char xml_file_path[BUFSIZE] = {0, };
- xmlDocPtr doc = NULL;
- xmlNodePtr cur = NULL;
- xmlChar *attr = NULL;
- *supported = false;
-
- ACCOUNT_MEMSET(xml_file_path, 0, sizeof(xml_file_path));
- ACCOUNT_SNPRINTF(xml_file_path, BUFSIZE, "%s/%s.account.xml",
- ACCOUNT_XML_DIR, package_name);
-
- ACCOUNT_VERBOSE("xml_file_path = %s \n",xml_file_path);
-
- if (!_account_check_file_exists(xml_file_path)) {
- ACCOUNT_ERROR("XML file not found for %s \n", package_name);
-
- /*Check if file exists in /opt directory*/
- ACCOUNT_MEMSET(xml_file_path, 0, sizeof(xml_file_path));
- ACCOUNT_SNPRINTF(xml_file_path, BUFSIZE, "%s/%s.account.xml",
- ACCOUNT_XML_OPT_DIR, package_name);
-
- ACCOUNT_VERBOSE("xml_file_path = %s \n",xml_file_path);
-
- if (!_account_check_file_exists(xml_file_path)) {
- ACCOUNT_ERROR("XML file not found for %s \n", package_name);
- return ACCOUNT_ERROR_XML_FILE_NOT_FOUND;
- }
- }
-
- doc = xmlParseFile(xml_file_path);
- if (doc == NULL ) {
- ACCOUNT_ERROR("Document not parsed successfully. \n");
- return ACCOUNT_ERROR_XML_PARSE_FAILED;
- }
-
- cur = xmlDocGetRootElement(doc);
- if (cur == NULL) {
- ACCOUNT_ERROR("empty document\n");
- xmlFreeDoc(doc);
- return ACCOUNT_ERROR_XML_PARSE_FAILED;
- }
-
- if (xmlStrcmp(cur->name, (const xmlChar *) "account")) {
- ACCOUNT_ERROR("document of the wrong type, root node != account");
- xmlFreeDoc(doc);
- return ACCOUNT_ERROR_XML_PARSE_FAILED;
- }
- attr = xmlGetProp(cur, (const xmlChar *)"multiple");
- ACCOUNT_INFO("Multiple = %s \n",(char *)attr);
-
- if (attr == NULL)
- *supported = false;
- else if (!strcmp("false", (char *)attr))
- *supported = false;
- else if (!strcmp("true", (char *)attr))
- *supported = true;
- else
- *supported = false;
-
- xmlFreeDoc(doc);
-
- return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_get_application_icon_path(const char *package_name,
- char **icon_path)
-{
- if (!package_name) {
- ACCOUNT_ERROR("package_name can not be NULL \n");
- return ACCOUNT_ERROR_INVALID_PARAMETER;
- }
- if (!icon_path) {
- ACCOUNT_ERROR("icon_path pointer can not be NULL \n");
- return ACCOUNT_ERROR_INVALID_PARAMETER;
- }
- char xml_file_path[BUFSIZE] = {0, };
- xmlDocPtr doc = NULL;
- xmlNodePtr cur = NULL;
- xmlChar *attr = NULL;
- *icon_path = NULL;
-
- ACCOUNT_MEMSET(xml_file_path, 0, sizeof(xml_file_path));
- ACCOUNT_SNPRINTF(xml_file_path, BUFSIZE, "%s/%s.account.xml",
- ACCOUNT_XML_DIR, package_name);
-
- ACCOUNT_INFO("xml_file_path = %s \n",xml_file_path);
-
- if (!_account_check_file_exists(xml_file_path)) {
- ACCOUNT_ERROR("XML file not found for %s \n", package_name);
-
- /*Check if file exists in /opt directory*/
- ACCOUNT_MEMSET(xml_file_path, 0, sizeof(xml_file_path));
- ACCOUNT_SNPRINTF(xml_file_path, BUFSIZE, "%s/%s.account.xml",
- ACCOUNT_XML_OPT_DIR, package_name);
-
- ACCOUNT_INFO("xml_file_path = %s \n",xml_file_path);
-
- if (!_account_check_file_exists(xml_file_path)) {
- ACCOUNT_ERROR("XML file not found for %s \n", package_name);
- return ACCOUNT_ERROR_XML_FILE_NOT_FOUND;
- }
- }
-
- doc = xmlParseFile(xml_file_path);
- if (doc == NULL ) {
- ACCOUNT_ERROR("Document not parsed successfully. \n");
- return ACCOUNT_ERROR_XML_PARSE_FAILED;
- }
-
- cur = xmlDocGetRootElement(doc);
- if (cur == NULL) {
- ACCOUNT_ERROR("empty document\n");
- xmlFreeDoc(doc);
- return ACCOUNT_ERROR_XML_PARSE_FAILED;
- }
-
- if (xmlStrcmp(cur->name, (const xmlChar *) "account")) {
- ACCOUNT_ERROR("document of the wrong type, root node != account");
- xmlFreeDoc(doc);
- return ACCOUNT_ERROR_XML_PARSE_FAILED;
- }
- attr = xmlGetProp(cur, (const xmlChar *)"icon_path");
- ACCOUNT_DEBUG("icon_path = %s \n",(char *)attr);
-
- if (attr == NULL)
- *icon_path = NULL;
- else
- *icon_path = strdup((char *)attr);
-
- xmlFreeDoc(doc);
-
- return ACCOUNT_ERROR_NONE;
-}
-
-static bool __service_iter_func(service_h service, const char* pkg_name,
- void *data)
-{
- if (!pkg_name) {
- ACCOUNT_ERROR("__service_iter_func: pkg name NULL \n");
- return TRUE;
- }
- GList **pkg_list = (GList **)data;
- char *pkgname = NULL;
- pkgname = strdup(pkg_name);
- *pkg_list = g_list_append(*pkg_list, pkgname);
- return TRUE;
-}
-
-ACCOUNT_API int account_query_service_list_by_capability(service_list_cb callback,
- const char* capability_type,
- void *user_data)
-{
- int ret = SERVICE_ERROR_NONE;
- GList *pkg_list = NULL;
- service_h service = NULL;
- GList *iter = NULL;
- char *list_item = NULL;
- char *capability_filter = NULL;
- bool supported = false;
- char *icon_path = NULL;
- bool multiple = false;
- int error_code = ACCOUNT_ERROR_NONE;
-
- ACCOUNT_RETURN_VAL((capability_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("CAPABILITY TYPE IS NULL"));
- ACCOUNT_RETURN_VAL((callback != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("CALL BACK IS NULL"));
-
- ACCOUNT_VERBOSE("account_query_service_list_by_capability START \n");
- ret = service_create(&service);
- if (ret != SERVICE_ERROR_NONE) {
- ACCOUNT_ERROR("Owner Check : service_create fail ret=%d\n", ret);
- return ret;
- } else {
- ACCOUNT_VERBOSE("service_list_by: service_create SUCCESS!!!!!! ret=%d\n", ret);
- }
- ret = service_set_operation(service, ACCOUNT_OPERATION_SIGNIN);
- if (ret != SERVICE_ERROR_NONE) {
- ACCOUNT_ERROR("service_list_by : service_set_operation fail ret=%d\n", ret);
- service_destroy(service);
- return ret;
- } else {
- ACCOUNT_VERBOSE("service_list_by : service_set_operation SUCCESS!!!!!! ret=%d\n",
- ret);
- }
- ret = service_foreach_app_matched(service, __service_iter_func, &pkg_list);
- if (ret != SERVICE_ERROR_NONE) {
- ACCOUNT_ERROR("service_list_by : service_foreach_app_matched fail ret=%d\n",
- ret);
- service_destroy(service);
- return ret;
- } else {
- ACCOUNT_VERBOSE("service_list_by : service_foreach_app_matched SUCCESS!!!!!! ret=%d\n",
- ret);
- }
-
- ret = service_destroy(service);
- if (ret != SERVICE_ERROR_NONE) {
- ACCOUNT_ERROR("service_list_by : service_destroy fail ret=%d\n", ret);
- for (iter = pkg_list; iter != NULL; iter = g_list_next(iter)) {
- list_item = (char *)iter->data;
- g_free(list_item);
- }
- g_list_free(pkg_list);
- return ret;
- } else {
- ACCOUNT_VERBOSE("service_list_by : service_destroy SUCCESS!!!!!! ret=%d\n", ret);
- }
-
- capability_filter = strdup(capability_type);
-
- for (iter = pkg_list; iter != NULL; iter = g_list_next(iter)) {
- list_item = (char *)iter->data;
- error_code = account_get_application_capability_support(list_item,
- capability_filter,
- &supported);
-
- if ((error_code != ACCOUNT_ERROR_NONE)
- && (error_code != ACCOUNT_ERROR_XML_FILE_NOT_FOUND)) {
- ACCOUNT_ERROR("service_list_by : account_get_application_capability_support fail error_code=%d\n", error_code);
- for (iter = pkg_list; iter != NULL; iter = g_list_next(iter)) {
- list_item = (char *)iter->data;
- g_free(list_item);
- }
- g_list_free(pkg_list);
- _ACCOUNT_FREE(capability_filter);
- return error_code;
- }
-
- if (supported) {
- error_code = account_get_application_icon_path(list_item, &icon_path);
- if (error_code != ACCOUNT_ERROR_NONE) {
- ACCOUNT_ERROR("service_list_by : account_get_application_capability_support fail error_code=%d\n", error_code);
- for (iter = pkg_list; iter != NULL; iter = g_list_next(iter)) {
- list_item = (char *)iter->data;
- g_free(list_item);
- }
- g_list_free(pkg_list);
- _ACCOUNT_FREE(capability_filter);
- return error_code;
- }
- error_code = account_get_application_multiple_account_support(list_item, &multiple);
- if (error_code != ACCOUNT_ERROR_NONE) {
- ACCOUNT_ERROR("service_list_by : account_get_application_capability_support fail error_code=%d\n", error_code);
- for (iter = pkg_list; iter != NULL; iter = g_list_next(iter)) {
- list_item = (char *)iter->data;
- g_free(list_item);
- }
- g_list_free(pkg_list);
- _ACCOUNT_FREE(capability_filter);
- return error_code;
- }
- callback(list_item, icon_path, multiple, user_data);
- }
- }
- /* free list */
- for (iter = pkg_list; iter != NULL; iter = g_list_next(iter)) {
- list_item = (char *)iter->data;
- g_free(list_item);
- }
- g_list_free(pkg_list);
- _ACCOUNT_FREE(capability_filter);
- return ACCOUNT_ERROR_NONE;
-}
+++ /dev/null
-/*
- * account
- *
- * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Wonyoung Lee <wy1115.lee@samsung.com>, Sungchan Kim <sungchan81.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <libxml/xmlmemory.h>
-#include <libxml/parser.h>
-#include <account-types.h>
-#include <account.h>
-
-static char *_account_list_get_capablity_string_value(char *key)
-{
- if (!strcmp(ACCOUNT_SUPPORTS_CAPABILITY_CONTACT, key))
- return "Contact";
- else if (!strcmp(ACCOUNT_SUPPORTS_CAPABILITY_CALENDAR, key))
- return "Calendar";
- else if (!strcmp(ACCOUNT_SUPPORTS_CAPABILITY_PHOTO, key))
- return "Photo";
- else if (!strcmp(ACCOUNT_SUPPORTS_CAPABILITY_VIDEO, key))
- return "Video";
- else if (!strcmp(ACCOUNT_SUPPORTS_CAPABILITY_EMAIL, key))
- return "Email";
- else if (!strcmp(ACCOUNT_SUPPORTS_CAPABILITY_POST, key))
- return "Post";
- else if (!strcmp(ACCOUNT_SUPPORTS_CAPABILITY_VOIP, key))
- return "VOIP";
- else if (!strcmp(ACCOUNT_SUPPORTS_CAPABILITY_SAMSUNG_APPS, key))
- return "Samsung Apps";
- else if (!strcmp(ACCOUNT_SUPPORTS_CAPABILITY_MOBILE_TRACKER, key))
- return "Mobile Tracker";
- else if (!strcmp(ACCOUNT_SUPPORTS_CAPABILITY_TASK, key))
- return "Task";
- else if (!strcmp(ACCOUNT_SUPPORTS_CAPABILITY_S_NOTE, key))
- return "S note";
- else if (!strcmp(ACCOUNT_SUPPORTS_CAPABILITY_GALLERY, key))
- return "Gallery";
- else if (!strcmp(ACCOUNT_SUPPORTS_CAPABILITY_MUSIC, key))
- return "Music";
- else if (!strcmp(ACCOUNT_SUPPORTS_CAPABILITY_MEMO, key))
- return "Memo";
- else if (!strcmp(ACCOUNT_SUPPORTS_CAPABILITY_MESSAGE, key))
- return "Message";
- else if (!strcmp(ACCOUNT_SUPPORTS_CAPABILITY_CHAT, key))
- return "Chat";
- else if (!strcmp(ACCOUNT_SUPPORTS_CAPABILITY_BOOKMARK, key))
- return "Bookmark";
- else if (!strcmp(ACCOUNT_SUPPORTS_CAPABILITY_TIZEN_EMAIL, key))
- return "Tizen Email";
- else
- return "::ERROR::Unkown:Recheck String !!!!";
-}
-
-void parseCap (xmlDocPtr doc, xmlNodePtr cur)
-{
- xmlChar *key;
- cur = cur->xmlChildrenNode;
- printf("\n List of supported Capabilities is :\n");
- while (cur != NULL) {
- if ((!xmlStrcmp(cur->name, (const xmlChar *)"capability"))) {
- key = xmlNodeGetContent(cur);
- printf("\n :: %s :: \n", _account_list_get_capablity_string_value((char *)key));
- xmlFree(key);
- }
- cur = cur->next;
- }
- return;
-}
-
-static void parseDoc(char *docname)
-{
- xmlDocPtr doc = NULL;
- xmlNodePtr cur = NULL;
- xmlChar *attr = NULL;
- xmlChar *icon_path = NULL;
-
- doc = xmlParseFile(docname);
-
- if (doc == NULL ) {
- fprintf(stderr,"::ERROR::Document not parsed successfully. \n");
- return;
- }
-
- cur = xmlDocGetRootElement(doc);
-
- if (cur == NULL) {
- fprintf(stderr,"::ERROR::empty document.\n");
- xmlFreeDoc(doc);
- return;
- }
-
- if (xmlStrcmp(cur->name, (const xmlChar *) "account")) {
- fprintf(stderr,"::ERROR::document of the wrong type, root node != account.");
- xmlFreeDoc(doc);
- return;
- }
- attr = xmlGetProp(cur, (const xmlChar *)"multiple");
-
- if (attr == NULL)
- printf("\n multiple attribute not set, by default it will be taken as false.\n");
- else if (!strcmp("false", (char *)attr))
- printf("\n :: multiple = %s ::\n",attr);
- else if (!strcmp("true", (char *)attr))
- printf("\n :: multiple = %s :: \n",attr);
- else
- fprintf(stderr,"::ERROR:: Only multiple can be set as false or true. \n");
-
- icon_path = xmlGetProp(cur, (const xmlChar *)"icon_path");
-
- if (icon_path == NULL)
- printf("\n icon path is NULL.\n");
- else
- printf("\n :: icon path = %s ::\n",icon_path);
-
-
- parseCap(doc, cur);
- xmlFreeDoc(doc);
- return;
-}
-
-int main(int argc, char **argv)
-{
- char *docname = NULL;
-
- if (argc <= 1) {
- printf("Usage: %s xml_file_path\n", argv[0]);
- return(0);
- }
- printf("\n #############################################################################\n");
- docname = argv[1];
- parseDoc (docname);
- printf("\n #############################################################################\n");
- return (1);
-}