/*******************************************************************

Copyright (c) 2004 Open Mobile Alliance, Ltd.  All Rights Reserved.

This software is made available under the usage and distribution terms 
covered by the Common Public License 1.0 and by using this software you
are bound by the terms and conditions of the same.

EXCEPT AS EXPRESSLY SET FORTH IN THE COMMON PUBLIC LICENSE,
THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, 
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 
EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, 
ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, 
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
   
Each recipient is solely responsible for determining the 
appropriateness of using and distributing this program and assumes 
all risks associated with its exercise of rights under the Common 
Public License, including but not limited to the risks and 
costs of program errors, compliance with applicable laws, 
damage to or loss of data, programs or equipment, and 
unavailability or interruption of operations.

********************************************************************/
#ifndef _XLT_TAGTBL_H
#define _XLT_TAGTBL_H


/*************************************************************************/
/*  Definitions                                                          */
/*************************************************************************/

#include "xlttags.h"
#include "xltdec.h"
#include "xltdeccom.h"

typedef struct Tag_s
{
    XltTagID_t  id;
    Byte_t      wbxml;
    String_t    xml;
} Tag_t, *TagPtr_t;

/**
 * FUNCTION: buildXXX
 *
 * These functions each decode one single SyncML element starting at the
 * current position within the SyncML document. Child elements are build
 * recursively.
 * The functions check that the pointer to the memory structures are
 * NULL when called and return an error otherwise. This will only happen
 * when a SyncML element contains several child elements of the same type
 * for which this is not allowed according to the SyncML DTD; e.g. a
 * SyncHdr with two or more MsgID tags. Items and other list types
 * are handled separately by the appendXXXList functions (see below).
 *
 * PRE-Condition:
 *                 ppElem is NULL
 *                 The scanner's current token is the start tag (may be
 *                 empty) of the SyncML element to be decoded.
 *
 * POST-Condition:
 *                 The scanner's current token is the end tag (or empty
 *                 start tag) of the SyncML element to be decoded.
 */
/* implemented in xltdec.c! */
Ret_t buildAlert(XltDecoderPtr_t pDecoder, VoidPtr_t *ppElem);
#if (defined ATOMIC_RECEIVE || defined SEQUENCE_RECEIVE)
Ret_t buildAtomOrSeq(XltDecoderPtr_t pDecoder, VoidPtr_t *ppElem);
#endif
Ret_t buildChal(XltDecoderPtr_t pDecoder, VoidPtr_t *ppElem);
Ret_t buildCred(XltDecoderPtr_t pDecoder, VoidPtr_t *ppElem);
Ret_t buildDelete(XltDecoderPtr_t pDecoder, VoidPtr_t *ppElem);
Ret_t buildExec(XltDecoderPtr_t pDecoder, VoidPtr_t *ppElem);
Ret_t buildGenericCmd(XltDecoderPtr_t pDecoder, VoidPtr_t *ppElem);
Ret_t buildItem(XltDecoderPtr_t pDecoder, VoidPtr_t *ppElem);
Ret_t buildMap(XltDecoderPtr_t pDecoder, VoidPtr_t *ppElem);
Ret_t buildMapItem(XltDecoderPtr_t pDecoder, VoidPtr_t *ppElem);
Ret_t buildPCData(XltDecoderPtr_t pDecoder, VoidPtr_t *ppElem);
Ret_t buildPCDataList(XltDecoderPtr_t pDecoder, VoidPtr_t *ppPCData);
Ret_t buildPutOrGet(XltDecoderPtr_t pDecoder, VoidPtr_t *ppElem);
Ret_t buildResults(XltDecoderPtr_t pDecoder, VoidPtr_t *ppElem);
#ifdef SEARCH_RECEIVE
Ret_t buildSearch(XltDecoderPtr_t pDecoder, VoidPtr_t *ppElem);
#endif
Ret_t buildStatus(XltDecoderPtr_t pDecoder, VoidPtr_t *ppElem);
Ret_t buildSync(XltDecoderPtr_t pDecoder, VoidPtr_t *ppElem);
Ret_t buildSyncHdr(XltDecoderPtr_t pDecoder, VoidPtr_t *ppElem);
Ret_t buildTargetOrSource(XltDecoderPtr_t pDecoder, VoidPtr_t *ppElem);

TagPtr_t getTagTable(SmlPcdataExtension_t cp);

#endif	  /* _XLT_TAGTBL_H */

