mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-13 06:16:10 -04:00
proxy one more generator
svn:r701
This commit is contained in:
parent
a7e395512e
commit
812d2fd8fd
@ -52,17 +52,17 @@ class Struct:
|
||||
name = "%s_%s" % (self._name, entry.Name())
|
||||
return name.upper()
|
||||
|
||||
def PrintIndented(self, file, ident, code):
|
||||
"""Takes an array, add indentation to each entry and prints it."""
|
||||
for entry in code:
|
||||
print >>file, '%s%s' % (ident, entry)
|
||||
|
||||
class StructCCode(Struct):
|
||||
""" Knows how to generate C code for a struct """
|
||||
|
||||
def __init__(self, name):
|
||||
Struct.__init__(self, name)
|
||||
|
||||
def PrintIndented(self, file, ident, code):
|
||||
"""Takes an array, add indentation to each entry and prints it."""
|
||||
for entry in code:
|
||||
print >>file, '%s%s' % (ident, entry)
|
||||
|
||||
def PrintTags(self, file):
|
||||
"""Prints the tag definitions for a structure."""
|
||||
print >>file, '/* Tag definition for %s */' % self._name
|
||||
@ -1366,7 +1366,7 @@ def ProcessOneEntry(factory, newstruct, entry):
|
||||
newname = newentry.Name()+ '_array'
|
||||
|
||||
# Now borgify the new entry.
|
||||
newentry = EntryArray(newentry)
|
||||
newentry = factory.EntryArray(newentry)
|
||||
newentry.SetStruct(newstruct)
|
||||
newentry.SetLineCount(line_count)
|
||||
newentry.MakeArray()
|
||||
@ -1599,6 +1599,9 @@ class CCodeGenerator:
|
||||
def EntryStruct(self, entry_type, name, tag, struct_name):
|
||||
return EntryStruct(entry_type, name, tag, struct_name)
|
||||
|
||||
def EntryArray(self, entry):
|
||||
return EntryArray(entry)
|
||||
|
||||
def Generate(factory, filename):
|
||||
ext = filename.split('.')[-1]
|
||||
if ext != 'rpc':
|
||||
|
Loading…
x
Reference in New Issue
Block a user