~ubuntu-branches/ubuntu/karmic/libxcb/karmic

« back to all changes in this revision

Viewing changes to src/c_client.py

  • Committer: Bazaar Package Importer
  • Author(s): Julien Cristau
  • Date: 2009-05-29 14:58:44 UTC
  • mfrom: (1.1.4 upstream) (2.1.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090529145844-k4iq1ewu0qy7z0ot
Tags: 1.3-2
* Revert the libxcb-randr SONAME bump, which was accidental.
* Add symbols files for all libraries, to help us catch ABI changes.
* Use debhelper 7 and get rid of cdbs, reducing build time by a lot.
* Tighten the glob in *.install files to catch SONAME changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
135
135
    _ns = self.namespace
136
136
    _ns.c_ext_global_name = _n(_ns.prefix + ('id',))
137
137
 
 
138
    # Build the type-name collision avoidance table used by c_enum
 
139
    build_collision_table()
 
140
 
138
141
    _h_setlevel(0)
139
142
    _c_setlevel(0)
140
143
 
216
219
            cfile.write('\n')
217
220
    cfile.close()
218
221
 
 
222
def build_collision_table():
 
223
    global namecount
 
224
    namecount = {}
 
225
 
 
226
    for v in module.types.values():
 
227
        name = _t(v[0])
 
228
        namecount[name] = (namecount.get(name) or 0) + 1
 
229
 
219
230
def c_enum(self, name):
220
231
    '''
221
232
    Exported function that handles enum declarations.
222
233
    '''
 
234
 
 
235
    tname = _t(name)
 
236
    if namecount[tname] > 1:
 
237
        tname = _t(name + ('enum',))
 
238
 
223
239
    _h_setlevel(0)
224
240
    _h('')
225
 
    _h('typedef enum %s {', _t(name))
 
241
    _h('typedef enum %s {', tname)
226
242
 
227
243
    count = len(self.values)
228
244
 
232
248
        comma = ',' if count > 0 else ''
233
249
        _h('    %s%s%s%s', _n(name + (enam,)).upper(), equals, eval, comma)
234
250
 
235
 
    _h('} %s;', _t(name))
 
251
    _h('} %s;', tname)
236
252
 
237
253
def _c_type_setup(self, name, postfix):
238
254
    '''