diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-02-22 16:50:19 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-04-12 11:38:59 +0100 |
commit | 6f867844aaefb0e5239ff2328a4b7329b450f4dd (patch) | |
tree | e6de98fe32995d5a6e309c2ad45c55204dbfdf62 /tools | |
parent | 8418fb5504aca4140c956e0962dc31f2d7a20b60 (diff) | |
download | telepathy-glib-6f867844aaefb0e5239ff2328a4b7329b450f4dd.tar.gz |
Generate TP_NUM_foo for every generated enum
Unlike NUM_TP_foo, these are introspectable.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46470
Diffstat (limited to 'tools')
-rw-r--r-- | tools/c-constants-gen.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/tools/c-constants-gen.py b/tools/c-constants-gen.py index c74d4fdc9..12c43f2ad 100644 --- a/tools/c-constants-gen.py +++ b/tools/c-constants-gen.py @@ -127,19 +127,29 @@ extern "C" { self.d("""\ /** - * NUM_%(upper-plural)s: (skip) + * %(upper-prefix)sNUM_%(upper-plural)s: * * 1 higher than the highest valid value of #%(mixed-name)s. */ + +/** + * NUM_%(upper-prefix)s%(upper-plural)s: (skip) + * + * 1 higher than the highest valid value of #%(mixed-name)s. + * In new code, use %(upper-prefix)sNUM_%(upper-plural)s instead. + */ """ % {'mixed-name' : (self.prefix + name).replace('_', ''), - 'upper-plural' : (self.prefix + name_plural).upper(), + 'upper-prefix' : self.prefix.upper(), + 'upper-plural' : name_plural.upper(), 'last-val' : vals[-1].getAttribute('value')}) self.write("""\ -#define NUM_%(upper-plural)s (%(last-val)s+1) +#define %(upper-prefix)sNUM_%(upper-plural)s (%(last-val)s+1) +#define NUM_%(upper-prefix)s%(upper-plural)s %(upper-prefix)sNUM_%(upper-plural)s """ % {'mixed-name' : (self.prefix + name).replace('_', ''), - 'upper-plural' : (self.prefix + name_plural).upper(), + 'upper-prefix' : self.prefix.upper(), + 'upper-plural' : name_plural.upper(), 'last-val' : vals[-1].getAttribute('value')}) def do_val(self, val, value_prefix): |