Updated INFO.yaml file
[ric-app/kpimon.git] / asn1c_defs / all-defs / constraints.h
1 /*-\r
2  * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.\r
3  * Redistribution and modifications are permitted subject to BSD license.\r
4  */\r
5 #ifndef ASN1_CONSTRAINTS_VALIDATOR_H\r
6 #define ASN1_CONSTRAINTS_VALIDATOR_H\r
7 \r
8 #include <asn_system.h>         /* Platform-dependent types */\r
9 \r
10 #ifdef __cplusplus\r
11 extern "C" {\r
12 #endif\r
13 \r
14 struct asn_TYPE_descriptor_s;           /* Forward declaration */\r
15 \r
16 /*\r
17  * Validate the structure according to the ASN.1 constraints.\r
18  * If errbuf and errlen are given, they shall be pointing to the appropriate\r
19  * buffer space and its length before calling this function. Alternatively,\r
20  * they could be passed as NULL's. If constraints validation fails,\r
21  * errlen will contain the actual number of bytes taken from the errbuf\r
22  * to encode an error message (properly 0-terminated).\r
23  * \r
24  * RETURN VALUES:\r
25  * This function returns 0 in case all ASN.1 constraints are met\r
26  * and -1 if one or more constraints were failed.\r
27  */\r
28 int asn_check_constraints(\r
29     const struct asn_TYPE_descriptor_s *type_descriptor,\r
30     const void *struct_ptr, /* Target language's structure */\r
31     char *errbuf,           /* Returned error description */\r
32     size_t *errlen          /* Length of the error description */\r
33 );\r
34 \r
35 \r
36 /*\r
37  * Generic type for constraint checking callback,\r
38  * associated with every type descriptor.\r
39  */\r
40 typedef int(asn_constr_check_f)(\r
41     const struct asn_TYPE_descriptor_s *type_descriptor, const void *struct_ptr,\r
42     asn_app_constraint_failed_f *optional_callback, /* Log the error */\r
43     void *optional_app_key /* Opaque key passed to a callback */\r
44 );\r
45 \r
46 /*******************************\r
47  * INTERNALLY USEFUL FUNCTIONS *\r
48  *******************************/\r
49 \r
50 asn_constr_check_f asn_generic_no_constraint;   /* No constraint whatsoever */\r
51 asn_constr_check_f asn_generic_unknown_constraint; /* Not fully supported */\r
52 \r
53 /*\r
54  * Invoke the callback with a complete error message.\r
55  */\r
56 #define ASN__CTFAIL     if(ctfailcb) ctfailcb\r
57 \r
58 #ifdef __cplusplus\r
59 }\r
60 #endif\r
61 \r
62 #endif  /* ASN1_CONSTRAINTS_VALIDATOR_H */\r