summaryrefslogtreecommitdiff
path: root/unsorted/ToolHelpers.c
diff options
context:
space:
mode:
Diffstat (limited to 'unsorted/ToolHelpers.c')
-rw-r--r--unsorted/ToolHelpers.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/unsorted/ToolHelpers.c b/unsorted/ToolHelpers.c
index 1942072..e872546 100644
--- a/unsorted/ToolHelpers.c
+++ b/unsorted/ToolHelpers.c
@@ -1,16 +1,16 @@
-#include "mwcc_decomp.h"
+#include "parser.h"
+#include "cmdline.h"
#include <errno.h>
-// TODO: figure out who defines this
extern char STSbuf[256];
static Boolean setStage;
-SInt16 outputOrdering;
-Boolean setOutputDirectory;
-Boolean setLinkerOutputFilename;
char linkerOutputFilename[256];
+Boolean setLinkerOutputFilename;
+Boolean setOutputDirectory;
+SInt16 outputOrdering;
-int Opt_HandleOutputName(const char *opt, void *, const char *filename) {
+int Opt_HandleOutputName(const char *opt, void *, const char *filename, int flags) {
OSSpec spec;
int err;
SInt32 result;
@@ -21,7 +21,7 @@ int Opt_HandleOutputName(const char *opt, void *, const char *filename) {
if ((pCmdLine.state == OptsCmdLineState_3 || (pCmdLine.state == OptsCmdLineState_0 && pTool->TYPE == CWDROPINLINKERTYPE)) && pCmdLine.toDisk != 4) {
if (setLinkerOutputFilename) {
- CLPReportError(41, filename);
+ CLPReportError(CLPStr41, filename);
return 0;
}
setLinkerOutputFilename = 1;
@@ -33,7 +33,7 @@ int Opt_HandleOutputName(const char *opt, void *, const char *filename) {
Boolean isfile;
err = OS_MakeSpec(filename, &spec, &isfile);
if (err) {
- CLPOSAlert(64, err, filename);
+ CLPOSAlert(CLPStr64, err, filename);
return 0;
}
if (isfile)
@@ -44,14 +44,14 @@ int Opt_HandleOutputName(const char *opt, void *, const char *filename) {
} else {
err = OS_MakeSpec(filename, &spec, &isfile);
if (err) {
- CLPOSAlert(64, err, filename);
+ CLPOSAlert(CLPStr64, err, filename);
return 0;
}
if (!err && !isfile) {
FSSpec ofd;
if (setOutputDirectory) {
- CLPReportError(59, filename);
+ CLPReportError(CLPStr59, filename);
return 0;
}
setOutputDirectory = 1;
@@ -67,7 +67,7 @@ int Opt_HandleOutputName(const char *opt, void *, const char *filename) {
SInt32 index;
CWProjectFileInfo pfi;
if (parseopts.lastoutputname[0]) {
- CLPReportError(41, filename);
+ CLPReportError(CLPStr41, filename);
return 0;
}
strncpy(parseopts.lastoutputname, filename, 256);
@@ -115,7 +115,7 @@ int ValidateToolState(Boolean mustHaveFiles) {
if (!parseopts.userSpecifiedFiles) {
if (!parseopts.hadAnyOutput) {
if (mustHaveFiles) {
- CLPReportError(70);
+ CLPReportError(CLPStr70);
return 0;
}
} else {
@@ -124,7 +124,7 @@ int ValidateToolState(Boolean mustHaveFiles) {
return 1;
}
} else if (parseopts.unusedFiles > 0) {
- CLPReportError(69);
+ CLPReportError(CLPStr69);
return 0;
}
}
@@ -195,7 +195,7 @@ int Opt_DoNotLink(const char *opt, void *var, const char *arg) {
return 1;
}
-int Opt_IncreaseVerbosity(const char *opt, void *var, const char *arg) {
+int Opt_IncreaseVerbosity(const char *opt, void *var, const char *arg, int flags) {
if (pCmdLine.verbose)
pCmdLine.verbose++;
else
@@ -275,13 +275,13 @@ int Opt_RedirectStream(const char *opt, void *file, const char *filename) {
err = OS_MakeFileSpec(filename, &spec);
if (err) {
- CLPReportError(78, filename, OS_GetErrText(err));
+ CLPReportError(CLPStr78, filename, OS_GetErrText(err));
return 0;
}
nw = freopen(OS_SpecToString(&spec, STSbuf, 256), "wt", (FILE *) file);
if (!nw) {
- CLPReportError(78, filename, strerror(errno));
+ CLPReportError(CLPStr78, filename, strerror(errno));
return 0;
}