1 /*************************************************************************/ 2 /* module: Definition of WBXML/XML tags for the en-/decoder */ 3 /* file: XLTTags.h */ 4 /* target system: all */ 5 /* target OS: all */ 6 /*************************************************************************/ 7 8 /* 9 * Copyright Notice 10 * Copyright (c) Ericsson, IBM, Lotus, Matsushita Communication 11 * Industrial Co., Ltd., Motorola, Nokia, Openwave Systems, Inc., 12 * Palm, Inc., Psion, Starfish Software, Symbian, Ltd. (2001). 13 * All Rights Reserved. 14 * Implementation of all or part of any Specification may require 15 * licenses under third party intellectual property rights, 16 * including without limitation, patent rights (such a third party 17 * may or may not be a Supporter). The Sponsors of the Specification 18 * are not responsible and shall not be held responsible in any 19 * manner for identifying or failing to identify any or all such 20 * third party intellectual property rights. 21 * 22 * THIS DOCUMENT AND THE INFORMATION CONTAINED HEREIN ARE PROVIDED 23 * ON AN "AS IS" BASIS WITHOUT WARRANTY OF ANY KIND AND ERICSSON, IBM, 24 * LOTUS, MATSUSHITA COMMUNICATION INDUSTRIAL CO. LTD, MOTOROLA, 25 * NOKIA, PALM INC., PSION, STARFISH SOFTWARE AND ALL OTHER SYNCML 26 * SPONSORS DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING 27 * BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION 28 * HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF 29 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT 30 * SHALL ERICSSON, IBM, LOTUS, MATSUSHITA COMMUNICATION INDUSTRIAL CO., 31 * LTD, MOTOROLA, NOKIA, PALM INC., PSION, STARFISH SOFTWARE OR ANY 32 * OTHER SYNCML SPONSOR BE LIABLE TO ANY PARTY FOR ANY LOSS OF 33 * PROFITS, LOSS OF BUSINESS, LOSS OF USE OF DATA, INTERRUPTION OF 34 * BUSINESS, OR FOR DIRECT, INDIRECT, SPECIAL OR EXEMPLARY, INCIDENTAL, 35 * PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND IN CONNECTION WITH 36 * THIS DOCUMENT OR THE INFORMATION CONTAINED HEREIN, EVEN IF ADVISED 37 * OF THE POSSIBILITY OF SUCH LOSS OR DAMAGE. 38 * 39 * The above notice and this paragraph must be included on all copies 40 * of this document that are made. 41 * 42 */ 43 44 /*************************************************************************/ 45 /* Definitions */ 46 /*************************************************************************/ 47 48 #ifndef _XLT_TAGS_H 49 #define _XLT_TAGS_H 50 51 #include <smldtd.h> 52 #include <smldef.h> 53 54 #define XML_MAX_TAGLEN 35 55 56 #ifdef _cplusplus 57 extern "C" { 58 #endif 59 60 // Tag IDs 61 typedef enum { 62 TN_UNDEF = 0, 63 64 TN_ADD, 65 TN_ALERT, 66 TN_ARCHIVE, 67 TN_ATOMIC, 68 TN_ATOMIC_END, /* 5 */ 69 TN_CHAL, 70 TN_CMD, 71 TN_CMDID, 72 TN_CMDREF, 73 TN_COPY, /* 10 */ 74 TN_CRED, 75 TN_DATA, 76 TN_DELETE, 77 TN_EXEC, 78 TN_FINAL, /* 15 */ 79 TN_GET, 80 TN_ITEM, 81 TN_LANG, 82 TN_LOCNAME, 83 TN_LOCURI, /* 20 */ 84 TN_MAP, 85 TN_MAPITEM, 86 TN_META, 87 TN_MSGID, 88 TN_MSGREF, /* 25 */ 89 TN_NORESP, 90 TN_NORESULTS, 91 TN_PUT, 92 TN_REPLACE, 93 TN_RESPURI, /* 30 */ 94 TN_RESULTS, 95 TN_SEARCH, 96 TN_SEQUENCE, 97 TN_SEQUENCE_END, 98 TN_SESSIONID, /* 35 */ 99 TN_SFTDEL, 100 TN_SOURCE, 101 TN_SOURCEREF, 102 TN_STATUS, 103 TN_SYNC, /* 40 */ 104 TN_SYNCBODY, 105 TN_SYNCHDR, 106 TN_SYNCML, 107 TN_SYNC_END, 108 TN_TARGET, /* 45 */ 109 TN_TARGETREF, 110 TN_VERSION, 111 TN_PROTO, 112 TN_METINF_ANCHOR, 113 TN_METINF_EMI, /* 50 */ 114 TN_METINF_FORMAT, 115 TN_METINF_FREEID, 116 TN_METINF_FREEMEM, 117 TN_METINF_LAST, 118 TN_METINF_MARK, /* 55 */ 119 TN_METINF_MAXMSGSIZE, 120 TN_METINF_MEM, 121 TN_METINF_METINF, 122 TN_METINF_NEXT, 123 TN_METINF_NEXTNONCE, /* 60 */ 124 TN_METINF_SHAREDMEM, 125 TN_METINF_SIZE, 126 TN_METINF_TYPE, 127 TN_METINF_VERSION, 128 TN_DEVINF_CTCAP, /* 65 */ 129 TN_DEVINF_CTTYPE, 130 TN_DEVINF_DATASTORE, 131 TN_DEVINF_DATATYPE, 132 TN_DEVINF_DEVID, 133 TN_DEVINF_DEVINF, /* 70 */ 134 TN_DEVINF_DEVTYP, 135 TN_DEVINF_DISPLAYNAME, 136 TN_DEVINF_DSMEM, 137 TN_DEVINF_EXT, 138 TN_DEVINF_FWV, /* 75 */ 139 TN_DEVINF_HWV, 140 TN_DEVINF_MAN, 141 TN_DEVINF_MAXGUIDSIZE, 142 TN_DEVINF_MAXID, 143 TN_DEVINF_MAXMEM, /* 80 */ 144 TN_DEVINF_MOD, 145 TN_DEVINF_OEM, 146 TN_DEVINF_PARAMNAME, 147 TN_DEVINF_PROPNAME, 148 TN_DEVINF_RX, /* 85 */ 149 TN_DEVINF_RXPREF, 150 TN_DEVINF_SHAREDMEM, 151 TN_DEVINF_SIZE, 152 TN_DEVINF_SOURCEREF, 153 TN_DEVINF_SWV, /* 90 */ 154 TN_DEVINF_SYNCCAP, 155 TN_DEVINF_SYNCTYPE, 156 TN_DEVINF_TX, 157 TN_DEVINF_TXPREF, 158 TN_DEVINF_VALENUM, /* 95 */ 159 TN_DEVINF_VERCT, 160 TN_DEVINF_VERDTD, 161 TN_DEVINF_XNAM, 162 TN_DEVINF_XVAL, 163 /* SCTSTK - 18/03/2002, S.H. 2002-04-05 : SyncML 1.1 */ 164 TN_NUMBEROFCHANGES, /* 100 */ 165 TN_MOREDATA, 166 TN_METINF_MAXOBJSIZE, 167 TN_DEVINF_UTC, 168 TN_DEVINF_NOFM, 169 TN_DEVINF_LARGEOBJECT, 170 TN_CORRELATOR, 171 /* TNDS - 08/05/2008, Ken Chen(e50324) Motorola Inc., OMA-TS-DM_TND-V1_2_1-20080617-A */ 172 TN_DMTND_AccessType, /* 107 */ 173 TN_DMTND_ACL, 174 TN_DMTND_Add, 175 TN_DMTND_b64, /* 110 */ 176 TN_DMTND_bin, 177 TN_DMTND_bool, 178 TN_DMTND_chr, 179 TN_DMTND_CaseSense, 180 TN_DMTND_CIS, 181 TN_DMTND_Copy, 182 TN_DMTND_CS, 183 TN_DMTND_date, 184 TN_DMTND_DDFName, 185 TN_DMTND_DefaultValue, /* 120 */ 186 TN_DMTND_Delete, 187 TN_DMTND_Description, 188 TN_DMTND_DFFormat, 189 TN_DMTND_DFProperties, 190 TN_DMTND_DFTitle, 191 TN_DMTND_DFType, 192 TN_DMTND_Dynamic, 193 TN_DMTND_Exec, 194 TN_DMTND_float, 195 TN_DMTND_Format, /* 130 */ 196 TN_DMTND_Get, 197 TN_DMTND_int, 198 TN_DMTND_Man, 199 TN_DMTND_MgmtTree, 200 TN_DMTND_MIME, 201 TN_DMTND_Mod, 202 TN_DMTND_Name, 203 TN_DMTND_Node, 204 TN_DMTND_node, 205 TN_DMTND_NodeName, /* 140 */ 206 TN_DMTND_null, 207 TN_DMTND_Occurrence, 208 TN_DMTND_One, 209 TN_DMTND_OneOrMore, 210 TN_DMTND_OneOrN, 211 TN_DMTND_Path, 212 TN_DMTND_Permanent, 213 TN_DMTND_Replace, 214 TN_DMTND_RTProperties, 215 TN_DMTND_Scope, /* 150 */ 216 TN_DMTND_Size, 217 TN_DMTND_time, 218 TN_DMTND_Title, 219 TN_DMTND_TStamp, 220 TN_DMTND_Type, 221 TN_DMTND_Value, 222 TN_DMTND_VerDTD, 223 TN_DMTND_VerNo, 224 TN_DMTND_xml, 225 TN_DMTND_ZeroOrMore, /* 160 */ 226 TN_DMTND_ZeroOrN, 227 TN_DMTND_ZeroOrOne 228 } XltTagID_t; 229 230 231 extern const char * const SyncMLNamespaces[SML_NUM_VERS]; 232 233 typedef struct Dtd_s 234 { 235 String_t name; 236 SmlPcdataExtension_t ext; 237 } Dtd_t, *DtdPtr_t; 238 239 240 /** 241 * FUNCTION: getTagString 242 * 243 * Returns a tag string which belongs to a tag ID. 244 * This function is needed for the XML encoding 245 * 246 * PRE-Condition: valid tag ID, the tagSring has to be allocated 247 * 248 * POST-Condition: tag string is returned 249 * 250 * IN: tagId, the ID for the tag 251 * 252 * IN/OUT: tagString, allocated string into which the XML 253 * tag string will be written 254 * 255 * RETURN: 0, if OK 256 */ 257 Ret_t getTagString(XltTagID_t tagID, String_t tagString, SmlPcdataExtension_t ext); 258 259 #ifdef __SML_WBXML__ 260 /** 261 * FUNCTION: getTagByte 262 * 263 * Returns a WBXML byte which belongs to a tag ID in a defined codepage. 264 * This function is needed for the WBXML encoding 265 * 266 * PRE-Condition: valid tag ID, valid code page 267 * 268 * POST-Condition: tag byte is returned 269 * 270 * IN: tagId, the ID for the tag 271 * cp, code page group for the tag 272 * tagByte, the byte representation of the tag 273 * 274 * RETURN: 0, if OK 275 */ 276 Ret_t getTagByte(XltTagID_t tagID, SmlPcdataExtension_t ext, Byte_t *tagByte); 277 #endif 278 279 /** 280 * FUNCTION: getCodePage 281 * 282 * Returns the code page which belongs to a certain PCDATA extension type. 283 * 284 * PRE-Condition: valid PCDATA extension type 285 * 286 * POST-Condition: the code page is returned 287 * 288 * IN: ext, the PCDATA extension type 289 * 290 * RETURN: the code page 291 */ 292 Byte_t getCodePage(SmlPcdataExtension_t ext); 293 294 /** 295 * FUNCTION: getTagIDByStringAndCodepage 296 * 297 * Returns the tag ID which belongs to a tag string in a certain codepage 298 * 299 * PRE-Condition: valid tag string, valid code page 300 * 301 * POST-Condition: tag id is returned 302 * 303 * IN: tag, the string representation of the tag 304 * cp, code page group for the tag 305 * pTagID, the tag id of the tag 306 * 307 * RETURN: 0, if OK 308 */ 309 Ret_t getTagIDByStringAndExt(String_t tag, SmlPcdataExtension_t ext, XltTagID_t *pTagID); 310 311 #ifdef __SML_WBXML__ 312 /** 313 * FUNCTION: getTagIDByByteAndCodepage 314 * 315 * Returns the tag ID which belongs to a tag byte in a certain codepage 316 * 317 * PRE-Condition: valid tag byte, valid code page 318 * 319 * POST-Condition: tag id is returned 320 * 321 * IN: tag, the byte representation of the tag 322 * cp, code page group for the tag 323 * pTagID, the tag id of the tag 324 * 325 * RETURN: 0, if OK 326 */ 327 Ret_t getTagIDByByteAndExt(Byte_t tag, SmlPcdataExtension_t ext, XltTagID_t *pTagID); 328 #endif 329 330 331 #ifdef __SML_XML__ 332 /** 333 * FUNCTION: getTagIDByStringAndNamespace 334 * 335 * Returns the tag ID which belongs to a tag string in a certain namespace 336 * 337 * PRE-Condition: valid tag string, valid namespace 338 * 339 * POST-Condition: tag id is returned 340 * 341 * IN: tag, the string representation of the tag 342 * ns, namespace group for the tag 343 * pTagID, the tag id of the tag 344 * 345 * RETURN: 0, if OK 346 */ 347 Ret_t getTagIDByStringAndNamespace(String_t tag, String_t ns, XltTagID_t *pTagID); 348 #endif 349 350 /** 351 * FUNCTION: getCodePageById 352 * 353 * Returns the codepage which belongs to a certain tag ID 354 * 355 * PRE-Condition: valid tag ID 356 * 357 * POST-Condition: the code page is returned 358 * 359 * IN: tagID, the ID of the tag 360 * pCp, the codepage of the tag 361 * 362 * RETURN: 0, if OK 363 */ 364 Ret_t getExtById(XltTagID_t tagID, SmlPcdataExtension_t *pExt); 365 366 // %%% luz:2003-07-31: added vers parameter 367 Ret_t getExtName(SmlPcdataExtension_t ext, String_t *name, SmlVersion_t vers); 368 Ret_t getTagIDByStringAndExt(String_t tag, SmlPcdataExtension_t ext, XltTagID_t *pTagID); 369 SmlPcdataExtension_t getExtByName(String_t ns); 370 371 372 #ifdef _cplusplus 373 } 374 #endif 375 376 #endif 377