From patchwork Fri Jul 1 20:37:23 2005 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schwarzott X-Patchwork-Id: 11931 Received: from epz01.nefonline.de ([212.204.66.1]) by www.linuxtv.org with esmtp (Exim 4.34) id 1DoSHc-0007tj-OS for vdr@linuxtv.org; Fri, 01 Jul 2005 22:38:44 +0200 Received: from dsl01.83.171.157.31.nefkom.net (DSL01.83.171.157.31.NEFkom.net [83.171.157.31]) by epz01.nefonline.de (NEFkom Mailservice) with SMTP id j61Kch319996 for ; Fri, 1 Jul 2005 22:38:43 +0200 From: Matthias Schwarzott To: vdr@linuxtv.org Date: Fri, 1 Jul 2005 22:37:23 +0200 User-Agent: KMail/1.7.2 MIME-Version: 1.0 Message-Id: <200507012237.23423.zzam@gmx.de> Subject: [vdr] [PATCH] make vdr more patch friendly X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Klaus Schmidinger's VDR List-Id: Klaus Schmidinger's VDR List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jul 2005 20:38:44 -0000 Status: O X-Status: X-Keywords: X-UID: 3358 Hi! While including vdr into gentoo I found a lot of patches colliding at the same places in vdr. The places where this occurs mostly are: * config.h, members of cSetup * config.c, things in global space like new methods of cSetup * config.c, init of member variables of cSetup * config.c, store of member variables of cSetup * config.c, parse/read of member-variables of cSetup * i18n.c, definition of new i18ns The solution I propse is: In each of these places add a context for diff (perhaps like this): /* * Place for patches to insert functions/members to cSetup - Begin */ /* * Place for patches to insert functions/members to cSetup - End */ Attached is a patch to add these contexts at the places mentioned above. Now, if a patch wants to add some new members to cSetup these should be inserted between these two (three lines long) comments. The patch must also reproduce the context from above. Example: If patch a wants to add a variable a_active to cSetup this should result in that patch: /* * Place for patches to insert functions/members to cSetup - Begin */ + // added by patch a + int a_active; + /* + * Place for patches to insert functions/members to cSetup - End + */ + /* + * Place for patches to insert functions/members to cSetup - Begin + */ /* * Place for patches to insert functions/members to cSetup - End */ This will reproduce the context and the next patch can also be applied without problems. That has the following advantages: 1. The patch will be independent of other patches adding variables at the same place, as long as they also uses that technique. 2. The patch will nevertheless be garantueed to hit the right place, as the occurence of this context is unique. Greetings Matthias diff -ru vdr-1.3.27-vanilla/config.c vdr-1.3.27-prepared/config.c --- vdr-1.3.27-vanilla/config.c 2005-07-01 12:51:34.000000000 +0200 +++ vdr-1.3.27-prepared/config.c 2005-07-01 21:52:24.000000000 +0200 @@ -15,6 +15,17 @@ #include "plugin.h" #include "recording.h" + + +/* + * Place for Plugins to add code in global space - Begin + */ +/* + * Place for Plugins to add code in global space - End + */ + + + // IMPORTANT NOTE: in the 'sscanf()' calls there is a blank after the '%d' // format characters in order to allow any number of blanks after a numeric // value! @@ -302,6 +313,18 @@ CurrentChannel = -1; CurrentVolume = MAXVOLUME; CurrentDolby = 0; + + + +/* + * Place for Plugins to initialize variables - Begin + */ +/* + * Place for Plugins to initialize variables - End + */ + + + } cSetup& cSetup::operator= (const cSetup &s) @@ -460,6 +483,18 @@ else if (!strcasecmp(Name, "CurrentChannel")) CurrentChannel = atoi(Value); else if (!strcasecmp(Name, "CurrentVolume")) CurrentVolume = atoi(Value); else if (!strcasecmp(Name, "CurrentDolby")) CurrentDolby = atoi(Value); + + + +/* + * Place for Plugins to parse parameters into variables - Begin + */ +/* + * Place for Plugins to parse parameters into variables - End + */ + + + else return false; return true; @@ -525,6 +560,17 @@ Store("CurrentVolume", CurrentVolume); Store("CurrentDolby", CurrentDolby); + + +/* + * Place for Plugins to store variables - Begin + */ +/* + * Place for Plugins to store variables - End + */ + + + Sort(); if (cConfig::Save()) { diff -ru vdr-1.3.27-vanilla/config.h vdr-1.3.27-prepared/config.h --- vdr-1.3.27-vanilla/config.h 2005-07-01 12:51:34.000000000 +0200 +++ vdr-1.3.27-prepared/config.h 2005-07-01 21:51:54.000000000 +0200 @@ -256,6 +256,18 @@ int CurrentChannel; int CurrentVolume; int CurrentDolby; + + + +/* + * Place for patches to insert functions/members to cSetup - Begin + */ +/* + * Place for patches to insert functions/members to cSetup - End + */ + + + int __EndData__; cSetup(void); cSetup& operator= (const cSetup &s); diff -ru vdr-1.3.27-vanilla/i18n.c vdr-1.3.27-prepared/i18n.c --- vdr-1.3.27-vanilla/i18n.c 2005-07-01 12:51:24.000000000 +0200 +++ vdr-1.3.27-prepared/i18n.c 2005-07-01 21:53:06.000000000 +0200 @@ -5388,6 +5388,18 @@ "",// TODO "",// TODO }, + + + +/* + * Place for Plugins to add i18n - Begin + */ +/* + * Place for Plugins to add i18n - End + */ + + + { NULL } };