NativeEnumerated.c vars NULL init and check
[com/asn1c.git] / libasn1fix / asn1fix_tags.h
1 #ifndef ASN1FIX_TAGS_H
2 #define ASN1FIX_TAGS_H
3
4 struct asn1_namespace_s;   /* Forward declaration */
5
6 enum asn1f_aft_flags_e {
7         AFT_IMAGINARY_ANY       = 0x01, /* Treat ANY tag as [IMAGINARY ANY] */
8         AFT_FETCH_OUTMOST       = 0x02, /* Fetch only outmost tag */
9         AFT_FULL_COLLECT        = 0x04, /* Collect all tags */
10         AFT_CANON_CHOICE        = 0x08, /* Fetch the minimal CHOICE root tag */
11 };
12
13 /*
14  * Allocate and return an array of tags for the given type.
15  * Type1 ::= [2] EXPLICIT Type2
16  * Type2 ::= [3] IMPLICIT Type3
17  * Type3 ::= [4] EXPLICIT SEQUENCE { ... }
18  * Will return [2][3][UNIVERSAL 16] for the Type1.
19  */
20 int asn1f_fetch_tags(asn1p_t *asn, struct asn1_namespace_s *ns,
21                      asn1p_module_t *mod, asn1p_expr_t *expr,
22                      struct asn1p_type_tag_s **tags,
23                      enum asn1f_aft_flags_e flags);
24
25 /*
26  * Fetch the outmost tag of the given type.
27  * Type1 ::= Type2
28  * Type2 ::= [2] Type3
29  * Type3 ::= SEQUENCE { ... }
30  * Will yield [2] for Type1.
31  */
32 int asn1f_fetch_outmost_tag(asn1p_t *asn, struct asn1_namespace_s *ns,
33                             asn1p_module_t *mod, asn1p_expr_t *expr,
34                             struct asn1p_type_tag_s *tag,
35                             enum asn1f_aft_flags_e);
36
37 #endif  /* ASN1FIX_TAGS_H */