From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49370) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8CsW-0006f0-8E for qemu-devel@nongnu.org; Thu, 15 Mar 2012 11:46:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S8CsQ-0003mh-Kt for qemu-devel@nongnu.org; Thu, 15 Mar 2012 11:46:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38944) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8CsQ-0003mT-CN for qemu-devel@nongnu.org; Thu, 15 Mar 2012 11:46:06 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q2FFk4Cl027046 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 15 Mar 2012 11:46:04 -0400 From: Federico Simoncelli Date: Thu, 15 Mar 2012 15:45:59 +0000 Message-Id: <1331826359-13398-1-git-send-email-fsimonce@redhat.com> In-Reply-To: <1331819618-12481-1-git-send-email-fsimonce@redhat.com> References: <1331819618-12481-1-git-send-email-fsimonce@redhat.com> Subject: [Qemu-devel] [PATCH v2] qapi: escaping dots in c_var and in de_camel_case List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, Federico Simoncelli , lcapitulino@redhat.com This allows qapi commands and types with dots (downstream QMP extensions containing fully qualified domain names). Signed-off-by: Federico Simoncelli --- scripts/qapi.py | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/qapi.py b/scripts/qapi.py index 6e05469..b1173bf 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -111,7 +111,7 @@ def de_camel_case(name): for ch in name: if ch.isupper() and new_name: new_name += '_' - if ch == '-': + if ch == '-' or ch == '.': new_name += '_' else: new_name += ch.lower() @@ -131,7 +131,7 @@ def camel_case(name): return new_name def c_var(name): - return '_'.join(name.split('-')).lstrip("*") + return name.replace('-', '_').replace('.', '_').lstrip('*') def c_list_type(name): return '%sList' % name -- 1.7.1