Implement developer options -p */[*cdosSrwt] for part descriptions

This commit is contained in:
Stefan Rueger
2022-07-07 18:32:19 +01:00
parent 3bd75e74c6
commit 9e2cea3ada
5 changed files with 690 additions and 251 deletions

View File

@@ -379,13 +379,16 @@ void avr_free_memalias(AVRMEM_ALIAS * m)
free(m);
}
AVRMEM_ALIAS * avr_locate_memalias(AVRPART * p, char * desc)
AVRMEM_ALIAS * avr_locate_memalias(AVRPART * p, const char * desc)
{
AVRMEM_ALIAS * m, * match;
LNODEID ln;
int matches;
int l;
if(!p || !desc || !p->mem_alias)
return NULL;
l = strlen(desc);
matches = 0;
match = NULL;
@@ -403,13 +406,16 @@ AVRMEM_ALIAS * avr_locate_memalias(AVRPART * p, char * desc)
return NULL;
}
AVRMEM * avr_locate_mem_noalias(AVRPART * p, char * desc)
AVRMEM * avr_locate_mem_noalias(AVRPART * p, const char * desc)
{
AVRMEM * m, * match;
LNODEID ln;
int matches;
int l;
if(!p || !desc || !p->mem)
return NULL;
l = strlen(desc);
matches = 0;
match = NULL;
@@ -428,7 +434,7 @@ AVRMEM * avr_locate_mem_noalias(AVRPART * p, char * desc)
}
AVRMEM * avr_locate_mem(AVRPART * p, char * desc)
AVRMEM * avr_locate_mem(AVRPART * p, const char * desc)
{
AVRMEM * m, * match;
AVRMEM_ALIAS * alias;
@@ -436,14 +442,19 @@ AVRMEM * avr_locate_mem(AVRPART * p, char * desc)
int matches;
int l;
if(!p || !desc)
return NULL;
l = strlen(desc);
matches = 0;
match = NULL;
for (ln=lfirst(p->mem); ln; ln=lnext(ln)) {
m = ldata(ln);
if (strncmp(desc, m->desc, l) == 0) {
match = m;
matches++;
if(p->mem) {
for (ln=lfirst(p->mem); ln; ln=lnext(ln)) {
m = ldata(ln);
if (strncmp(desc, m->desc, l) == 0) {
match = m;
matches++;
}
}
}
@@ -640,12 +651,15 @@ int i;
free(d);
}
AVRPART * locate_part(LISTID parts, char * partdesc)
AVRPART * locate_part(LISTID parts, const char * partdesc)
{
LNODEID ln1;
AVRPART * p = NULL;
int found;
if(!parts || !partdesc)
return NULL;
found = 0;
for (ln1=lfirst(parts); ln1 && !found; ln1=lnext(ln1)) {