| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
#ifndef ___VBox_cfgm_h |
|---|
| 31 |
#define ___VBox_cfgm_h |
|---|
| 32 |
|
|---|
| 33 |
#include <VBox/cdefs.h> |
|---|
| 34 |
#include <VBox/types.h> |
|---|
| 35 |
#include <iprt/stdarg.h> |
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 |
|
|---|
| 40 |
|
|---|
| 41 |
|
|---|
| 42 |
typedef struct CFGMNODE *PCFGMNODE; |
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 |
typedef struct CFGMLEAF *PCFGMLEAF; |
|---|
| 46 |
|
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| 49 |
|
|---|
| 50 |
typedef enum CFGMVALUETYPE |
|---|
| 51 |
{ |
|---|
| 52 |
|
|---|
| 53 |
CFGMVALUETYPE_INTEGER = 1, |
|---|
| 54 |
|
|---|
| 55 |
CFGMVALUETYPE_STRING, |
|---|
| 56 |
|
|---|
| 57 |
CFGMVALUETYPE_BYTES |
|---|
| 58 |
} CFGMVALUETYPE; |
|---|
| 59 |
|
|---|
| 60 |
typedef CFGMVALUETYPE *PCFGMVALUETYPE; |
|---|
| 61 |
|
|---|
| 62 |
|
|---|
| 63 |
|
|---|
| 64 |
__BEGIN_DECLS |
|---|
| 65 |
|
|---|
| 66 |
#ifdef IN_RING3 |
|---|
| 67 |
|
|---|
| 68 |
|
|---|
| 69 |
|
|---|
| 70 |
|
|---|
| 71 |
|
|---|
| 72 |
typedef enum CFGMCONFIGTYPE |
|---|
| 73 |
{ |
|---|
| 74 |
|
|---|
| 75 |
CFGMCONFIGTYPE_NONE = 0, |
|---|
| 76 |
|
|---|
| 77 |
CFGMCONFIGTYPE_IMACHINE |
|---|
| 78 |
} CFGMCONFIGTYPE; |
|---|
| 79 |
|
|---|
| 80 |
|
|---|
| 81 |
|
|---|
| 82 |
|
|---|
| 83 |
|
|---|
| 84 |
|
|---|
| 85 |
|
|---|
| 86 |
|
|---|
| 87 |
|
|---|
| 88 |
|
|---|
| 89 |
|
|---|
| 90 |
|
|---|
| 91 |
typedef DECLCALLBACK(int) FNCFGMCONSTRUCTOR(PVM pVM, void *pvUser); |
|---|
| 92 |
|
|---|
| 93 |
typedef FNCFGMCONSTRUCTOR *PFNCFGMCONSTRUCTOR; |
|---|
| 94 |
|
|---|
| 95 |
VMMR3DECL(int) CFGMR3Init(PVM pVM, PFNCFGMCONSTRUCTOR pfnCFGMConstructor, void *pvUser); |
|---|
| 96 |
VMMR3DECL(int) CFGMR3Term(PVM pVM); |
|---|
| 97 |
|
|---|
| 98 |
|
|---|
| 99 |
VMMR3DECL(PCFGMNODE) CFGMR3CreateTree(PVM pVM); |
|---|
| 100 |
VMMR3DECL(void) CFGMR3Dump(PCFGMNODE pRoot); |
|---|
| 101 |
VMMR3DECL(int) CFGMR3InsertSubTree(PCFGMNODE pNode, const char *pszName, PCFGMNODE pSubTree, PCFGMNODE *ppChild); |
|---|
| 102 |
VMMR3DECL(int) CFGMR3InsertNode(PCFGMNODE pNode, const char *pszName, PCFGMNODE *ppChild); |
|---|
| 103 |
VMMR3DECL(int) CFGMR3InsertNodeF(PCFGMNODE pNode, PCFGMNODE *ppChild, const char *pszNameFormat, ...); |
|---|
| 104 |
VMMR3DECL(int) CFGMR3InsertNodeFV(PCFGMNODE pNode, PCFGMNODE *ppChild, const char *pszNameFormat, va_list Args); |
|---|
| 105 |
VMMR3DECL(void) CFGMR3SetRestrictedRoot(PCFGMNODE pNode); |
|---|
| 106 |
VMMR3DECL(void) CFGMR3RemoveNode(PCFGMNODE pNode); |
|---|
| 107 |
VMMR3DECL(int) CFGMR3InsertInteger(PCFGMNODE pNode, const char *pszName, uint64_t u64Integer); |
|---|
| 108 |
VMMR3DECL(int) CFGMR3InsertString(PCFGMNODE pNode, const char *pszName, const char *pszString); |
|---|
| 109 |
VMMR3DECL(int) CFGMR3InsertBytes(PCFGMNODE pNode, const char *pszName, const void *pvBytes, size_t cbBytes); |
|---|
| 110 |
VMMR3DECL(int) CFGMR3RemoveValue(PCFGMNODE pNode, const char *pszName); |
|---|
| 111 |
|
|---|
| 112 |
VMMR3DECL(int) CFGMR3QueryType( PCFGMNODE pNode, const char *pszName, PCFGMVALUETYPE penmType); |
|---|
| 113 |
VMMR3DECL(int) CFGMR3QuerySize( PCFGMNODE pNode, const char *pszName, size_t *pcb); |
|---|
| 114 |
VMMR3DECL(int) CFGMR3QueryInteger( PCFGMNODE pNode, const char *pszName, uint64_t *pu64); |
|---|
| 115 |
VMMR3DECL(int) CFGMR3QueryIntegerDef( PCFGMNODE pNode, const char *pszName, uint64_t *pu64, uint64_t u64Def); |
|---|
| 116 |
VMMR3DECL(int) CFGMR3QueryString( PCFGMNODE pNode, const char *pszName, char *pszString, size_t cchString); |
|---|
| 117 |
VMMR3DECL(int) CFGMR3QueryStringDef( PCFGMNODE pNode, const char *pszName, char *pszString, size_t cchString, const char *pszDef); |
|---|
| 118 |
VMMR3DECL(int) CFGMR3QueryBytes( PCFGMNODE pNode, const char *pszName, void *pvData, size_t cbData); |
|---|
| 119 |
|
|---|
| 120 |
|
|---|
| 121 |
|
|---|
| 122 |
|
|---|
| 123 |
|
|---|
| 124 |
VMMR3DECL(int) CFGMR3QueryU64( PCFGMNODE pNode, const char *pszName, uint64_t *pu64); |
|---|
| 125 |
VMMR3DECL(int) CFGMR3QueryU64Def( PCFGMNODE pNode, const char *pszName, uint64_t *pu64, uint64_t u64Def); |
|---|
| 126 |
VMMR3DECL(int) CFGMR3QueryS64( PCFGMNODE pNode, const char *pszName, int64_t *pi64); |
|---|
| 127 |
VMMR3DECL(int) CFGMR3QueryS64Def( PCFGMNODE pNode, const char *pszName, int64_t *pi64, int64_t i64Def); |
|---|
| 128 |
VMMR3DECL(int) CFGMR3QueryU32( PCFGMNODE pNode, const char *pszName, uint32_t *pu32); |
|---|
| 129 |
VMMR3DECL(int) CFGMR3QueryU32Def( PCFGMNODE pNode, const char *pszName, uint32_t *pu32, uint32_t u32Def); |
|---|
| 130 |
VMMR3DECL(int) CFGMR3QueryS32( PCFGMNODE pNode, const char *pszName, int32_t *pi32); |
|---|
| 131 |
VMMR3DECL(int) CFGMR3QueryS32Def( PCFGMNODE pNode, const char *pszName, int32_t *pi32, int32_t i32Def); |
|---|
| 132 |
VMMR3DECL(int) CFGMR3QueryU16( PCFGMNODE pNode, const char *pszName, uint16_t *pu16); |
|---|
| 133 |
VMMR3DECL(int) CFGMR3QueryU16Def( PCFGMNODE pNode, const char *pszName, uint16_t *pu16, uint16_t u16Def); |
|---|
| 134 |
VMMR3DECL(int) CFGMR3QueryS16( PCFGMNODE pNode, const char *pszName, int16_t *pi16); |
|---|
| 135 |
VMMR3DECL(int) CFGMR3QueryS16Def( PCFGMNODE pNode, const char *pszName, int16_t *pi16, int16_t i16Def); |
|---|
| 136 |
VMMR3DECL(int) CFGMR3QueryU8( PCFGMNODE pNode, const char *pszName, uint8_t *pu8); |
|---|
| 137 |
VMMR3DECL(int) CFGMR3QueryU8Def( PCFGMNODE pNode, const char *pszName, uint8_t *pu8, uint8_t u8Def); |
|---|
| 138 |
VMMR3DECL(int) CFGMR3QueryS8( PCFGMNODE pNode, const char *pszName, int8_t *pi8); |
|---|
| 139 |
VMMR3DECL(int) CFGMR3QueryS8Def( PCFGMNODE pNode, const char *pszName, int8_t *pi8, int8_t i8Def); |
|---|
| 140 |
VMMR3DECL(int) CFGMR3QueryBool( PCFGMNODE pNode, const char *pszName, bool *pf); |
|---|
| 141 |
VMMR3DECL(int) CFGMR3QueryBoolDef( PCFGMNODE pNode, const char *pszName, bool *pf, bool fDef); |
|---|
| 142 |
VMMR3DECL(int) CFGMR3QueryPort( PCFGMNODE pNode, const char *pszName, PRTIOPORT pPort); |
|---|
| 143 |
VMMR3DECL(int) CFGMR3QueryPortDef( PCFGMNODE pNode, const char *pszName, PRTIOPORT pPort, RTIOPORT PortDef); |
|---|
| 144 |
VMMR3DECL(int) CFGMR3QueryUInt( PCFGMNODE pNode, const char *pszName, unsigned int *pu); |
|---|
| 145 |
VMMR3DECL(int) CFGMR3QueryUIntDef( PCFGMNODE pNode, const char *pszName, unsigned int *pu, unsigned int uDef); |
|---|
| 146 |
VMMR3DECL(int) CFGMR3QuerySInt( PCFGMNODE pNode, const char *pszName, signed int *pi); |
|---|
| 147 |
VMMR3DECL(int) CFGMR3QuerySIntDef( PCFGMNODE pNode, const char *pszName, signed int *pi, signed int iDef); |
|---|
| 148 |
VMMR3DECL(int) CFGMR3QueryPtr( PCFGMNODE pNode, const char *pszName, void **ppv); |
|---|
| 149 |
VMMR3DECL(int) CFGMR3QueryPtrDef( PCFGMNODE pNode, const char *pszName, void **ppv, void *pvDef); |
|---|
| 150 |
VMMR3DECL(int) CFGMR3QueryGCPtr( PCFGMNODE pNode, const char *pszName, PRTGCPTR pGCPtr); |
|---|
| 151 |
VMMR3DECL(int) CFGMR3QueryGCPtrDef( PCFGMNODE pNode, const char *pszName, PRTGCPTR pGCPtr, RTGCPTR GCPtrDef); |
|---|
| 152 |
VMMR3DECL(int) CFGMR3QueryGCPtrU( PCFGMNODE pNode, const char *pszName, PRTGCUINTPTR pGCPtr); |
|---|
| 153 |
VMMR3DECL(int) CFGMR3QueryGCPtrUDef( PCFGMNODE pNode, const char *pszName, PRTGCUINTPTR pGCPtr, RTGCUINTPTR GCPtrDef); |
|---|
| 154 |
VMMR3DECL(int) CFGMR3QueryGCPtrS( PCFGMNODE pNode, const char *pszName, PRTGCINTPTR pGCPtr); |
|---|
| 155 |
VMMR3DECL(int) CFGMR3QueryGCPtrSDef( PCFGMNODE pNode, const char *pszName, PRTGCINTPTR pGCPtr, RTGCINTPTR GCPtrDef); |
|---|
| 156 |
VMMR3DECL(int) CFGMR3QueryStringAlloc( PCFGMNODE pNode, const char *pszName, char **ppszString); |
|---|
| 157 |
VMMR3DECL(int) CFGMR3QueryStringAllocDef(PCFGMNODE pNode, const char *pszName, char **ppszString, const char *pszDef); |
|---|
| 158 |
|
|---|
| 159 |
|
|---|
| 160 |
|
|---|
| 161 |
|
|---|
| 162 |
|
|---|
| 163 |
|
|---|
| 164 |
VMMR3DECL(PCFGMNODE) CFGMR3GetRoot(PVM pVM); |
|---|
| 165 |
VMMR3DECL(PCFGMNODE) CFGMR3GetParent(PCFGMNODE pNode); |
|---|
| 166 |
VMMR3DECL(PCFGMNODE) CFGMR3GetParentEx(PVM pVM, PCFGMNODE pNode); |
|---|
| 167 |
VMMR3DECL(PCFGMNODE) CFGMR3GetChild(PCFGMNODE pNode, const char *pszPath); |
|---|
| 168 |
VMMR3DECL(PCFGMNODE) CFGMR3GetChildF(PCFGMNODE pNode, const char *pszPathFormat, ...); |
|---|
| 169 |
VMMR3DECL(PCFGMNODE) CFGMR3GetChildFV(PCFGMNODE pNode, const char *pszPathFormat, va_list Args); |
|---|
| 170 |
VMMR3DECL(PCFGMNODE) CFGMR3GetFirstChild(PCFGMNODE pNode); |
|---|
| 171 |
VMMR3DECL(PCFGMNODE) CFGMR3GetNextChild(PCFGMNODE pCur); |
|---|
| 172 |
VMMR3DECL(int) CFGMR3GetName(PCFGMNODE pCur, char *pszName, size_t cchName); |
|---|
| 173 |
VMMR3DECL(size_t) CFGMR3GetNameLen(PCFGMNODE pCur); |
|---|
| 174 |
VMMR3DECL(bool) CFGMR3AreChildrenValid(PCFGMNODE pNode, const char *pszzValid); |
|---|
| 175 |
VMMR3DECL(PCFGMLEAF) CFGMR3GetFirstValue(PCFGMNODE pCur); |
|---|
| 176 |
VMMR3DECL(PCFGMLEAF) CFGMR3GetNextValue(PCFGMLEAF pCur); |
|---|
| 177 |
VMMR3DECL(int) CFGMR3GetValueName(PCFGMLEAF pCur, char *pszName, size_t cchName); |
|---|
| 178 |
VMMR3DECL(size_t) CFGMR3GetValueNameLen(PCFGMLEAF pCur); |
|---|
| 179 |
VMMR3DECL(CFGMVALUETYPE) CFGMR3GetValueType(PCFGMLEAF pCur); |
|---|
| 180 |
VMMR3DECL(bool) CFGMR3AreValuesValid(PCFGMNODE pNode, const char *pszzValid); |
|---|
| 181 |
|
|---|
| 182 |
|
|---|
| 183 |
|
|---|
| 184 |
|
|---|
| 185 |
#endif |
|---|
| 186 |
|
|---|
| 187 |
|
|---|
| 188 |
__END_DECLS |
|---|
| 189 |
|
|---|
| 190 |
|
|---|
| 191 |
|
|---|
| 192 |
#endif |
|---|
| 193 |
|
|---|