yumapro  20.10-12
YumaPro SDK
obj_errmsg.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018 - 2021, YumaWorks, Inc., All Rights Reserved.
3  *
4  * Unless required by applicable law or agreed to in writing,
5  * software distributed under the License is distributed on an
6  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
7  * KIND, either express or implied. See the License for the
8  * specific language governing permissions and limitations
9  * under the License.
10  */
11 #ifndef _H_obj_errmsg
12 #define _H_obj_errmsg
13 
14 /* FILE: obj_errmsg.h
15 *********************************************************************
16 * *
17 * P U R P O S E *
18 * *
19 *********************************************************************/
20 
26 /*********************************************************************
27 * *
28 * C H A N G E H I S T O R Y *
29 * *
30 *********************************************************************
31 
32 date init comment
33 ----------------------------------------------------------------------
34 24-mar-18 abb Begun
35 */
36 
37 #include <xmlstring.h>
38 
39 #ifndef _H_obj
40 #include "obj.h"
41 #endif
42 
43 #ifndef _H_status_enum
44 #include "status_enum.h"
45 #endif
46 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50 
51 /********************************************************************
52 * *
53 * F U N C T I O N S *
54 * *
55 *********************************************************************/
56 
57 
78 extern void
79  obj_errmsg_clean (obj_template_t *obj);
80 
81 
91 extern status_t
92  obj_errmsg_add (obj_template_t *obj,
93  const xmlChar *basestr,
94  obj_errmsg_t **ret_errmsg);
95 
96 
104 extern status_t
105  obj_errmsg_add_parm (obj_errmsg_t *errmsg,
106  const xmlChar *parmstr);
107 
116 extern status_t
117  obj_errmsg_add_filter (obj_errmsg_t *errmsg,
118  const xmlChar *parmstr,
119  boolean is_errortag);
120 
121 
129 extern status_t
130  obj_errmsg_set_lang (obj_errmsg_t *errmsg,
131  const xmlChar *langstr);
132 
133 
149 extern status_t
150  obj_errmsg_check_val (const xmlChar *error_tag,
151  const xmlChar *error_app_tag,
152  const xmlChar *error_lang,
153  val_value_t *error_val,
154  xmlChar **retmsg);
155 
156 
170 extern status_t
171  obj_errmsg_test_val (const xmlChar *error_tag,
172  const xmlChar *error_app_tag,
173  const xmlChar *error_lang,
174  val_value_t *error_val);
175 
176 
177 
181 #ifdef __cplusplus
182 } /* end extern 'C' */
183 #endif
184 
185 #endif /* _H_obj_errmsg */
ERR_NCX_SKIPPED
@ ERR_NCX_SKIPPED
2001
Definition: status_enum.h:551
xml_strlen
uint32 xml_strlen(const xmlChar *str)
Get the String len for xmlChar.
Definition: xml_util.c:1406
xpath_free_pcb
void xpath_free_pcb(xpath_pcb_t *pcb)
Free a malloced XPath parser control block.
Definition: xpath.c:2963
xml_strncpy
uint32 xml_strncpy(xmlChar *copyTo, const xmlChar *copyFrom, uint32 maxlen)
String copy for xmlChar – checks for buffer overflow.
Definition: xml_util.c:1518
xpath_first_resnode_valptr
val_value_t * xpath_first_resnode_valptr(xpath_resnode_t *resnode)
Get the first result in the renodeQ from a result struct.
Definition: xpath.c:3982
xml_strdup
xmlChar * xml_strdup(const xmlChar *copyFrom)
String duplicate for xmlChar.
Definition: xml_util.c:1553
val.h
Value Node Basic Support.
xml_util.h
XML Utilities.
xpath_new_pcb
xpath_pcb_t * xpath_new_pcb(const xmlChar *xpathstr, xpath_getvar_fn_t getvar_fn)
malloc a new XPath parser control block
Definition: xpath.c:2739
status_enum.h
global error status code enumerations
obj_errmsg_add_filter
status_t obj_errmsg_add_filter(obj_errmsg_t *errmsg, const xmlChar *parmstr, boolean is_errortag)
Add an errmsg filter for the object.
Definition: obj_errmsg.c:537
log_debug3
void void void void void void void void void void void log_debug3(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG3 log entry.
xpath_pcb_t_::obj
obj_template_t * obj
these parms are used by leafref and XPath1 parsing obj is a bptr to start object
Definition: xpath.h:734
xpath_pcb_t_::result
xpath_result_t * result
The XPath result for this evaluation.
Definition: xpath.h:779
VAL_NAME
#define VAL_NAME(V)
Access the value name.
Definition: val.h:399
ncxconst.h
Contains NCX constants.
obj_errmsg_add_parm
status_t obj_errmsg_add_parm(obj_errmsg_t *errmsg, const xmlChar *parmstr)
Add an errmsg parameter for the object.
Definition: obj_errmsg.c:504
obj_errmsg_add
status_t obj_errmsg_add(obj_template_t *obj, const xmlChar *basestr, obj_errmsg_t **ret_errmsg)
Create a new obj_errmsg struct for the object.
Definition: obj_errmsg.c:463
obj_errmsg.h
Handles errmsg data structures.
ERR_NCX_MISSING_PARM
@ ERR_NCX_MISSING_PARM
233
Definition: status_enum.h:272
xpath1.h
XPath 1.0 expression support.
NO_ERR
@ NO_ERR
000
Definition: status_enum.h:188
xpath.h
Schema and data model Xpath search support.
obj_errmsg_set_lang
status_t obj_errmsg_set_lang(obj_errmsg_t *errmsg, const xmlChar *langstr)
Set the errmsg-lang for the errmsg.
Definition: obj_errmsg.c:571
dlq_createQue
dlq_hdrT * dlq_createQue(void)
create a dynamic queue header
Definition: dlq.c:146
ERR_NCX_OPERATION_FAILED
@ ERR_NCX_OPERATION_FAILED
274
Definition: status_enum.h:315
xpath_free_result
void xpath_free_result(xpath_result_t *result)
Free a malloced XPath result struct.
Definition: xpath.c:3107
dlq_createSQue
void dlq_createSQue(dlq_hdrT *queAddr)
create a static queue header
Definition: dlq.c:177
log_warn
void void void log_warn(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_WARN log entry.
xpath1_eval_expr
xpath_result_t * xpath1_eval_expr(xpath_pcb_t *pcb, val_value_t *val, val_value_t *docroot, boolean logerrors, boolean configonly, status_t *res)
Evaluate an XPath expression use if the prefixes are YANG: must/when.
Definition: xpath1.c:5293
NCX_BT_EMPTY
@ NCX_BT_EMPTY
empty
Definition: ncxtypes.h:205
ERR_INTERNAL_MEM
@ ERR_INTERNAL_MEM
003
Definition: status_enum.h:193
dlq_nextEntry
#define dlq_nextEntry(nodeP)
get the next queue entry after the current entry
Definition: dlq.h:265
val_make_sprintf_string
xmlChar * val_make_sprintf_string(const val_value_t *val)
Malloc a buffer and then sprintf the xmlChar string NETCONF representation of a simple value.
Definition: val.c:10323
obj_errmsg_check_val
status_t obj_errmsg_check_val(const xmlChar *error_tag, const xmlChar *error_app_tag, const xmlChar *error_lang, val_value_t *error_val, xmlChar **retmsg)
Get the custom error message if any configured for the eror_val.
Definition: obj_errmsg.c:618
typ_is_simple
boolean typ_is_simple(ncx_btype_t btyp)
Check if this is a simple data type.
Definition: typ.c:3107
EMPTY_STRING
#define EMPTY_STRING
empty string used to get const xmlChar * cast
Definition: ncxconst.h:289
xpath_get_first_resnode
xpath_resnode_t * xpath_get_first_resnode(xpath_result_t *result)
Get the first result in the renodeQ from a result struct.
Definition: xpath.c:3931
xml_strcmp
int xml_strcmp(const xmlChar *s1, const xmlChar *s2)
String compare for xmlChar.
Definition: xml_util.c:1746
log.h
NCX System Logging Manager.
obj_errmsg_test_val
status_t obj_errmsg_test_val(const xmlChar *error_tag, const xmlChar *error_app_tag, const xmlChar *error_lang, val_value_t *error_val)
Check if there needs to be a custom error msg.
Definition: obj_errmsg.c:706
dlq_deque
void * dlq_deque(dlq_hdrT *listP)
remove the first queue node from the queue list
Definition: dlq.c:286
dlq_empty
#define dlq_empty(listP)
check if queue list is empty
Definition: dlq.h:367
xml_strcpy
uint32 xml_strcpy(xmlChar *copyTo, const xmlChar *copyFrom)
String copy for xmlChar.
Definition: xml_util.c:1486
VAL_TYPE
#define VAL_TYPE(V)
Access the base type : same as VAL_BTYPE.
Definition: val.h:387
dlq_firstEntry
#define dlq_firstEntry(listP)
get the first entry in the queue list
Definition: dlq.h:337
VAL_OBJ
#define VAL_OBJ(V)
Access the object template.
Definition: val.h:381
ncx.h
YANG module utility functions.
obj.h
Data Object Support.
dlq_enque
void dlq_enque(REG void *newP, REG dlq_hdrT *listP)
add a queue node to the end of a queue list Add newP to listP
Definition: dlq.c:246
obj_errmsg_clean
void obj_errmsg_clean(obj_template_t *obj)
Clean the error messages within an object template.
Definition: obj_errmsg.c:431
val_find_root
val_value_t * val_find_root(val_value_t *val)
Find the root value node or top-val if no ncx:root found.
Definition: val.c:15186
dlq_destroyQue
void dlq_destroyQue(dlq_hdrT *listP)
free a dynamic queue header previously allocated with dlq_createQue
Definition: dlq.c:206
status.h
Global error messages for status code enumerations.
dlq.h
dlq provides general double-linked list and queue support:
LOGDEBUG3
#define LOGDEBUG3
Check if at least log-level=debug3.
Definition: log.h:297