2 * Copyright (c) 2004, 2006 Lev Walkin <vlm@lionet.info>. All rights reserved.
3 * Redistribution and modifications are permitted subject to BSD license.
6 * Application-level ASN.1 callbacks.
8 #ifndef ASN_APPLICATION_H
9 #define ASN_APPLICATION_H
11 #include "asn_system.h" /* for platform-dependent types */
12 #include "asn_codecs.h" /* for ASN.1 codecs specifics */
19 * Generic type of an application-defined callback to return various
20 * types of data to the application.
21 * EXPECTED RETURN VALUES:
22 * -1: Failed to consume bytes. Abort the mission.
23 * Non-negative return values indicate success, and ignored.
25 typedef int (asn_app_consume_bytes_f)(const void *buffer, size_t size,
26 void *application_specific_key);
29 * A callback of this type is called whenever constraint validation fails
30 * on some ASN.1 type. See "constraints.h" for more details on constraint
32 * This callback specifies a descriptor of the ASN.1 type which failed
33 * the constraint check, as well as human readable message on what
34 * particular constraint has failed.
36 typedef void (asn_app_constraint_failed_f)(void *application_specific_key,
37 struct asn_TYPE_descriptor_s *type_descriptor_which_failed,
38 const void *structure_which_failed_ptr,
39 const char *error_message_format, ...) GCC_PRINTFLIKE(4, 5);
45 #include "constr_TYPE.h" /* for asn_TYPE_descriptor_t */
47 #endif /* ASN_APPLICATION_H */