00001 /* 00002 * WBXML Lib, the WBXML Library. 00003 * Copyright (C) 2002-2003 Aymerick Jéhanne 00004 * 00005 * This library is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU Lesser General Public 00007 * License (version 2.1) as published by the Free Software Foundation. 00008 * 00009 * This library is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 * Lesser General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Lesser General Public 00015 * License along with this library; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 * 00018 * LGPL v2.1: http://www.gnu.org/licenses/lgpl.txt 00019 * 00020 * Author Contact: libwbxml@jehanne.org 00021 * WBXML Lib home: http://libwbxml.jehanne.org 00022 */ 00023 00034 #ifndef WBXML_ELT_H 00035 #define WBXML_ELT_H 00036 00037 00038 #ifdef __cplusplus 00039 extern "C" { 00040 #endif /* __cplusplus */ 00041 00049 typedef enum WBXMLValueType_e { 00050 WBXML_VALUE_TOKEN = 0, 00051 WBXML_VALUE_LITERAL 00052 } WBXMLValueType; 00053 00054 00056 typedef struct WBXMLTag_s { 00057 WBXMLValueType type; 00058 union { 00059 const WBXMLTagEntry *token; 00060 WBXMLBuffer *literal; 00061 } u; 00062 } WBXMLTag; 00063 00064 00066 typedef struct WBXMLAttributeName_s { 00067 WBXMLValueType type; 00068 union { 00069 const WBXMLAttrEntry *token; 00070 WBXMLBuffer *literal; 00071 } u; 00072 } WBXMLAttributeName; 00073 00074 00090 typedef struct WBXMLAttribute_s { 00091 WBXMLAttributeName *name; 00092 WBXMLBuffer *value; 00093 } WBXMLAttribute; 00094 00095 00096 /**************************************************** 00097 * WBXML Elt Functions 00098 */ 00099 00100 /* WBXMLTag */ 00101 00107 WBXML_DECLARE(WBXMLTag *) wbxml_tag_create(WBXMLValueType type); 00108 00114 WBXML_DECLARE(WBXMLTag *) wbxml_tag_create_token(const WBXMLTagEntry *value); 00115 00121 WBXML_DECLARE(WBXMLTag *) wbxml_tag_create_literal(WB_UTINY *value); 00122 00127 WBXML_DECLARE(void) wbxml_tag_destroy(WBXMLTag *tag); 00128 00134 WBXML_DECLARE(WBXMLTag *) wbxml_tag_duplicate(WBXMLTag *tag); 00135 00141 WBXML_DECLARE(const WB_UTINY *) wbxml_tag_get_xml_name(WBXMLTag *tag); 00142 00143 00144 /* WBXMLAttributeName */ 00145 00151 WBXML_DECLARE(WBXMLAttributeName *) wbxml_attribute_name_create(WBXMLValueType type); 00152 00158 WBXML_DECLARE(WBXMLAttributeName *) wbxml_attribute_name_create_token(const WBXMLAttrEntry *value); 00159 00165 WBXML_DECLARE(WBXMLAttributeName *) wbxml_attribute_name_create_literal(WB_UTINY *value); 00166 00171 WBXML_DECLARE(void) wbxml_attribute_name_destroy(WBXMLAttributeName *name); 00172 00178 WBXML_DECLARE(WBXMLAttributeName *) wbxml_attribute_name_duplicate(WBXMLAttributeName *name); 00179 00185 WBXML_DECLARE(const WB_UTINY *) wbxml_attribute_name_get_xml_name(WBXMLAttributeName *name); 00186 00187 00188 /* WBXMLTAttribute */ 00189 00194 WBXML_DECLARE(WBXMLAttribute *) wbxml_attribute_create(void); 00195 00200 WBXML_DECLARE(void) wbxml_attribute_destroy(WBXMLAttribute *attr); 00201 00207 WBXML_DECLARE(WBXMLAttribute *) wbxml_attribute_duplicate(WBXMLAttribute *attr); 00208 00214 WBXML_DECLARE(const WB_UTINY *) wbxml_attribute_get_xml_name(WBXMLAttribute *attr); 00215 00221 WBXML_DECLARE(const WB_UTINY *) wbxml_attribute_get_xml_value(WBXMLAttribute *attr); 00222 00223 00226 #ifdef __cplusplus 00227 } 00228 #endif /* __cplusplus */ 00229 00230 #endif /* WBXML_ELT_H */