Working
git-svn-id: svn://svn.cc65.org/cc65/trunk@1240 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -89,7 +89,7 @@ static int CmpChips (void* Data attribute ((unused)),
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Code */
|
||||
/* Code */
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
@@ -150,6 +150,13 @@ void LoadChips (void)
|
||||
|
||||
/* Generate a new chip and insert it into the collection */
|
||||
CollAppend (&Chips, NewChip (L, Data));
|
||||
|
||||
/* Output chip name and version to keep the user happy */
|
||||
Print (stdout, 1,
|
||||
"Found chip `%s' version %u.%u\n",
|
||||
Data->ChipName,
|
||||
Data->MajorVersion,
|
||||
Data->MinorVersion);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,6 +171,22 @@ const Chip* FindChip (const char* Name)
|
||||
* could not be found.
|
||||
*/
|
||||
{
|
||||
unsigned I;
|
||||
|
||||
/* ## We do a linear search for now */
|
||||
for (I = 0; I < CollCount (&Chips); ++I) {
|
||||
|
||||
/* Get the chip at this position */
|
||||
const Chip* C = CollConstAt (&Chips, I);
|
||||
|
||||
/* Compare the name */
|
||||
if (strcmp (Name, C->Data->ChipName) == 0) {
|
||||
/* Found */
|
||||
return C;
|
||||
}
|
||||
}
|
||||
|
||||
/* Not found */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user