Added parsing of arguments to --read. The explicit format spec is currently

broken.


git-svn-id: svn://svn.cc65.org/cc65/trunk@5576 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz
2012-03-04 21:02:31 +00:00
parent 594e446ac5
commit 3cef75b26c
5 changed files with 198 additions and 6 deletions

View File

@@ -36,7 +36,7 @@
/* common */
#include "fileid.h"
/* sp65 */
/* sp65 */
#include "error.h"
#include "input.h"
#include "pcx.h"
@@ -78,6 +78,19 @@ static const FileId FormatTable[] = {
int FindInputFormat (const char* Name)
/* Find an input format by name. The function returns a value less than zero
* if Name is not a known input format.
*/
{
/* Search for the entry in the table */
const FileId* F = GetFileId (Name, FormatTable,
sizeof (FormatTable) / sizeof (FormatTable[0]));
return (F == 0)? -1 : F->Id;
}
Bitmap* ReadInputFile (const char* Name, InputFormat Format)
/* Read a bitmap from a file and return it. If Format is ifAuto, the routine
* tries to determine the format from the file name extension.