From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 31 Aug 2011 16:01:49 +0200 From: Rodolfo kix Garcia To: <9fans@9fans.net> In-Reply-To: <3ad045e675c92ccadaa4dcb0e5f36a38@quintile.net> References: <3ad045e675c92ccadaa4dcb0e5f36a38@quintile.net> Message-ID: User-Agent: RoundCube Webmail/0.5.2 Subject: Re: [9fans] c code differencing Topicbox-Message-UUID: 178b7e0e-ead7-11e9-9d60-3106f5b1d025 On Wed, 31 Aug 2011 14:01:34 +0100, Steve Simon wrote: > Anyone have any pointers to a diff for C code. > > I have two libraries, A and B. > > B is and expanded and modified version of A and I have been > asked to extract A from B to build two libraries one > built on top of the other. > > What I think I need is a program which parses C and will > do diffs at the level of functions, globals , #defines and enums. > > it would ideally have two input files and generate two outputs > one output being the common code, one with the extensions on the > common. > > I don't expect this to be fully automated, there is going to be a > load > of hand edition before I am done, but is there somthing which can do > the easy stuff for me? > > -Steve Why don't use a C preprocessor to do that? You can have one file with ifdefs, and print the two files using an argument Example: #ifdef LIBA #include #else #include #endif and run "cpp -DLIBA ..." and "cpp -ULIBA ..." or "cpp ..." -- ||// //\\// Rodolfo "kix" Garcia ||\\// //\\ http://www.kix.es/