yumapro  24.10-3
YumaPro SDK
Loading...
Searching...
No Matches
typ_userdef.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_typ_userdef
12#define _H_typ_userdef
13
14/* FILE: typ_userdef.h
15*********************************************************************
16* *
17* P U R P O S E *
18* *
19*********************************************************************/
20
31/*********************************************************************
32* *
33* C H A N G E H I S T O R Y *
34* *
35*********************************************************************
36
37date init comment
38----------------------------------------------------------------------
3907-apr-18 abb Begun
40*/
41
42// for XSD pattern: xmlRexexpPtr pattern
43#include <xmlstring.h>
44
45#ifndef _H_status_enum
46#include "status_enum.h"
47#endif
48
49
50#ifndef _H_val
51#include "val.h"
52#endif
53
54#ifndef _H_typ
55#include "typ.h"
56#endif
57
58#ifdef __cplusplus
59extern "C" {
60#endif
61
62/********************************************************************
63* *
64* C O N S T A N T S *
65* *
66*********************************************************************/
67
68
69
70/********************************************************************
71* *
72* T Y P E S *
73* *
74*********************************************************************/
75
101typedef status_t
102 (*typ_validate_fn_t) (typ_def_t *typdef,
103 val_value_t *val,
104 void *cookie);
105
106
117typedef status_t
118 (*typ_canonical_fn_t) (typ_def_t *typdef,
119 val_value_t *val,
120 void *cookie);
121
122
135typedef status_t
136 (*typ_compare_fn_t) (const typ_def_t *typdef,
137 const val_value_t *val1,
138 const val_value_t *val2,
139 void *cookie,
140 int *retval);
141
142
146typedef struct typ_userdef_t_ {
150 void *cookie;
152
153
154/********************************************************************
155* *
156* F U N C T I O N S *
157* *
158*********************************************************************/
159
174extern status_t
175 typ_userdef_register (const xmlChar *modname,
176 const xmlChar *typname,
177 typ_validate_fn_t validate_fn,
178 typ_canonical_fn_t canonical_fn,
179 typ_compare_fn_t compare_fn,
180 void *cookie);
181
182
188extern void
190
191
199extern status_t
201
202
211extern status_t
213
214
225extern status_t
226 typ_userdef_compare (const val_value_t *val1,
227 const val_value_t *val2,
228 int32 *ret);
229
233#ifdef __cplusplus
234} /* end extern 'C' */
235#endif
236
237#endif /* _H_typ_userdef */
status_t
global error return code
Definition: status_enum.h:210
status_t typ_userdef_register(const xmlChar *modname, const xmlChar *typname, typ_validate_fn_t validate_fn, typ_canonical_fn_t canonical_fn, typ_compare_fn_t compare_fn, void *cookie)
Register the callback functions for a user defined type.
Definition: typ_userdef.c:116
status_t typ_userdef_validate(val_value_t *val)
Invoke the validate callback function for a user defined type if it exists.
Definition: typ_userdef.c:200
status_t(* typ_validate_fn_t)(typ_def_t *typdef, val_value_t *val, void *cookie)
userdef validate callback function user validation callback for a userdef type
Definition: typ_userdef.h:102
status_t(* typ_compare_fn_t)(const typ_def_t *typdef, const val_value_t *val1, const val_value_t *val2, void *cookie, int *retval)
userdef compare callback function compare 2 val_value_t nodes of the same user defined type
Definition: typ_userdef.h:136
void typ_userdef_clean_typdef(typ_def_t *typdef)
Clean the user typedef fields.
Definition: typ_userdef.c:178
status_t(* typ_canonical_fn_t)(typ_def_t *typdef, val_value_t *val, void *cookie)
userdef canonical callback function convert the inval to the canonical format for the type
Definition: typ_userdef.h:118
status_t typ_userdef_canonical(val_value_t *val)
Invoke the canonical callback function for a user defined type if it exists.
Definition: typ_userdef.c:244
status_t typ_userdef_compare(const val_value_t *val1, const val_value_t *val2, int32 *ret)
Invoke the compare callback function for a user defined type if it exists.
Definition: typ_userdef.c:303
global error status code enumerations
Discriminated union for all data typedefs.
Definition: typ.h:458
one userdef control block The CB will exist if one or more callbacks are registered
Definition: typ_userdef.h:146
typ_canonical_fn_t canonical_fn
canonical callback
Definition: typ_userdef.h:148
typ_compare_fn_t compare_fn
compare callback
Definition: typ_userdef.h:149
void * cookie
registration cookie
Definition: typ_userdef.h:150
typ_validate_fn_t validate_fn
validate callback
Definition: typ_userdef.h:147
one value to match one type
Definition: val.h:912
Parameter Type Handler.
Value Node Basic Support.