summaryrefslogtreecommitdiffstats
path: root/src/vpp-api/vapi
diff options
context:
space:
mode:
Diffstat (limited to 'src/vpp-api/vapi')
-rwxr-xr-xsrc/vpp-api/vapi/vapi_c_gen.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/vpp-api/vapi/vapi_c_gen.py b/src/vpp-api/vapi/vapi_c_gen.py
index 9939bc0556c..490b83028da 100755
--- a/src/vpp-api/vapi/vapi_c_gen.py
+++ b/src/vpp-api/vapi/vapi_c_gen.py
@@ -10,7 +10,7 @@ from vapi_json_parser import Field, Struct, Enum, Union, Message, JsonParser,\
class CField(Field):
def get_c_name(self):
- return self.name
+ return "vapi_type_%s" % self.name
def get_c_def(self):
if self.len is not None:
@@ -100,14 +100,14 @@ class CField(Field):
class CAlias(CField):
def get_c_name(self):
- return self.name
+ return "vapi_type_%s" % self.name
def get_c_def(self):
- return "typedef %s" % super(CAlias, self).get_c_def()
- # if self.len is not None:
- # return "typedef %s %s[%d];" % (self.type.get_c_name(), self.name, self.len)
- # else:
- # return "typedef %s %s;" % (self.type.get_c_name(), self.name)
+ if self.len is not None:
+ return "typedef %s vapi_type_%s[%d];" % (self.type.get_c_name(), self.name, self.len)
+ else:
+ return "typedef %s vapi_type_%s;" % (self.type.get_c_name(), self.name)
+ #return "typedef %s" % super(CAlias, self).get_c_def()
# def needs_byte_swap