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

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.

********************************************************************/
/*************************************************************************/
/* module:          SyncML API for freeing SyncML C structures           */
/*                                                                       */   
/* file:            mgrutil.h                                            */
/* target system:   all                                                  */
/* target OS:       all                                                  */   
/*                                                                       */   
/* Description:                                                          */   
/* Definitions for internal use within the SyncML implementation         */
/*************************************************************************/


#ifndef _MGR_UTIL_H
  #define _MGR_UTIL_H


/* Prototypes of exported SyncML API functions */
SML_API_DEF Ret_t smlFreeProtoElement(VoidPtr_t pProtoElement);
SML_API_DEF void smlFreePcdata(SmlPcdataPtr_t pPcdata);
SML_API_DEF void smlFreePcdataList(SmlPcdataListPtr_t list);

SML_API_DEF void smlFreeSyncHdr(SmlSyncHdrPtr_t pSyncHdr);
SML_API_DEF void smlFreeSync(SmlSyncPtr_t pSync);
SML_API_DEF void smlFreeGeneric(SmlGenericCmdPtr_t pGenericCmd);
SML_API_DEF void smlFreeAlert(SmlAlertPtr_t pAlert);
SML_API_DEF void smlFreeAtomic(SmlAtomicPtr_t pAtomic);
#if (defined EXEC_SEND || defined EXEC_RECEIVE)
  SML_API_DEF void smlFreeExec(SmlExecPtr_t pExec);
#endif
SML_API_DEF void smlFreeGetPut(SmlPutPtr_t pGetPut);
SML_API_DEF void smlFreeMap(SmlMapPtr_t pMap);
SML_API_DEF void smlFreeResults(SmlResultsPtr_t pResults);
#if (defined SEARCH_SEND || defined SEARCH_RECEIVE)
  SML_API_DEF void smlFreeSearch(SmlSearchPtr_t pSearch);
#endif
SML_API_DEF void smlFreeStatus(SmlStatusPtr_t pStatus);
SML_API_DEF void smlFreeCredPtr(SmlCredPtr_t pCred);
SML_API_DEF void smlFreeChalPtr(SmlChalPtr_t pChal);
SML_API_DEF void smlFreeSourceTargetPtr(SmlSourcePtr_t pSourceTarget);
SML_API_DEF void smlFreeSourceList(SmlSourceListPtr_t pSourceList);
SML_API_DEF void smlFreeSourceRefList(SmlSourceRefListPtr_t pSourceRefList);
SML_API_DEF void smlFreeTargetRefList(SmlTargetRefListPtr_t pTargetRefList);
SML_API_DEF void smlFreeItemPtr(SmlItemPtr_t pItem);
SML_API_DEF void smlFreeItemList(SmlItemListPtr_t pItemList);
SML_API_DEF void smlFreeMapItemPtr(SmlMapItemPtr_t pMapItem);
SML_API_DEF void smlFreeMapItemList(SmlMapItemListPtr_t pMapItemList);

#ifdef __USE_METINF__
SML_API_DEF void smlFreeMetinfAnchor(SmlMetInfAnchorPtr_t data);
SML_API_DEF void smlFreeMetinfMem(SmlMetInfMemPtr_t data);
SML_API_DEF void smlFreeMetinfMetinf(SmlMetInfMetInfPtr_t data);
#endif
#ifdef __USE_DEVINF__
SML_API_DEF void smlFreeDevInfDatastore(SmlDevInfDatastorePtr_t data);
SML_API_DEF void smlFreeDevInfDatastoreList(SmlDevInfDatastoreListPtr_t data);
SML_API_DEF void smlFreeDevInfXmitList(SmlDevInfXmitListPtr_t data);
SML_API_DEF void smlFreeDevInfXmit(SmlDevInfXmitPtr_t data);
SML_API_DEF void smlFreeDevInfDSMem(SmlDevInfDSMemPtr_t data);
SML_API_DEF void smlFreeDevInfSynccap(SmlDevInfSyncCapPtr_t data);
SML_API_DEF void smlFreeDevInfExt(SmlDevInfExtPtr_t data);
SML_API_DEF void smlFreeDevInfExtList(SmlDevInfExtListPtr_t data);
SML_API_DEF void smlFreeDevInfCTData(SmlDevInfCTDataPtr_t data);
SML_API_DEF void smlFreeDevInfCTDataList(SmlDevInfCTDataListPtr_t data);
SML_API_DEF void smlFreeDevInfCTDataProp(SmlDevInfCTDataPropPtr_t data);
SML_API_DEF void smlFreeDevInfCTDataPropList(SmlDevInfCTDataPropListPtr_t data);
SML_API_DEF void smlFreeDevInfCTCap(SmlDevInfCTCapPtr_t data);
SML_API_DEF void smlFreeDevInfCtcapList(SmlDevInfCtcapListPtr_t data);
SML_API_DEF void smlFreeDevInfDevInf(SmlDevInfDevInfPtr_t data);
#endif
#ifndef __SML_LITE__  /* these API calls are NOT included in the Toolkit lite version */
SML_API_DEF String_t smlPcdata2String( SmlPcdataPtr_t pcdata );
SML_API_DEF SmlPcdataPtr_t smlString2Pcdata( String_t str );
SML_API_DEF SmlPcdataPtr_t smlPcdataDup(SmlPcdataPtr_t pcdata); 
SML_API_DEF MemSize_t smlGetFreeBuffer(InstanceID_t id);
#endif

