summaryrefslogtreecommitdiff
path: root/command_line/CmdLine/Src/CLFileOps.c
diff options
context:
space:
mode:
Diffstat (limited to 'command_line/CmdLine/Src/CLFileOps.c')
-rw-r--r--command_line/CmdLine/Src/CLFileOps.c92
1 files changed, 46 insertions, 46 deletions
diff --git a/command_line/CmdLine/Src/CLFileOps.c b/command_line/CmdLine/Src/CLFileOps.c
index a5976be..a79522a 100644
--- a/command_line/CmdLine/Src/CLFileOps.c
+++ b/command_line/CmdLine/Src/CLFileOps.c
@@ -13,7 +13,7 @@ static int OutputTextData(File *file, SInt16 stage, OSType maccreator, OSType ma
ret = ShowHandle(file->textdata, size, 0);
} else {
if (optsCmdLine.verbose)
- CLReport(15, OS_SpecToStringRelative(&file->outfss, NULL, STSbuf, sizeof(STSbuf)));
+ CLReport(CLStr15, OS_SpecToStringRelative(&file->outfss, NULL, STSbuf, sizeof(STSbuf)));
ret = WriteHandleToFile(&file->outfss, file->textdata, size, maccreator, mactype);
file->wroteToDisk |= stage;
}
@@ -145,7 +145,7 @@ int GetOutputFile(File *file, SInt16 stage) {
if (!err) {
if (OS_EqualSpec(&file->srcfss, &file->outfss)) {
if (specifiedName) {
- CLReportError(102, targetoutfilename);
+ CLReportError(CLStr102, targetoutfilename);
file->writeToDisk &= ~stage;
file->tempOnDisk &= ~stage;
return 0;
@@ -170,7 +170,7 @@ static int PreprocessFile(File *file) {
const CWObjectFlags *cof;
if (!(file->dropinflags & kCanpreprocess)) {
- CLReportWarning(53, Plugin_GetDropInName(file->compiler), file->srcfilename);
+ CLReportWarning(CLStr53, Plugin_GetDropInName(file->compiler), file->srcfilename);
return 1;
}
@@ -188,7 +188,7 @@ static int PreprocessFile(File *file) {
optsCompiler.ppFileType ? optsCompiler.ppFileType : cof->ppFileType);
}
- CLReportError(96, "preprocessing", file->srcfilename);
+ CLReportError(CLStr96, "preprocessing", file->srcfilename);
return 0;
}
@@ -228,7 +228,7 @@ static int RecordBrowseInfo(File *file) {
return 1;
if (!file->browsedata) {
- CLReportError(101, Plugin_GetDropInName(file->compiler), OS_SpecToStringRelative(&file->srcfss, NULL, STSbuf, sizeof(STSbuf)));
+ CLReportError(CLStr101, Plugin_GetDropInName(file->compiler), OS_SpecToStringRelative(&file->srcfss, NULL, STSbuf, sizeof(STSbuf)));
return 0;
}
@@ -278,7 +278,7 @@ static int CompileFile(File *file) {
int ret = 1;
if (!(file->dropinflags & kCanprecompile) && ((optsCompiler.forcePrecompile == 1) || (file->mappingflags & kPrecompile))) {
- CLReportWarning(54, Plugin_GetDropInName(file->compiler), file->srcfilename);
+ CLReportWarning(CLStr54, Plugin_GetDropInName(file->compiler), file->srcfilename);
return 1;
}
@@ -294,7 +294,7 @@ static int CompileFile(File *file) {
file->recordbrowseinfo = ret < 0;
file->browseFileID = id;
if (optsCmdLine.verbose > 1)
- CLReport(22, file->srcfilename, file->browseFileID);
+ CLReport(CLStr22, file->srcfilename, file->browseFileID);
} else {
memset(file->browseoptions, 0, sizeof(file->browseoptions));
file->recordbrowseinfo = 0;
@@ -306,7 +306,7 @@ static int CompileFile(File *file) {
ret = 0;
} else {
if ((!file->hasobjectcode || !file->objectdata) && (file->dropinflags & kGeneratescode) && (file->objectUsage & 2)) {
- CLReportError(96, "compiling", file->srcfilename);
+ CLReportError(CLStr96, "compiling", file->srcfilename);
ret = 0;
} else if (optsCmdLine.state == OptsCmdLineState_2 && !StoreObjectFile(file)) {
ret = 0;
@@ -334,7 +334,7 @@ static int DisassembleFile(File *file) {
Plugin *disasm;
if (!file->hasobjectcode && !file->hasresources) {
- CLReportError(56, file->srcfilename);
+ CLReportError(CLStr56, file->srcfilename);
return 0;
}
@@ -352,7 +352,7 @@ static int DisassembleFile(File *file) {
optsCompiler.disFileCreator ? optsCompiler.disFileCreator : cof->disFileCreator,
optsCompiler.disFileType ? optsCompiler.disFileType : cof->disFileType);
}
- CLReportError(96, "disassembling", file->srcfilename);
+ CLReportError(CLStr96, "disassembling", file->srcfilename);
return 0;
} else {
@@ -370,7 +370,7 @@ static int DisassembleFile(File *file) {
optsCompiler.disFileCreator ? optsCompiler.disFileCreator : cof->disFileCreator,
optsCompiler.disFileType ? optsCompiler.disFileType : cof->disFileType);
}
- CLReportError(96, "disassembling", file->srcfilename);
+ CLReportError(CLStr96, "disassembling", file->srcfilename);
}
return 0;
}
@@ -383,15 +383,15 @@ static int DisassembleFile(File *file) {
optsCompiler.disFileCreator ? optsCompiler.disFileCreator : cof->disFileCreator,
optsCompiler.disFileType ? optsCompiler.disFileType : cof->disFileType);
}
- CLReportError(96, "disassembling", file->srcfilename);
+ CLReportError(CLStr96, "disassembling", file->srcfilename);
}
return 0;
}
if (gTarg->linker)
- CLReportError(58, Plugin_GetDropInName(gTarg->linker), Plugin_GetDropInName(file->compiler), file->srcfilename);
+ CLReportError(CLStr58, Plugin_GetDropInName(gTarg->linker), Plugin_GetDropInName(file->compiler), file->srcfilename);
else
- CLReportError(57, Plugin_GetDropInName(file->compiler), file->srcfilename);
+ CLReportError(CLStr57, Plugin_GetDropInName(file->compiler), file->srcfilename);
return 0;
}
@@ -437,10 +437,10 @@ static int CompileEntry(File *file, Boolean *compiled) {
const char *cun;
const char *dun;
const char *uun;
- CLReport(25, file->compiledlines);
+ CLReport(CLStr25, file->compiledlines);
tinfo->linesCompiled += file->compiledlines;
cun = dun = uun = "bytes";
- CLReport(26, file->codesize, cun, file->idatasize, dun, file->udatasize, uun);
+ CLReport(CLStr26, file->codesize, cun, file->idatasize, dun, file->udatasize, uun);
}
tinfo->codeSize += file->codesize;
tinfo->iDataSize += file->idatasize;
@@ -451,9 +451,9 @@ static int CompileEntry(File *file, Boolean *compiled) {
if (optsCmdLine.timeWorking) {
if (optsCmdLine.verbose)
- CLReport(24, (endWork - beginWork) / 1000.0, "compile", "", "", "");
+ CLReport(CLStr24, (endWork - beginWork) / 1000.0, "compile", "", "", "");
else
- CLReport(24, (endWork - beginWork) / 1000.0, "compile", "'", file->srcfilename, "'");
+ CLReport(CLStr24, (endWork - beginWork) / 1000.0, "compile", "'", file->srcfilename, "'");
}
return 1;
@@ -463,16 +463,16 @@ static void DumpFileAndPathInfo(void) {
int i;
int n;
- CLReport(84, "Framework search paths ([d] = default, [r] = recursive)");
+ CLReport(CLStr84, "Framework search paths ([d] = default, [r] = recursive)");
n = Paths_Count(&FrameworkPaths);
if (!n) {
- CLReport(85, "(none)", "");
+ CLReport(CLStr85, "(none)", "");
} else {
for (i = 0; i < n; i++) {
Path *path = Paths_GetPath(&FrameworkPaths, i);
OS_ASSERT(961, path != NULL);
- CLReport(85,
+ CLReport(CLStr85,
OS_PathSpecToString(path->spec, STSbuf, sizeof(STSbuf)),
((path->flags & 2) && path->recursive) ? " [d] [r]" : (path->flags & 2) ? " [d]" : path->recursive ? " [r]" : ""
);
@@ -482,7 +482,7 @@ static void DumpFileAndPathInfo(void) {
for (j = 0; j < Paths_Count(path->recursive); j++) {
Path *sub = Paths_GetPath(path->recursive, j);
OS_ASSERT(976, sub);
- CLReport(85, "\t", OS_PathSpecToString(sub->spec, STSbuf, sizeof(STSbuf)));
+ CLReport(CLStr85, "\t", OS_PathSpecToString(sub->spec, STSbuf, sizeof(STSbuf)));
}
}
}
@@ -490,7 +490,7 @@ static void DumpFileAndPathInfo(void) {
n = Frameworks_GetCount();
if (Frameworks_GetCount()) {
- CLReport(84, "Included frameworks");
+ CLReport(CLStr84, "Included frameworks");
for (i = 0; i < n; i++) {
char version[80];
Paths_FWInfo *info = Frameworks_GetInfo(i);
@@ -504,23 +504,23 @@ static void DumpFileAndPathInfo(void) {
strncat(version, info->version.s, sizeof(version) - 4);
strcat(version, ")");
}
- CLReport(85, info->name.s, version);
+ CLReport(CLStr85, info->name.s, version);
}
}
if (clState.plugintype == CWDROPINCOMPILERTYPE)
- CLReport(84, "User include search paths ([d] = default, [r] = recursive)");
+ CLReport(CLStr84, "User include search paths ([d] = default, [r] = recursive)");
else
- CLReport(84, "Library search paths ([d] = default, [r] = recursive)");
+ CLReport(CLStr84, "Library search paths ([d] = default, [r] = recursive)");
if (!Paths_Count(&gTarg->userPaths) && clState.plugintype == CWDROPINCOMPILERTYPE) {
- CLReport(85, "(none)", "");
+ CLReport(CLStr85, "(none)", "");
} else {
for (i = 0; i < Paths_Count(&gTarg->userPaths); i++) {
Path *path = Paths_GetPath(&gTarg->userPaths, i);
OS_ASSERT(1024, path != NULL);
- CLReport(85,
+ CLReport(CLStr85,
OS_PathSpecToString(path->spec, STSbuf, sizeof(STSbuf)),
((path->flags & 2) && path->recursive) ? " [d] [r]" : (path->flags & 2) ? " [d]" : path->recursive ? " [r]" : ""
);
@@ -530,23 +530,23 @@ static void DumpFileAndPathInfo(void) {
for (j = 0; j < Paths_Count(path->recursive); j++) {
Path *sub = Paths_GetPath(path->recursive, j);
OS_ASSERT(1039, sub);
- CLReport(85, "\t", OS_PathSpecToString(sub->spec, STSbuf, sizeof(STSbuf)));
+ CLReport(CLStr85, "\t", OS_PathSpecToString(sub->spec, STSbuf, sizeof(STSbuf)));
}
}
}
}
if (clState.plugintype == CWDROPINCOMPILERTYPE)
- CLReport(84, "System include search paths ([d] = default, [r] = recursive)");
+ CLReport(CLStr84, "System include search paths ([d] = default, [r] = recursive)");
if (!Paths_Count(&gTarg->sysPaths))
- CLReport(85, "(none)", "");
+ CLReport(CLStr85, "(none)", "");
for (i = 0; i < Paths_Count(&gTarg->sysPaths); i++) {
Path *path = Paths_GetPath(&gTarg->sysPaths, i);
OS_ASSERT(1054, path != NULL);
- CLReport(85,
+ CLReport(CLStr85,
OS_PathSpecToString(path->spec, STSbuf, sizeof(STSbuf)),
((path->flags & 2) && path->recursive) ? " [d] [r]" : (path->flags & 2) ? " [d]" : path->recursive ? " [r]" : ""
);
@@ -556,22 +556,22 @@ static void DumpFileAndPathInfo(void) {
for (j = 0; j < Paths_Count(path->recursive); j++) {
Path *sub = Paths_GetPath(path->recursive, j);
OS_ASSERT(1069, sub);
- CLReport(85, "\t", OS_PathSpecToString(sub->spec, STSbuf, sizeof(STSbuf)));
+ CLReport(CLStr85, "\t", OS_PathSpecToString(sub->spec, STSbuf, sizeof(STSbuf)));
}
}
}
if (clState.plugintype == CWDROPINCOMPILERTYPE)
- CLReport(84, "Files in project (relative to CWD)");
+ CLReport(CLStr84, "Files in project (relative to CWD)");
else
- CLReport(84, "Link order for project (relative to CWD)");
+ CLReport(CLStr84, "Link order for project (relative to CWD)");
for (i = 0; i < Files_Count(&gTarg->files); i++) {
File *file = Files_GetFile(&gTarg->files, i);
if (!VFiles_Find(gTarg->virtualFiles, file->srcfilename))
- CLReport(85, OS_SpecToStringRelative(&file->srcfss, NULL, STSbuf, sizeof(STSbuf)), "");
+ CLReport(CLStr85, OS_SpecToStringRelative(&file->srcfss, NULL, STSbuf, sizeof(STSbuf)), "");
else
- CLReport(85, file->srcfilename, "\t(virtual file)");
+ CLReport(CLStr85, file->srcfilename, "\t(virtual file)");
}
}
@@ -655,16 +655,16 @@ int CompileFilesInProject(void) {
const char *dun;
const char *uun;
cun = dun = uun = "bytes";
- CLReport(27, tinfo->codeSize, cun, tinfo->iDataSize, dun, tinfo->uDataSize, uun);
+ CLReport(CLStr27, tinfo->codeSize, cun, tinfo->iDataSize, dun, tinfo->uDataSize, uun);
}
endTime = OS_GetMilliseconds();
if (optsCmdLine.timeWorking)
- CLReport(24, (endTime - startTime) / 1000.0, "compile", "", "", "project");
+ CLReport(CLStr24, (endTime - startTime) / 1000.0, "compile", "", "", "project");
if (ignored > 0 && compiled == 0 && (gTarg->preLinker || gTarg->linker))
- CLReportError(29);
+ CLReportError(CLStr29);
if (failed)
return Result_Failed;
@@ -696,7 +696,7 @@ static int PostLinkFilesInProject(void) {
endTime = OS_GetMilliseconds();
if (optsCmdLine.timeWorking)
- CLReport(24, (endTime - startTime) / 1000.0, "compile", "", "", "project");
+ CLReport(CLStr24, (endTime - startTime) / 1000.0, "compile", "", "", "project");
return CheckForUserBreak() ? Result_Cancelled : Result_Success;
}
@@ -726,7 +726,7 @@ int LinkProject(void) {
subEnd = OS_GetMilliseconds();
if (optsCmdLine.timeWorking)
- CLReport(24, (subEnd - subStart) / 1000.0, "prelink project", "", "", "");
+ CLReport(CLStr24, (subEnd - subStart) / 1000.0, "prelink project", "", "", "");
}
if (gTarg->linker && optsLinker.callLinker && optsCmdLine.state == OptsCmdLineState_3) {
@@ -744,7 +744,7 @@ int LinkProject(void) {
subEnd = OS_GetMilliseconds();
if (optsCmdLine.timeWorking)
- CLReport(24, (subEnd - subStart) / 1000.0, "link project", "", "", "");
+ CLReport(CLStr24, (subEnd - subStart) / 1000.0, "link project", "", "", "");
}
if (gTarg->postLinker && optsLinker.callPostLinker && optsCmdLine.state == OptsCmdLineState_3) {
@@ -772,12 +772,12 @@ int LinkProject(void) {
subEnd = OS_GetMilliseconds();
if (optsCmdLine.timeWorking)
- CLReport(24, (subEnd - subStart) / 1000.0, "postlink project", "", "", "");
+ CLReport(CLStr24, (subEnd - subStart) / 1000.0, "postlink project", "", "", "");
if (!optsLinker.keepLinkerOutput && gTarg->targetinfo->outputType == linkOutputFile) {
if (optsCmdLine.verbose > 1) {
OS_FSSpec_To_OSSpec(&fss, &outfile);
- CLReport(19, OS_SpecToString(&outfile, STSbuf, sizeof(STSbuf)));
+ CLReport(CLStr19, OS_SpecToString(&outfile, STSbuf, sizeof(STSbuf)));
}
FSpDelete(&fss);
}
@@ -789,7 +789,7 @@ int LinkProject(void) {
endTime = OS_GetMilliseconds();
if (optsCmdLine.timeWorking)
- CLReport(24, (endTime - startTime) / 1000.0, "finish link stage", "", "", "");
+ CLReport(CLStr24, (endTime - startTime) / 1000.0, "finish link stage", "", "", "");
return Result_Success;
}