From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:50355) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RsP5R-0003qF-DG for qemu-devel@nongnu.org; Tue, 31 Jan 2012 20:34:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RsP5Q-0000zw-6W for qemu-devel@nongnu.org; Tue, 31 Jan 2012 20:34:13 -0500 Received: from e28smtp09.in.ibm.com ([122.248.162.9]:57563) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RsP5P-0000zV-KB for qemu-devel@nongnu.org; Tue, 31 Jan 2012 20:34:12 -0500 Received: from /spool/local by e28smtp09.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 1 Feb 2012 07:04:04 +0530 Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay02.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q111XlMU4304938 for ; Wed, 1 Feb 2012 07:03:48 +0530 Received: from d28av04.in.ibm.com (loopback [127.0.0.1]) by d28av04.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q111Xkr3024973 for ; Wed, 1 Feb 2012 12:33:47 +1100 Date: Wed, 1 Feb 2012 09:33:45 +0800 From: Richard Yang Message-ID: <20120201013345.GA3929@richard> References: <20120131055547.GA23981@richard> <20120131063501.GB23981@richard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] Why QEMUClock is defined in qemu-timer.c? Reply-To: Richard Yang List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Dmitry Zamaruev Cc: Richard Yang , qemu-devel@nongnu.org On Tue, Jan 31, 2012 at 12:00:30PM +0200, Dmitry Zamaruev wrote: >This is used in many places. >Maybe to simulate 'private' variables and access methods like in C++. > >If you define structure in .c file then every function that works with >this structure must reside in same file. And any other code to use >structure must use access-functions (api) to alter it and not directly >(compiler will issue error about incomplete type). >This way you could change structure or internal data handling without >affecting external code that relies on "stable api functions". Thanks for your explanation. I learned a lot. -- Richard Yang Help you, Help me