Network Developers Kit API  3.61.00.09
configif.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012-2018, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  * */
32 /*
33  * ======== configif.h ========
34  *
35  * Configuration Manager Interface functions
36  *
37  */
49 #ifndef _CONFIGIF_H
50 #define _CONFIGIF_H
51 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 
71 extern void *CfgNew();
72 
84 extern void CfgFree( void *hCfg );
85 
103 extern void CfgSetDefault( void *hCfg );
104 
120 extern void *CfgGetDefault();
121 
151 extern int CfgLoad( void *hCfg, int Size, unsigned char *pData );
152 
193 extern int CfgSave( void *hCfg, int *pSize, unsigned char *pData );
194 
229 extern int CfgSetExecuteOrder( void *hCfg, uint32_t Tags,
230  uint32_t *pOpenOrder, uint32_t *pCloseOrder );
231 
259 extern int CfgExecute( void *hCfg, uint32_t fExecute );
260 
309 extern int CfgSetService( void *hCfg, uint32_t Tag,
310  int (*pCb) (void *, uint32_t, uint32_t, uint32_t,
311  void *) );
312 
313 #define CFGOP_REMOVE 0
314 #define CFGOP_ADD 1
420 extern int CfgAddEntry( void *hCfg, uint32_t Tag, uint32_t Item,
421  uint32_t Mode, int Size, unsigned char *pData,
422  void **phCfgEntry );
423 
424 /* Add Entry Flags */
425 #define CFG_ADDMODE_UNIQUE 0x0001
426 #define CFG_ADDMODE_DUPLICATE 0x0002
427 #define CFG_ADDMODE_NOSAVE 0x0004
457 extern int CfgRemoveEntry( void *hCfg, void *hCfgEntry );
458 
475 extern int CfgGetEntryCnt( void *hCfg, uint32_t Tag, uint32_t Item );
476 
530 extern int CfgGetEntry( void *hCfg, uint32_t Tag, uint32_t Item,
531  uint32_t Index, void **phCfgEntry );
532 
576 extern int CfgGetNextEntry( void *hCfg, void *hCfgEntry,
577  void **phCfgEntryNext );
578 
617 extern int CfgGetImmediate( void *hCfg, uint32_t Tag, uint32_t Item,
618  uint32_t Index, int Size, unsigned char *pData );
619 
648 extern int CfgEntryRef( void *hCfgEntry );
649 
664 extern int CfgEntryDeRef( void *hCfgEntry );
665 
694 extern int CfgEntryGetData( void *hCfgEntry, int *pSize, unsigned char *pData );
695 
726 extern int CfgEntrySetData( void *hCfgEntry, int Size, unsigned char *pData );
727 
758 extern int CfgEntryInfo( void *hCfgEntry, int *pSize, unsigned char **ppData );
759 
769 #define CFGERROR_BADHANDLE -1
770 #define CFGERROR_BADPARAM -2
771 #define CFGERROR_RESOURCES -3
772 #define CFGERROR_REFERROR -4
773 #define CFGERROR_ALREADY -5
774 #define CFGERROR_SERVICE -100
776 #define CFG_MAKE_CFGERROR(x) ((x)+CFGERROR_SERVICE)
777 
788 #define CFG_GET_SERVICE_ERROR(x) ((x)-CFGERROR_SERVICE)
789 #define CFG_IS_SERVICE_ERROR(x) ((x)<=CFGERROR_SERVICE)
790 
792 #ifdef __cplusplus
793 }
794 #endif /* extern "C" */
795 
796 #endif
void * CfgGetDefault()
Get default configuration handle.
int CfgEntryInfo(void *hCfgEntry, int *pSize, unsigned char **ppData)
Get information on a configuration entry.
int CfgEntryRef(void *hCfgEntry)
Add a reference to a configuration entry handle.
int CfgExecute(void *hCfg, uint32_t fExecute)
Set the execution state (active/inactive) of the config.
int CfgGetImmediate(void *hCfg, uint32_t Tag, uint32_t Item, uint32_t Index, int Size, unsigned char *pData)
Get config entry data.
int CfgSave(void *hCfg, int *pSize, unsigned char *pData)
Save a config to a linear memory block.
int CfgEntrySetData(void *hCfgEntry, int Size, unsigned char *pData)
Set/reset configuration entry data.
int CfgEntryGetData(void *hCfgEntry, int *pSize, unsigned char *pData)
Get configuration entry data.
int CfgEntryDeRef(void *hCfgEntry)
Remove a reference to a config entry handle.
int CfgGetNextEntry(void *hCfg, void *hCfgEntry, void **phCfgEntryNext)
Get the next entry instance matching the supplied entry handle.
int CfgGetEntryCnt(void *hCfg, uint32_t Tag, uint32_t Item)
Get the number of entry instances for a Tag/Item pair.
int CfgSetService(void *hCfg, uint32_t Tag, int(*pCb)(void *, uint32_t, uint32_t, uint32_t, void *))
Set service callback for configuration Tag.
int CfgSetExecuteOrder(void *hCfg, uint32_t Tags, uint32_t *pOpenOrder, uint32_t *pCloseOrder)
Set the Tag initialization and shutdown order on execute.
int CfgLoad(void *hCfg, int Size, unsigned char *pData)
Load a config from a linear memory block.
void * CfgNew()
Create a new configuration.
void CfgFree(void *hCfg)
Destroy a new configuration.
void CfgSetDefault(void *hCfg)
Set default configuration handle.
int CfgGetEntry(void *hCfg, uint32_t Tag, uint32_t Item, uint32_t Index, void **phCfgEntry)
Get configuration entry from configuration.
© Copyright 1995-2019, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale