065766e99bbdc1f67d34ab6f8e9fb15f813d1ff0
[com/asn1c.git] / libasn1parser / asn1p_expr_str.h
1 /*
2  * This file is automatically generated by ./expr-h.pl
3  * DO NOT EDIT MANUALLY, fix the ./expr-h.pl instead if necessary.
4  */
5 #ifndef ASN1_PARSER_EXPR_STR_H
6 #define ASN1_PARSER_EXPR_STR_H
7
8 #include <assert.h>
9
10 #ifndef __GNUC__
11 #define __attribute__(x)        /* unused */
12 #endif
13
14 static char *asn1p_expr_type2str[] __attribute__ ((unused)) = {
15         [ ASN_CONSTR_SEQUENCE ]  = "SEQUENCE",
16         [ ASN_CONSTR_CHOICE ]    = "CHOICE",
17         [ ASN_CONSTR_SET ]       = "SET",
18         [ ASN_CONSTR_SEQUENCE_OF ]       = "SEQUENCE OF",
19         [ ASN_CONSTR_SET_OF ]    = "SET OF",
20         [ ASN_CONSTR_OPEN_TYPE ]         = "OPEN TYPE",
21         [ ASN_TYPE_ANY ]         = "ANY",
22         [ ASN_BASIC_BOOLEAN ]    = "BOOLEAN",
23         [ ASN_BASIC_NULL ]       = "NULL",
24         [ ASN_BASIC_INTEGER ]    = "INTEGER",
25         [ ASN_BASIC_REAL ]       = "REAL",
26         [ ASN_BASIC_ENUMERATED ]         = "ENUMERATED",
27         [ ASN_BASIC_BIT_STRING ]         = "BIT STRING",
28         [ ASN_BASIC_OCTET_STRING ]       = "OCTET STRING",
29         [ ASN_BASIC_OBJECT_IDENTIFIER ]  = "OBJECT IDENTIFIER",
30         [ ASN_BASIC_RELATIVE_OID ]       = "RELATIVE-OID",
31         [ ASN_BASIC_EXTERNAL ]   = "EXTERNAL",
32         [ ASN_BASIC_EMBEDDED_PDV ]       = "EMBEDDED PDV",
33         [ ASN_BASIC_CHARACTER_STRING ]   = "CHARACTER STRING",
34         [ ASN_BASIC_UTCTime ]    = "UTCTime",
35         [ ASN_BASIC_GeneralizedTime ]    = "GeneralizedTime",
36         [ ASN_STRING_IA5String ]         = "IA5String",
37         [ ASN_STRING_PrintableString ]   = "PrintableString",
38         [ ASN_STRING_VisibleString ]     = "VisibleString",
39         [ ASN_STRING_ISO646String ]      = "ISO646String",
40         [ ASN_STRING_NumericString ]     = "NumericString",
41         [ ASN_STRING_UniversalString ]   = "UniversalString",
42         [ ASN_STRING_BMPString ]         = "BMPString",
43         [ ASN_STRING_UTF8String ]        = "UTF8String",
44         [ ASN_STRING_GeneralString ]     = "GeneralString",
45         [ ASN_STRING_GraphicString ]     = "GraphicString",
46         [ ASN_STRING_TeletexString ]     = "TeletexString",
47         [ ASN_STRING_T61String ]         = "T61String",
48         [ ASN_STRING_VideotexString ]    = "VideotexString",
49         [ ASN_STRING_ObjectDescriptor ]  = "ObjectDescriptor",
50 };
51
52 /*
53  * Convert the ASN.1 expression type back into the string representation.
54  */
55 #define ASN_EXPR_TYPE2STR(type) _asn1p_expr_type2string(type)
56
57 static inline char * __attribute__((unused))
58 _asn1p_expr_type2string(asn1p_expr_type_e type) {
59     assert((signed int)type >= 0);
60     if(type < sizeof(asn1p_expr_type2str)/sizeof(asn1p_expr_type2str[0]))
61         return asn1p_expr_type2str[type];
62     return NULL;
63 }
64
65 #endif  /* ASN1_PARSER_EXPR_STR_H */