mirror of
https://github.com/cc65/cc65.git
synced 2025-01-10 19:29:45 +00:00
Added command line response files
git-svn-id: svn://svn.cc65.org/cc65/trunk@616 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
18b9977039
commit
697abf3ed7
@ -6,20 +6,20 @@
|
|||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* (C) 1998 Ullrich von Bassewitz */
|
/* (C) 1998-2001 Ullrich von Bassewitz */
|
||||||
/* Wacholderweg 14 */
|
/* Wacholderweg 14 */
|
||||||
/* D-70597 Stuttgart */
|
/* D-70597 Stuttgart */
|
||||||
/* EMail: uz@musoftware.de */
|
/* EMail: uz@musoftware.de */
|
||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* This software is provided 'as-is', without any expressed or implied */
|
/* This software is provided 'as-is', without any expressed or implied */
|
||||||
/* warranty. In no event will the authors be held liable for any damages */
|
/* warranty. In no event will the authors be held liable for any damages */
|
||||||
/* arising from the use of this software. */
|
/* arising from the use of this software. */
|
||||||
/* */
|
/* */
|
||||||
/* Permission is granted to anyone to use this software for any purpose, */
|
/* Permission is granted to anyone to use this software for any purpose, */
|
||||||
/* including commercial applications, and to alter it and redistribute it */
|
/* including commercial applications, and to alter it and redistribute it */
|
||||||
/* freely, subject to the following restrictions: */
|
/* freely, subject to the following restrictions: */
|
||||||
/* */
|
/* */
|
||||||
/* 1. The origin of this software must not be misrepresented; you must not */
|
/* 1. The origin of this software must not be misrepresented; you must not */
|
||||||
/* claim that you wrote the original software. If you use this software */
|
/* claim that you wrote the original software. If you use this software */
|
||||||
/* in a product, an acknowledgment in the product documentation would be */
|
/* in a product, an acknowledgment in the product documentation would be */
|
||||||
@ -28,7 +28,7 @@
|
|||||||
/* be misrepresented as being the original software. */
|
/* be misrepresented as being the original software. */
|
||||||
/* 3. This notice may not be removed or altered from any source */
|
/* 3. This notice may not be removed or altered from any source */
|
||||||
/* distribution. */
|
/* distribution. */
|
||||||
/* */
|
/* */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
@ -38,8 +38,9 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#include "../common/cmdline.h"
|
/* common */
|
||||||
#include "../common/version.h"
|
#include "cmdline.h"
|
||||||
|
#include "version.h"
|
||||||
|
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "add.h"
|
#include "add.h"
|
||||||
@ -78,19 +79,19 @@ int main (int argc, char* argv [])
|
|||||||
int I;
|
int I;
|
||||||
|
|
||||||
/* Initialize the cmdline module */
|
/* Initialize the cmdline module */
|
||||||
InitCmdLine (argc, argv, "ar65");
|
InitCmdLine (&argc, &argv, "ar65");
|
||||||
|
|
||||||
/* We must have a file name */
|
/* We must have a file name */
|
||||||
if (argc < 2) {
|
if (ArgCount < 2) {
|
||||||
Usage ();
|
Usage ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check the parameters */
|
/* Check the parameters */
|
||||||
I = 1;
|
I = 1;
|
||||||
while (I < argc) {
|
while (I < ArgCount) {
|
||||||
|
|
||||||
/* Get the argument */
|
/* Get the argument */
|
||||||
const char* Arg = argv [I];
|
const char* Arg = ArgVec [I];
|
||||||
|
|
||||||
/* Check for an option */
|
/* Check for an option */
|
||||||
if (strlen (Arg) != 1) {
|
if (strlen (Arg) != 1) {
|
||||||
@ -99,15 +100,15 @@ int main (int argc, char* argv [])
|
|||||||
switch (Arg [0]) {
|
switch (Arg [0]) {
|
||||||
|
|
||||||
case 'a':
|
case 'a':
|
||||||
AddObjFiles (argc - I - 1, &argv [I+1]);
|
AddObjFiles (ArgCount - I - 1, &ArgVec[I+1]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'd':
|
case 'd':
|
||||||
DelObjFiles (argc - I - 1, &argv [I+1]);
|
DelObjFiles (ArgCount - I - 1, &ArgVec [I+1]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'l':
|
case 'l':
|
||||||
ListObjFiles (argc - I - 1, &argv [I+1]);
|
ListObjFiles (ArgCount - I - 1, &ArgVec [I+1]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'v':
|
case 'v':
|
||||||
@ -115,7 +116,7 @@ int main (int argc, char* argv [])
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'x':
|
case 'x':
|
||||||
ExtractObjFiles (argc - I - 1, &argv [I+1]);
|
ExtractObjFiles (ArgCount - I - 1, &ArgVec [I+1]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'V':
|
case 'V':
|
||||||
|
@ -508,7 +508,7 @@ int main (int argc, char* argv [])
|
|||||||
int I;
|
int I;
|
||||||
|
|
||||||
/* Initialize the cmdline module */
|
/* Initialize the cmdline module */
|
||||||
InitCmdLine (argc, argv, "ca65");
|
InitCmdLine (&argc, &argv, "ca65");
|
||||||
|
|
||||||
/* Enter the base lexical level. We must do that here, since we may
|
/* Enter the base lexical level. We must do that here, since we may
|
||||||
* define symbols using -D.
|
* define symbols using -D.
|
||||||
@ -517,10 +517,10 @@ int main (int argc, char* argv [])
|
|||||||
|
|
||||||
/* Check the parameters */
|
/* Check the parameters */
|
||||||
I = 1;
|
I = 1;
|
||||||
while (I < argc) {
|
while (I < ArgCount) {
|
||||||
|
|
||||||
/* Get the argument */
|
/* Get the argument */
|
||||||
const char* Arg = argv [I];
|
const char* Arg = ArgVec [I];
|
||||||
|
|
||||||
/* Check for an option */
|
/* Check for an option */
|
||||||
if (Arg [0] == '-') {
|
if (Arg [0] == '-') {
|
||||||
|
@ -455,19 +455,19 @@ int main (int argc, char* argv[])
|
|||||||
const char* InputFile = 0;
|
const char* InputFile = 0;
|
||||||
|
|
||||||
/* Initialize the cmdline module */
|
/* Initialize the cmdline module */
|
||||||
InitCmdLine (argc, argv, "cc65");
|
InitCmdLine (&argc, &argv, "cc65");
|
||||||
|
|
||||||
/* Initialize the default segment names */
|
/* Initialize the default segment names */
|
||||||
InitSegNames ();
|
InitSegNames ();
|
||||||
|
|
||||||
/* Parse the command line */
|
/* Parse the command line */
|
||||||
I = 1;
|
I = 1;
|
||||||
while (I < argc) {
|
while (I < ArgCount) {
|
||||||
|
|
||||||
const char* P;
|
const char* P;
|
||||||
|
|
||||||
/* Get the argument */
|
/* Get the argument */
|
||||||
const char* Arg = argv [I];
|
const char* Arg = ArgVec[I];
|
||||||
|
|
||||||
/* Check for an option */
|
/* Check for an option */
|
||||||
if (Arg [0] == '-') {
|
if (Arg [0] == '-') {
|
||||||
|
@ -733,7 +733,7 @@ int main (int argc, char* argv [])
|
|||||||
int I;
|
int I;
|
||||||
|
|
||||||
/* Initialize the cmdline module */
|
/* Initialize the cmdline module */
|
||||||
InitCmdLine (argc, argv, "cl65");
|
InitCmdLine (&argc, &argv, "cl65");
|
||||||
|
|
||||||
/* Initialize the command descriptors */
|
/* Initialize the command descriptors */
|
||||||
CmdInit (&CC65, "cc65");
|
CmdInit (&CC65, "cc65");
|
||||||
@ -743,13 +743,13 @@ int main (int argc, char* argv [])
|
|||||||
|
|
||||||
/* Our default target is the C64 instead of "none" */
|
/* Our default target is the C64 instead of "none" */
|
||||||
Target = TGT_C64;
|
Target = TGT_C64;
|
||||||
|
|
||||||
/* Check the parameters */
|
/* Check the parameters */
|
||||||
I = 1;
|
I = 1;
|
||||||
while (I < argc) {
|
while (I < ArgCount) {
|
||||||
|
|
||||||
/* Get the argument */
|
/* Get the argument */
|
||||||
const char* Arg = argv [I];
|
const char* Arg = ArgVec[I];
|
||||||
|
|
||||||
/* Check for an option */
|
/* Check for an option */
|
||||||
if (Arg [0] == '-') {
|
if (Arg [0] == '-') {
|
||||||
|
@ -86,6 +86,14 @@ int IsBlank (char C)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int IsSpace (char C)
|
||||||
|
/* Check for any white space characters */
|
||||||
|
{
|
||||||
|
return (C == ' ' || C == '\n' || C == '\r' || C == '\t' || C == '\v' || C == '\f');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int IsDigit (char C)
|
int IsDigit (char C)
|
||||||
/* Check for a digit */
|
/* Check for a digit */
|
||||||
{
|
{
|
||||||
|
@ -67,6 +67,9 @@ int IsAscii (char C);
|
|||||||
int IsBlank (char C);
|
int IsBlank (char C);
|
||||||
/* Check for a space or tab */
|
/* Check for a space or tab */
|
||||||
|
|
||||||
|
int IsSpace (char C);
|
||||||
|
/* Check for any white space characters */
|
||||||
|
|
||||||
int IsDigit (char C);
|
int IsDigit (char C);
|
||||||
/* Check for a digit */
|
/* Check for a digit */
|
||||||
|
|
||||||
|
@ -33,9 +33,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
|
/* common */
|
||||||
#include "abend.h"
|
#include "abend.h"
|
||||||
|
#include "chartype.h"
|
||||||
|
#include "xmalloc.h"
|
||||||
#include "cmdline.h"
|
#include "cmdline.h"
|
||||||
|
|
||||||
|
|
||||||
@ -50,8 +55,112 @@
|
|||||||
const char* ProgName;
|
const char* ProgName;
|
||||||
|
|
||||||
/* The program argument vector */
|
/* The program argument vector */
|
||||||
static char** ArgVec = 0;
|
char** ArgVec = 0;
|
||||||
static unsigned ArgCount = 0;
|
unsigned ArgCount = 0;
|
||||||
|
|
||||||
|
/* Struct to pass the command line */
|
||||||
|
typedef struct {
|
||||||
|
char** Vec; /* The argument vector */
|
||||||
|
unsigned Count; /* Actual number of arguments */
|
||||||
|
unsigned Size; /* Number of argument allocated */
|
||||||
|
} CmdLine;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* Helper functions */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static void NewCmdLine (CmdLine* L)
|
||||||
|
/* Initialize a CmdLine struct */
|
||||||
|
{
|
||||||
|
unsigned I;
|
||||||
|
|
||||||
|
/* Initialize the struct */
|
||||||
|
L->Size = 8;
|
||||||
|
L->Count = 0;
|
||||||
|
L->Vec = xmalloc (L->Size * sizeof (L->Vec[0]));
|
||||||
|
|
||||||
|
/* Copy the arguments. We have to allocate them on free store, otherwise
|
||||||
|
* we would have to keep track which one is on free store and which not,
|
||||||
|
* which is a lot more overhead.
|
||||||
|
*/
|
||||||
|
for (I = 0; I < L->Count; ++I) {
|
||||||
|
L->Vec[I] = xstrdup (ArgVec[I]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static void AddArg (CmdLine* L, const char* Arg)
|
||||||
|
/* Add one argument to the list */
|
||||||
|
{
|
||||||
|
if (L->Size <= L->Count) {
|
||||||
|
/* No space left, reallocate */
|
||||||
|
unsigned NewSize = L->Size * 2;
|
||||||
|
char** NewVec = xmalloc (NewSize * sizeof (L->Vec[0]));
|
||||||
|
memcpy (NewVec, L->Vec, L->Count * sizeof (L->Vec[0]));
|
||||||
|
xfree (L->Vec);
|
||||||
|
L->Vec = NewVec;
|
||||||
|
L->Size = NewSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* We have space left, add a copy of the argument */
|
||||||
|
L->Vec [L->Count++] = xstrdup (Arg);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static void ExpandFile (CmdLine* L, const char* Name)
|
||||||
|
/* Add the contents of a file to the command line. Each line is a separate
|
||||||
|
* argument with leading and trailing whitespace removed.
|
||||||
|
*/
|
||||||
|
{
|
||||||
|
char Buf [256];
|
||||||
|
|
||||||
|
/* Try to open the file for reading */
|
||||||
|
FILE* F = fopen (Name, "r");
|
||||||
|
if (F == 0) {
|
||||||
|
AbEnd ("Cannot open \"%s\": %s", Name, strerror (errno));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* File is open, read all lines */
|
||||||
|
while (fgets (Buf, sizeof (Buf), F) != 0) {
|
||||||
|
|
||||||
|
/* Get a pointer to the buffer */
|
||||||
|
const char* B = Buf;
|
||||||
|
|
||||||
|
/* Skip trailing whitespace (this will also kill the newline that is
|
||||||
|
* appended by fgets().
|
||||||
|
*/
|
||||||
|
unsigned Len = strlen (Buf);
|
||||||
|
while (Len > 0 && IsSpace (Buf [Len-1])) {
|
||||||
|
--Len;
|
||||||
|
}
|
||||||
|
Buf [Len] = '\0';
|
||||||
|
|
||||||
|
/* Skip leading spaces */
|
||||||
|
while (IsSpace (*B)) {
|
||||||
|
++B;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Skip empty lines to work around problems with some editors */
|
||||||
|
if (*B == '\0') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Add anything not empty to the command line */
|
||||||
|
AddArg (L, B);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Close the file, ignore errors here since we had the file open for
|
||||||
|
* reading only.
|
||||||
|
*/
|
||||||
|
(void) fclose (F);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -61,35 +170,69 @@ static unsigned ArgCount = 0;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void InitCmdLine (unsigned aArgCount, char* aArgVec[], const char* aProgName)
|
void InitCmdLine (unsigned* aArgCount, char** aArgVec[], const char* aProgName)
|
||||||
/* Initialize command line parsing. aArgVec is the argument array terminated by
|
/* Initialize command line parsing. aArgVec is the argument array terminated by
|
||||||
* a NULL pointer (as usual), ArgCount is the number of valid arguments in the
|
* a NULL pointer (as usual), ArgCount is the number of valid arguments in the
|
||||||
* array. Both arguments are remembered in static storage.
|
* array. Both arguments are remembered in static storage.
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
/* Remember the argument vector */
|
CmdLine L;
|
||||||
ArgCount = aArgCount;
|
unsigned I;
|
||||||
ArgVec = aArgVec;
|
|
||||||
|
|
||||||
/* Get the program name from argv[0] but strip a path */
|
/* Get the program name from argv[0] but strip a path */
|
||||||
if (ArgVec[0] == 0) {
|
if (*(aArgVec)[0] == 0) {
|
||||||
/* Use the default name given */
|
/* Use the default name given */
|
||||||
ProgName = aProgName;
|
ProgName = aProgName;
|
||||||
} else {
|
} else {
|
||||||
/* Strip a path */
|
/* Strip a path */
|
||||||
ProgName = strchr (ArgVec[0], '\0');
|
const char* FirstArg = (*aArgVec)[0];
|
||||||
while (ProgName > ArgVec[0]) {
|
ProgName = strchr (FirstArg, '\0');
|
||||||
--ProgName;
|
while (ProgName > FirstArg) {
|
||||||
|
--ProgName;
|
||||||
if (*ProgName == '/' || *ProgName == '\\') {
|
if (*ProgName == '/' || *ProgName == '\\') {
|
||||||
++ProgName;
|
++ProgName;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ProgName[0] == '\0') {
|
if (ProgName[0] == '\0') {
|
||||||
/* Use the default */
|
/* Use the default */
|
||||||
ProgName = aProgName;
|
ProgName = aProgName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Make a CmdLine struct */
|
||||||
|
NewCmdLine (&L);
|
||||||
|
|
||||||
|
/* Walk over the parameters and add them to the CmdLine struct. Add a
|
||||||
|
* special handling for arguments preceeded by the '@' sign - these are
|
||||||
|
* actually files containing arguments.
|
||||||
|
*/
|
||||||
|
for (I = 0; I < *aArgCount; ++I) {
|
||||||
|
|
||||||
|
/* Get the next argument */
|
||||||
|
char* Arg = (*aArgVec)[I];
|
||||||
|
|
||||||
|
/* Is this a file argument? */
|
||||||
|
if (Arg && Arg[0] == '@') {
|
||||||
|
|
||||||
|
/* Expand the file */
|
||||||
|
ExpandFile (&L, Arg+1);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
/* No file, just add a copy */
|
||||||
|
AddArg (&L, Arg);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Store the new argument list in a safe place... */
|
||||||
|
ArgCount = L.Count;
|
||||||
|
ArgVec = L.Vec;
|
||||||
|
|
||||||
|
/* ...and pass back the changed data also */
|
||||||
|
*aArgCount = L.Count;
|
||||||
|
*aArgVec = L.Vec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -51,6 +51,10 @@
|
|||||||
/* Program name - is set after call to InitCmdLine */
|
/* Program name - is set after call to InitCmdLine */
|
||||||
extern const char* ProgName;
|
extern const char* ProgName;
|
||||||
|
|
||||||
|
/* The program argument vector */
|
||||||
|
extern char** ArgVec;
|
||||||
|
extern unsigned ArgCount;
|
||||||
|
|
||||||
/* Structure defining a long option */
|
/* Structure defining a long option */
|
||||||
typedef struct LongOpt LongOpt;
|
typedef struct LongOpt LongOpt;
|
||||||
struct LongOpt {
|
struct LongOpt {
|
||||||
@ -67,7 +71,7 @@ struct LongOpt {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void InitCmdLine (unsigned aArgCount, char* aArgVec[], const char* aProgName);
|
void InitCmdLine (unsigned* aArgCount, char** aArgVec[], const char* aProgName);
|
||||||
/* Initialize command line parsing. aArgVec is the argument array terminated by
|
/* Initialize command line parsing. aArgVec is the argument array terminated by
|
||||||
* a NULL pointer (as usual), ArgCount is the number of valid arguments in the
|
* a NULL pointer (as usual), ArgCount is the number of valid arguments in the
|
||||||
* array. Both arguments are remembered in static storage.
|
* array. Both arguments are remembered in static storage.
|
||||||
@ -95,6 +99,6 @@ void LongOption (int* ArgNum, const LongOpt* OptTab, unsigned OptCount);
|
|||||||
/* End of cmdline.h */
|
/* End of cmdline.h */
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -75,11 +75,21 @@ void xfree (const void* Block)
|
|||||||
char* xstrdup (const char* S)
|
char* xstrdup (const char* S)
|
||||||
/* Duplicate a string on the heap. The function checks for out of memory */
|
/* Duplicate a string on the heap. The function checks for out of memory */
|
||||||
{
|
{
|
||||||
/* Get the length of the string */
|
/* Allow dup'ing of NULL strings */
|
||||||
unsigned Len = strlen (S) + 1;
|
if (S) {
|
||||||
|
|
||||||
/* Allocate memory and return a copy */
|
/* Get the length of the string */
|
||||||
return memcpy (xmalloc (Len), S, Len);
|
unsigned Len = strlen (S) + 1;
|
||||||
|
|
||||||
|
/* Allocate memory and return a copy */
|
||||||
|
return memcpy (xmalloc (Len), S, Len);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
/* Return a NULL pointer */
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -314,10 +314,10 @@ int main (int argc, char* argv [])
|
|||||||
/* Program long options */
|
/* Program long options */
|
||||||
static const LongOpt OptTab[] = {
|
static const LongOpt OptTab[] = {
|
||||||
{ "--cpu", 1, OptCPU },
|
{ "--cpu", 1, OptCPU },
|
||||||
{ "--formfeeds", 0, OptFormFeeds },
|
{ "--formfeeds", 0, OptFormFeeds },
|
||||||
{ "--help", 0, OptHelp },
|
{ "--help", 0, OptHelp },
|
||||||
{ "--pagelength", 1, OptPageLength },
|
{ "--pagelength", 1, OptPageLength },
|
||||||
{ "--start-addr", 1, OptStartAddr },
|
{ "--start-addr", 1, OptStartAddr },
|
||||||
{ "--verbose", 0, OptVerbose },
|
{ "--verbose", 0, OptVerbose },
|
||||||
{ "--version", 0, OptVersion },
|
{ "--version", 0, OptVersion },
|
||||||
};
|
};
|
||||||
@ -325,14 +325,14 @@ int main (int argc, char* argv [])
|
|||||||
int I;
|
int I;
|
||||||
|
|
||||||
/* Initialize the cmdline module */
|
/* Initialize the cmdline module */
|
||||||
InitCmdLine (argc, argv, "da65");
|
InitCmdLine (&argc, &argv, "da65");
|
||||||
|
|
||||||
/* Check the parameters */
|
/* Check the parameters */
|
||||||
I = 1;
|
I = 1;
|
||||||
while (I < argc) {
|
while (I < ArgCount) {
|
||||||
|
|
||||||
/* Get the argument */
|
/* Get the argument */
|
||||||
const char* Arg = argv [I];
|
const char* Arg = ArgVec[I];
|
||||||
|
|
||||||
/* Check for an option */
|
/* Check for an option */
|
||||||
if (Arg [0] == '-') {
|
if (Arg [0] == '-') {
|
||||||
|
@ -297,7 +297,7 @@ int main (int argc, char* argv [])
|
|||||||
int I;
|
int I;
|
||||||
|
|
||||||
/* Initialize the cmdline module */
|
/* Initialize the cmdline module */
|
||||||
InitCmdLine (argc, argv, "ld65");
|
InitCmdLine (&argc, &argv, "ld65");
|
||||||
|
|
||||||
/* Evaluate the CC65_LIB environment variable */
|
/* Evaluate the CC65_LIB environment variable */
|
||||||
LibPath = getenv ("CC65_LIB");
|
LibPath = getenv ("CC65_LIB");
|
||||||
@ -313,10 +313,10 @@ int main (int argc, char* argv [])
|
|||||||
|
|
||||||
/* Check the parameters */
|
/* Check the parameters */
|
||||||
I = 1;
|
I = 1;
|
||||||
while (I < argc) {
|
while (I < ArgCount) {
|
||||||
|
|
||||||
/* Get the argument */
|
/* Get the argument */
|
||||||
const char* Arg = argv [I];
|
const char* Arg = ArgVec[I];
|
||||||
|
|
||||||
/* Check for an option */
|
/* Check for an option */
|
||||||
if (Arg [0] == '-') {
|
if (Arg [0] == '-') {
|
||||||
|
@ -77,7 +77,7 @@ static void Usage (void)
|
|||||||
" -V\t\t\tPrint the version number and exit\n"
|
" -V\t\t\tPrint the version number and exit\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Long options:\n"
|
"Long options:\n"
|
||||||
" --dump-all\t\tDump all object file information\n"
|
" --dump-all\t\tDump all object file information\n"
|
||||||
" --dump-dbgsyms\tDump debug symbols\n"
|
" --dump-dbgsyms\tDump debug symbols\n"
|
||||||
" --dump-exports\tDump exported symbols\n"
|
" --dump-exports\tDump exported symbols\n"
|
||||||
" --dump-files\t\tDump the source files\n"
|
" --dump-files\t\tDump the source files\n"
|
||||||
@ -104,7 +104,7 @@ static void OptDumpDbgSyms (const char* Opt, const char* Arg)
|
|||||||
/* Dump debug symbols contained in the object file */
|
/* Dump debug symbols contained in the object file */
|
||||||
{
|
{
|
||||||
What |= D_DBGSYMS;
|
What |= D_DBGSYMS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -255,14 +255,14 @@ int main (int argc, char* argv [])
|
|||||||
int I;
|
int I;
|
||||||
|
|
||||||
/* Initialize the cmdline module */
|
/* Initialize the cmdline module */
|
||||||
InitCmdLine (argc, argv, "od65");
|
InitCmdLine (&argc, &argv, "od65");
|
||||||
|
|
||||||
/* Check the parameters */
|
/* Check the parameters */
|
||||||
I = 1;
|
I = 1;
|
||||||
while (I < argc) {
|
while (I < ArgCount) {
|
||||||
|
|
||||||
/* Get the argument */
|
/* Get the argument */
|
||||||
const char* Arg = argv [I];
|
const char* Arg = ArgVec[I];
|
||||||
|
|
||||||
/* Check for an option */
|
/* Check for an option */
|
||||||
if (Arg [0] == '-') {
|
if (Arg [0] == '-') {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user