Lev Walkin | b46156d | 2017-09-05 02:53:05 -0700 | [diff] [blame] | 1 | #ifndef ASN1_COMPILER_NAMING_H |
| 2 | #define ASN1_COMPILER_NAMING_H |
| 3 | |
| 4 | struct c_names { |
| 5 | const char *base_name; /* "foo" */ |
| 6 | const char *short_name; /* "foo_t", "e_foo" */ |
| 7 | const char *full_name; /* "struct foo", "enum foo" */ |
| 8 | const char *as_member; /* "foo" (not compounded) */ |
| 9 | const char *presence_enum; /* "enum foo_PR" */ |
| 10 | const char *presence_name; /* "foo_PR" */ |
| 11 | const char *members_enum; /* "enum foo" */ |
| 12 | const char *members_name; /* "e_foo" */ |
| 13 | }; |
| 14 | |
| 15 | struct c_names c_name(arg_t *); |
| 16 | const char *c_member_name(arg_t *, asn1p_expr_t *); /* %s_%s */ |
| 17 | const char *c_presence_name(arg_t *, asn1p_expr_t *); /* %s_PR_%s */ |
| 18 | |
Lev Walkin | 5efafc5 | 2017-09-05 03:43:00 -0700 | [diff] [blame] | 19 | /* |
| 20 | * Returns 0 if no C name clashes have been encountered. |
| 21 | * Returns 1 if C name clashes have been encountered. |
| 22 | * Prints out the clashing items and suggests -fcompound-names. |
| 23 | */ |
| 24 | int c_name_clash(arg_t *arg); |
| 25 | |
| 26 | void c_name_clash_finder_init(void); |
| 27 | |
Lev Walkin | b46156d | 2017-09-05 02:53:05 -0700 | [diff] [blame] | 28 | #endif /* ASN1_COMPILER_NAMING_H */ |