mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-12-13 17:34:56 +00:00
*avrpart.c,main.c: Moved list_parts() and locate_part() from main.c to avrpart.c
*avrpart.h: Added prototypes for list_parts() and locate_part() git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@389 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
37
avrpart.c
37
avrpart.c
@@ -397,6 +397,43 @@ AVRPART * avr_dup_part(AVRPART * d)
|
||||
}
|
||||
|
||||
|
||||
AVRPART * locate_part(LISTID parts, char * partdesc)
|
||||
{
|
||||
LNODEID ln1;
|
||||
AVRPART * p = NULL;
|
||||
int found;
|
||||
|
||||
found = 0;
|
||||
|
||||
for (ln1=lfirst(parts); ln1 && !found; ln1=lnext(ln1)) {
|
||||
p = ldata(ln1);
|
||||
if ((strcasecmp(partdesc, p->id) == 0) ||
|
||||
(strcasecmp(partdesc, p->desc) == 0))
|
||||
found = 1;
|
||||
}
|
||||
|
||||
if (found)
|
||||
return p;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
void list_parts(FILE * f, char * prefix, LISTID parts)
|
||||
{
|
||||
LNODEID ln1;
|
||||
AVRPART * p;
|
||||
|
||||
for (ln1=lfirst(parts); ln1; ln1=lnext(ln1)) {
|
||||
p = ldata(ln1);
|
||||
fprintf(f, "%s%-4s = %-15s [%s:%d]\n",
|
||||
prefix, p->id, p->desc, p->config_file, p->lineno);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
char * reset_disp_str(int r)
|
||||
{
|
||||
switch (r) {
|
||||
|
||||
Reference in New Issue
Block a user