1.80 readme and filter for it

don't know why this wasn't commited back in 2010..


git-svn-id: file:///home/notaz/opt/svn/PicoDrive@927 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
notaz 2011-05-21 17:57:18 +00:00
parent 40a91e5cc8
commit 39e5b215d3
2 changed files with 88 additions and 46 deletions

View file

@ -25,17 +25,19 @@ static int check_defines(const char **defs, int defcount, char *tdef)
static void do_counters(char *str)
{
static int counters[4] = { 1, 1, 1, 1 };
static int counter_id = -1, counter;
char buff[1024];
int counter;
char *s = str;
while ((s = strstr(s, "@@")))
{
if (s[2] < '0' || s[2] > '3') { s++; continue; }
if (s[2] < '0' || s[2] > '9') { s++; continue; }
counter = s[2] - '0';
snprintf(buff, sizeof(buff), "%i%s", counters[counter]++, s + 3);
if (counter_id != s[2] - '0') {
counter_id = s[2] - '0';
counter = 1;
}
snprintf(buff, sizeof(buff), "%i%s", counter++, s + 3);
strcpy(s, buff);
}
}