aboutsummaryrefslogtreecommitdiff
path: root/scripts/qapi.py
diff options
context:
space:
mode:
authorFederico Simoncelli <fsimonce@redhat.com>2012-03-20 13:54:35 +0000
committerAnthony Liguori <aliguori@us.ibm.com>2012-03-26 13:21:46 -0500
commitc9da228b49792354af6bb6735bc48bc1c156bc0d (patch)
tree3fa5dfba4963b7217508c007e57a3e3611e1a323 /scripts/qapi.py
parentcb1977d308f6e1d6bf398d42e6148187b82456c1 (diff)
qapi: add c_fun to escape function names
Signed-off-by: Federico Simoncelli <fsimonce@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'scripts/qapi.py')
-rw-r--r--scripts/qapi.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/qapi.py b/scripts/qapi.py
index 6e05469e6d..e06233666b 100644
--- a/scripts/qapi.py
+++ b/scripts/qapi.py
@@ -131,7 +131,10 @@ def camel_case(name):
return new_name
def c_var(name):
- return '_'.join(name.split('-')).lstrip("*")
+ return name.replace('-', '_').lstrip("*")
+
+def c_fun(name):
+ return c_var(name).replace('.', '_')
def c_list_type(name):
return '%sList' % name