#ifdef __USE_ALLOCFUNCS__
SML_API_DEF SmlPcdataPtr_t smlAllocPcdata();
SML_API_DEF SmlPcdataListPtr_t smlAllocPcdataList();
SML_API_DEF SmlChalPtr_t smlAllocChal();
SML_API_DEF SmlCredPtr_t smlAllocCred();
SML_API_DEF SmlSourcePtr_t smlAllocSource();
SML_API_DEF SmlTargetPtr_t smlAllocTarget();
SML_API_DEF SmlSourceListPtr_t smlAllocSourceList();
SML_API_DEF SmlSyncHdrPtr_t smlAllocSyncHdr();
SML_API_DEF SmlItemPtr_t smlAllocItem();
SML_API_DEF SmlItemListPtr_t smlAllocItemList();
SML_API_DEF SmlGenericCmdPtr_t smlAllocGeneric();
SML_API_DEF SmlAddPtr_t smlAllocAdd();
SML_API_DEF SmlCopyPtr_t smlAllocCopy();
SML_API_DEF SmlReplacePtr_t smlAllocReplace();
SML_API_DEF SmlDeletePtr_t smlAllocDelete();
SML_API_DEF SmlAlertPtr_t smlAllocAlert();
SML_API_DEF SmlAtomicPtr_t smlAllocAtomic();
SML_API_DEF SmlSequencePtr_t smlAllocSequence();
SML_API_DEF SmlSyncPtr_t smlAllocSync();
SML_API_DEF SmlExecPtr_t smlAllocExec();
SML_API_DEF SmlGetPtr_t smlAllocGet();
SML_API_DEF SmlPutPtr_t smlAllocPut();
SML_API_DEF SmlMapItemPtr_t smlAllocMapItem();
SML_API_DEF SmlMapItemListPtr_t smlAllocMapItemList();
SML_API_DEF SmlMapPtr_t smlAllocMap();
SML_API_DEF SmlResultsPtr_t smlAllocResults();
SML_API_DEF SmlSearchPtr_t smlAllocSearch();
SML_API_DEF SmlTargetRefListPtr_t smlAllocTargetRefList();
SML_API_DEF SmlSourceRefListPtr_t smlAllocSourceRefList();
SML_API_DEF SmlStatusPtr_t smlAllocStatus();
SML_API_DEF SmlUnknownProtoElementPtr_t smlAllocUnknownProtoElement();
#ifdef __USE_METINF__
SML_API_DEF SmlMetInfMetInfPtr_t smlAllocMetInfMetInf();
SML_API_DEF SmlMetInfAnchorPtr_t smlAllocMetInfAnchor();
SML_API_DEF SmlMetInfMemPtr_t smlAllocMetInfMem();
#endif // MetInf

#ifdef __USE_DEVINF__
SML_API_DEF SmlDevInfExtPtr_t smlAllocDevInfExt();
SML_API_DEF SmlDevInfExtListPtr_t smlAllocDevInfExtList();
SML_API_DEF SmlDevInfSyncCapPtr_t smlAllocDevInfSyncCap();
SML_API_DEF SmlDevInfCTDataPtr_t smlAllocDevInfCTData();
SML_API_DEF SmlDevInfCTDataListPtr_t smlAllocDevInfCTDataList();
SML_API_DEF SmlDevInfCTDataPropPtr_t smlAllocDevInfCTDataProp();
SML_API_DEF SmlDevInfCTDataPropListPtr_t smlAllocDevInfCTDataPropList();
SML_API_DEF SmlDevInfCTCapPtr_t smlAllocDevInfCTCap();
SML_API_DEF SmlDevInfCtcapListPtr_t smlAllocDevInfCtcapList();
SML_API_DEF SmlDevInfDSMemPtr_t smlAllocDevInfDSMem();
SML_API_DEF SmlDevInfXmitPtr_t smlAllocDevInfXmit();
SML_API_DEF SmlDevInfXmitListPtr_t smlAllocDevInfXmitList();
SML_API_DEF SmlDevInfDatastorePtr_t smlAllocDevInfDatastore();
SML_API_DEF SmlDevInfDatastoreListPtr_t smlAllocDevInfDatastoreList();
SML_API_DEF SmlDevInfDevInfPtr_t smlAllocDevInfDevInf();
#endif // DevInf
#endif // AllocFuncs
#endif // MgrUtil.h