blob: 737f1339fb22e211e5c8a1c6ec4b51d0728b7feb [file] [log] [blame]
Lev Walkinb46156d2017-09-05 02:53:05 -07001#ifndef ASN1_COMPILER_NAMING_H
2#define ASN1_COMPILER_NAMING_H
3
4struct 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
15struct c_names c_name(arg_t *);
16const char *c_member_name(arg_t *, asn1p_expr_t *); /* %s_%s */
17const char *c_presence_name(arg_t *, asn1p_expr_t *); /* %s_PR_%s */
18
Lev Walkin5efafc52017-09-05 03:43:00 -070019/*
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 */
24int c_name_clash(arg_t *arg);
25
26void c_name_clash_finder_init(void);
27
Lev Walkinb46156d2017-09-05 02:53:05 -070028#endif /* ASN1_COMPILER_NAMING_H */