RDK Documentation (Open Sourced RDK Components)
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
waldb.h
1 /*
2  * If not stated otherwise in this file or this component's Licenses.txt file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2017 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18 */
19 #ifndef _WALDB_H
20 #define _WALDB_H
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 #include<glib.h>
25 /**
26  * @brief Database Error codes.
27  */
28 typedef enum
29 {
30  DB_SUCCESS = 0, /**< Success. */
31  DB_FAILURE, /**< General Failure */
32  DB_ERR_WILDCARD_NOT_SUPPORTED,
33  DB_ERR_INVALID_PARAMETER,
34  DB_ERR_TIMEOUT,
35  DB_ERR_NOT_EXIST
36 }
37 DB_STATUS;
38 
39 typedef struct __DataModelParam
40 {
41  char *objectName;
42  char *paramName;
43  char *dataType;
44  char *access;
45  char *defaultValue;
46  char *bsUpdate;
48 
49 
50 /* @brief Loads the Parameter count query string to memory
51  *
52  * @return void
53  */
54 void initNumEntityParamList();
55 
56 
57 DB_STATUS loadDataModel(void);
58 
59 int isWildCardParam(char *paramName);
60 
61 void* getDataModelHandle();
62 
63 DB_STATUS checkDataModelStatus();
64 
65 void freeDataModelParam(DataModelParam dmParam);
66 /* @brief Returns a parameter list and count given an input paramName with wildcard characters
67  *
68  * @dbhandle[in] database handle to query in to
69  * @paramName[in] parameter name with wildcard(*)
70  * @ParamList[out] parameter list extended by the input parameter
71  * @ParamDataTypeList[out] parameter data type list extended by the input wildcard parameter
72  * @paramCount[out] parameter count
73  * @return DB_STATUS
74  */
75 DB_STATUS getChildParamNamesFromDataModel(void *dbhandle,char *paramName,char **ParamList,char **ParamDataTypeList,int *paramCount);
76 
77 /* @brief Returns a parameter list and count given an input paramName with wildcard characters
78  *
79  * @dbhandle[in] database handle
80  * @paramName[in] parameter name to search for in xml and retrieeve node details
81  * @dmParam[out] XML node details of paramName if found
82  * @return int returned 0 or 1 based on availability in XML
83  */
84 int getParamInfoFromDataModel(void *handle,const char *paramName,DataModelParam *dmParam);
85 
86 DB_STATUS get_complete_param_list (char **out_param_list, int *out_param_count);
87 #ifdef __cplusplus
88 }
89 #endif
90 #endif /*_WALDB_H*/
91 
__DataModelParam
Definition: waldb.h:39
isWildCardParam
int isWildCardParam(const char *paramName)
Check if Parameter Name ends with . If yes it is a wild card param.
Definition: webpa_parameter.cpp:732