diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2012-10-04 19:52:09 -0500 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-10-04 19:52:09 -0500 |
commit | 97f3461555b1f5d8d4e6cfc839efe215098d786d (patch) | |
tree | 409d93f93ab150099dd07f4b2a4d7ca1ae327576 /scripts/qapi.py | |
parent | 6929cf11bb8ec5ff9f9e76c870c513204854a1eb (diff) | |
parent | 8bde9b6f8892c15e46e1f37a37ac038313be4d58 (diff) | |
download | qemu-97f3461555b1f5d8d4e6cfc839efe215098d786d.zip qemu-97f3461555b1f5d8d4e6cfc839efe215098d786d.tar.gz qemu-97f3461555b1f5d8d4e6cfc839efe215098d786d.tar.bz2 |
Merge remote-tracking branch 'qmp/queue/qmp' into staging
* qmp/queue/qmp:
block: live snapshot documentation tweaks
input: index_from_key(): drop unused code
qmp: qmp_send_key(): accept key codes in hex
input: qmp_send_key(): simplify
hmp: dump-guest-memory: hardcode protocol argument to "file:"
qmp: dump-guest-memory: don't spin if non-blocking fd would block
qmp: dump-guest-memory: improve schema doc (again)
qapi: convert add_client
monitor: add Error * argument to monitor_get_fd
pci-assign: use monitor_handle_fd_param
qapi: add "unix" to the set of reserved words
qapi: do not protect enum values from namespace pollution
Add qemu-ga-client script
Support settimeout in QEMUMonitorProtocol
Make negotiation optional in QEMUMonitorProtocol
Diffstat (limited to 'scripts/qapi.py')
-rw-r--r-- | scripts/qapi.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/qapi.py b/scripts/qapi.py index 122b4cb..afc5f32 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -141,7 +141,7 @@ def camel_case(name): new_name += ch.lower() return new_name -def c_var(name): +def c_var(name, protect=True): # ANSI X3J11/88-090, 3.1.1 c89_words = set(['auto', 'break', 'case', 'char', 'const', 'continue', 'default', 'do', 'double', 'else', 'enum', 'extern', 'float', @@ -156,12 +156,14 @@ def c_var(name): # GCC http://gcc.gnu.org/onlinedocs/gcc-4.7.1/gcc/C-Extensions.html # excluding _.* gcc_words = set(['asm', 'typeof']) - if name in c89_words | c99_words | c11_words | gcc_words: + # namespace pollution: + polluted_words = set(['unix']) + if protect and (name in c89_words | c99_words | c11_words | gcc_words | polluted_words): return "q_" + name return name.replace('-', '_').lstrip("*") -def c_fun(name): - return c_var(name).replace('.', '_') +def c_fun(name, protect=True): + return c_var(name, protect).replace('.', '_') def c_list_type(name): return '%sList' % name |