Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 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 | |
Lev Walkin | 04abdb2 | 2016-01-10 20:03:04 -0800 | [diff] [blame] | 8 | #include <assert.h> |
| 9 | |
Lev Walkin | 4efbfb7 | 2005-02-25 14:20:30 +0000 | [diff] [blame] | 10 | #ifndef __GNUC__ |
| 11 | #define __attribute__(x) /* unused */ |
| 12 | #endif |
| 13 | |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 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", |
Lev Walkin | 609ccbb | 2004-09-04 04:49:21 +0000 | [diff] [blame] | 20 | [ ASN_TYPE_ANY ] = "ANY", |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 21 | [ ASN_BASIC_BOOLEAN ] = "BOOLEAN", |
| 22 | [ ASN_BASIC_NULL ] = "NULL", |
| 23 | [ ASN_BASIC_INTEGER ] = "INTEGER", |
| 24 | [ ASN_BASIC_REAL ] = "REAL", |
| 25 | [ ASN_BASIC_ENUMERATED ] = "ENUMERATED", |
| 26 | [ ASN_BASIC_BIT_STRING ] = "BIT STRING", |
| 27 | [ ASN_BASIC_OCTET_STRING ] = "OCTET STRING", |
| 28 | [ ASN_BASIC_OBJECT_IDENTIFIER ] = "OBJECT IDENTIFIER", |
| 29 | [ ASN_BASIC_RELATIVE_OID ] = "RELATIVE-OID", |
| 30 | [ ASN_BASIC_EXTERNAL ] = "EXTERNAL", |
| 31 | [ ASN_BASIC_EMBEDDED_PDV ] = "EMBEDDED PDV", |
| 32 | [ ASN_BASIC_CHARACTER_STRING ] = "CHARACTER STRING", |
| 33 | [ ASN_BASIC_UTCTime ] = "UTCTime", |
| 34 | [ ASN_BASIC_GeneralizedTime ] = "GeneralizedTime", |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 35 | [ ASN_STRING_IA5String ] = "IA5String", |
Lev Walkin | e422e68 | 2004-08-25 01:58:59 +0000 | [diff] [blame] | 36 | [ ASN_STRING_PrintableString ] = "PrintableString", |
| 37 | [ ASN_STRING_VisibleString ] = "VisibleString", |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 38 | [ ASN_STRING_ISO646String ] = "ISO646String", |
| 39 | [ ASN_STRING_NumericString ] = "NumericString", |
Lev Walkin | e422e68 | 2004-08-25 01:58:59 +0000 | [diff] [blame] | 40 | [ ASN_STRING_UniversalString ] = "UniversalString", |
| 41 | [ ASN_STRING_BMPString ] = "BMPString", |
| 42 | [ ASN_STRING_UTF8String ] = "UTF8String", |
| 43 | [ ASN_STRING_GeneralString ] = "GeneralString", |
| 44 | [ ASN_STRING_GraphicString ] = "GraphicString", |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 45 | [ ASN_STRING_TeletexString ] = "TeletexString", |
| 46 | [ ASN_STRING_T61String ] = "T61String", |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 47 | [ ASN_STRING_VideotexString ] = "VideotexString", |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 48 | [ ASN_STRING_ObjectDescriptor ] = "ObjectDescriptor", |
| 49 | }; |
| 50 | |
| 51 | /* |
| 52 | * Convert the ASN.1 expression type back into the string representation. |
| 53 | */ |
Lev Walkin | 483c14f | 2016-01-10 20:41:57 -0800 | [diff] [blame] | 54 | #define ASN_EXPR_TYPE2STR(type) _asn1p_expr_type2string(type) |
Lev Walkin | 04abdb2 | 2016-01-10 20:03:04 -0800 | [diff] [blame] | 55 | |
Lev Walkin | 483c14f | 2016-01-10 20:41:57 -0800 | [diff] [blame] | 56 | static inline char * __attribute__((unused)) |
| 57 | _asn1p_expr_type2string(asn1p_expr_type_e type) { |
| 58 | assert((signed int)type >= 0); |
Lev Walkin | 04abdb2 | 2016-01-10 20:03:04 -0800 | [diff] [blame] | 59 | if(type < sizeof(asn1p_expr_type2str)/sizeof(asn1p_expr_type2str[0])) |
| 60 | return asn1p_expr_type2str[type]; |
| 61 | return NULL; |
| 62 | } |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 63 | |
| 64 | #endif /* ASN1_PARSER_EXPR_STR_H */ |