MWCC/includes/cmdline.h

853 lines
28 KiB
C
Raw Normal View History

2022-10-25 19:30:28 +00:00
#ifndef CMDLINE_H
#define CMDLINE_H
#include "cw_common.h"
#include "pref_structs.h"
enum {
2023-01-15 21:50:41 +00:00
// "Could not get current working directory"
CLStr1 = 1,
2023-01-15 21:50:41 +00:00
// "Cannot find my executable '%s'"
CLStr2 = 2,
2023-01-15 21:50:41 +00:00
// "Could not initialize plugin '%s'"
CLStr3 = 3,
2023-01-15 21:50:41 +00:00
// "The %s '%s' requires functionality not present in the command-line driver."
CLStr4 = 4,
2023-01-15 21:50:41 +00:00
// "The command-line parser does not support these panels:"
CLStr5 = 5,
2023-01-15 21:50:41 +00:00
// "\t%s\n"
CLStr6 = 6,
2023-01-15 21:50:41 +00:00
// "Compiling function: '%s'"
CLStr7 = 7,
2023-01-15 21:50:41 +00:00
// "Could not write file '%s'"
CLStr8 = 8,
2023-01-15 21:50:41 +00:00
// "Could not write file '%s' in directory '%s'"
CLStr9 = 9,
2023-01-15 21:50:41 +00:00
// "Write error on output (errno=%ld)"
CLStr10 = 10,
2023-01-15 21:50:41 +00:00
// "Current working directory is too long"
CLStr11 = 11,
2023-01-15 21:50:41 +00:00
// "Unknown filetype '%c%c%c%c', defaulting to '%s'"
CLStr12 = 12,
2023-01-15 21:50:41 +00:00
// "%s:\ttype %s"
CLStr13 = 13,
2023-01-15 21:50:41 +00:00
// "Storing output for '%s' in '%s'"
CLStr14 = 14,
2023-01-15 21:50:41 +00:00
// "Writing text file '%s'"
CLStr15 = 15,
2023-01-15 21:50:41 +00:00
// "Writing %sobject file '%s'"
CLStr16 = 16,
2023-01-15 21:50:41 +00:00
// "Writing browse data '%s'"
CLStr17 = 17,
2023-01-15 21:50:41 +00:00
// "Could not write %s '%s' (error %ld)"
CLStr18 = 18,
2023-01-15 21:50:41 +00:00
// "Deleting temporary file '%s'"
CLStr19 = 19,
2023-01-15 21:50:41 +00:00
// "Could not resolve alias for '%s' (error %ld)"
CLStr20 = 20,
2023-01-15 21:50:41 +00:00
// "%s:\t'%s'%s"
CLStr21 = 21,
2023-01-15 21:50:41 +00:00
// "File '%s' has browse fileID %d"
CLStr22 = 22,
2023-01-15 21:50:41 +00:00
// "Can't locate directory '%s'"
CLStr23 = 23,
2023-01-15 21:50:41 +00:00
// " %8.2f seconds to %s %s%s%s"
CLStr24 = 24,
2023-01-15 21:50:41 +00:00
// " %8d lines compiled"
CLStr25 = 25,
2023-01-15 21:50:41 +00:00
// " %8d %s code\n %8d %s init'd data\n %8d %s uninit'd data"
CLStr26 = 26,
2023-01-15 21:50:41 +00:00
// " %8d total %s code\n %8d total %s init'd data\n %8d total %s uninit'd data"
CLStr27 = 27,
2023-01-15 21:50:41 +00:00
// "File '%s' is not compilable source, target object data, or command file; ignoring"
CLStr28 = 28,
2023-01-15 21:50:41 +00:00
// "All specified files were ignored"
CLStr29 = 29,
2023-01-15 21:50:41 +00:00
// "Compiling: '%s'"
CLStr30 = 30,
2023-01-15 21:50:41 +00:00
// "Compiling: '%s' with '%s'"
CLStr31 = 31,
2023-01-15 21:50:41 +00:00
// "Precompiling: '%s'"
CLStr32 = 32,
2023-01-15 21:50:41 +00:00
// "Precompiling: '%s' with '%s'"
CLStr33 = 33,
2023-01-15 21:50:41 +00:00
// "Preprocessing: '%s'"
CLStr34 = 34,
2023-01-15 21:50:41 +00:00
// "Preprocessing: '%s' with '%s'"
CLStr35 = 35,
2023-01-15 21:50:41 +00:00
// "Finding dependencies: '%s'"
CLStr36 = 36,
2023-01-15 21:50:41 +00:00
// "Finding dependencies: '%s' with '%s'"
CLStr37 = 37,
2023-01-15 21:50:41 +00:00
// "Importing: '%s'"
CLStr38 = 38,
2023-01-15 21:50:41 +00:00
// "Importing: '%s' with '%s'"
CLStr39 = 39,
2023-01-15 21:50:41 +00:00
// "Linking project"
CLStr40 = 40,
2023-01-15 21:50:41 +00:00
// "Linking project with '%s'"
CLStr41 = 41,
2023-01-15 21:50:41 +00:00
// "Pre-linking project"
CLStr42 = 42,
2023-01-15 21:50:41 +00:00
// "Pre-linking project with '%s'"
CLStr43 = 43,
2023-01-15 21:50:41 +00:00
// "Post-linking project"
CLStr44 = 44,
2023-01-15 21:50:41 +00:00
// "Post-linking project with '%s'"
CLStr45 = 45,
2023-01-15 21:50:41 +00:00
// "Disassembling: '%s'"
CLStr46 = 46,
2023-01-15 21:50:41 +00:00
// "Disassembling: '%s' with '%s'"
CLStr47 = 47,
2023-01-15 21:50:41 +00:00
// "Syntax checking: '%s'"
CLStr48 = 48,
2023-01-15 21:50:41 +00:00
// "Syntax checking: '%s' with '%s'"
CLStr49 = 49,
2023-01-15 21:50:41 +00:00
// "Getting target info from '%s'"
CLStr50 = 50,
2023-01-15 21:50:41 +00:00
// "Initializing '%s'"
CLStr51 = 51,
2023-01-15 21:50:41 +00:00
// "Terminating '%s'"
CLStr52 = 52,
2023-01-15 21:50:41 +00:00
// "'%s' cannot preprocess, skipping '%s'"
CLStr53 = 53,
2023-01-15 21:50:41 +00:00
// "'%s' cannot precompile, skipping '%s'"
CLStr54 = 54,
2023-01-15 21:50:41 +00:00
// "'%s' cannot generate code, skipping '%s'"
CLStr55 = 55,
2023-01-15 21:50:41 +00:00
// "'%s' has no object code to disassemble"
CLStr56 = 56,
2023-01-15 21:50:41 +00:00
// "'%s' cannot disassemble, skipping '%s'"
CLStr57 = 57,
2023-01-15 21:50:41 +00:00
// "Neither '%s' nor '%s' can disassemble, skipping '%s'"
CLStr58 = 58,
2023-01-15 21:50:41 +00:00
// "No precompiled header name given, '%s' assumed"
CLStr59 = 59,
2023-01-15 21:50:41 +00:00
// "Precompile target '%s' given on command line; source-specified name '%s' ignored"
CLStr60 = 60,
2023-01-15 21:50:41 +00:00
// "Writing precompiled %s file '%s'"
CLStr61 = 61,
2023-01-15 21:50:41 +00:00
// "Reading precompiled %s file '%s'"
CLStr62 = 62,
2023-01-15 21:50:41 +00:00
// "Cannot %s memory for %s"
CLStr63 = 63,
2023-01-15 21:50:41 +00:00
// "Files/directories must have length <= %ld characters;\n'%s' not accepted"
CLStr64 = 64,
2023-01-15 21:50:41 +00:00
// "Guessed linker name '%s' from compiler name '%s'"
CLStr65 = 65,
2023-01-15 21:50:41 +00:00
// "Can't find %s '%s' in path"
CLStr66 = 66,
2023-01-15 21:50:41 +00:00
// "Calling %s '%s'"
CLStr67 = 67,
2023-01-15 21:50:41 +00:00
// "Can't execute %s '%s' (%s)"
CLStr68 = 68,
2023-01-15 21:50:41 +00:00
// "%s '%s' returned with exit code %d"
CLStr69 = 69,
2023-01-15 21:50:41 +00:00
// "Too many errors printed, aborting program"
CLStr70 = 70,
2023-01-15 21:50:41 +00:00
// "Too many errors printed, suppressing errors for current file"
CLStr71 = 71,
2023-01-15 21:50:41 +00:00
// "Too many warnings printed, suppressing warnings for current file"
CLStr72 = 72,
2023-01-15 21:50:41 +00:00
// "No %s mapping matches '%s' (unrecognized file contents or filename extension); %s"
CLStr73 = 73,
2023-01-15 21:50:41 +00:00
// "No plugin or target matches the file '%s', ignoring"
CLStr74 = 74,
2023-01-15 21:50:41 +00:00
// "File '%s' cannot be handled by this tool, ignoring"
CLStr75 = 75,
2023-01-15 21:50:41 +00:00
// "File '%s' does not match the active target"
CLStr76 = 76,
2023-01-15 21:50:41 +00:00
// "Adding%s:\t'%s'"
CLStr77 = 77,
2023-01-15 21:50:41 +00:00
// "Creating new overlay '%s' in group '%s'"
CLStr78 = 78,
2023-01-15 21:50:41 +00:00
// "Creating new overlay group '%s' at addr %08X:%08X"
CLStr79 = 79,
2023-01-15 21:50:41 +00:00
// "File '%s' cannot be added to overlay group; define an overlay in the group first"
CLStr80 = 80,
2023-01-15 21:50:41 +00:00
// "Cannot create virtual export file '%s' (from '-export name,...')"
CLStr81 = 81,
2023-01-15 21:50:41 +00:00
// "Too many %s defined; at most %d%s is allowed"
CLStr82 = 82,
2023-01-15 21:50:41 +00:00
// "Loading preference panel '%s'"
CLStr83 = 83,
2023-01-15 21:50:41 +00:00
// "%s:"
CLStr84 = 84,
2023-01-15 21:50:41 +00:00
// "\t%s%s"
CLStr85 = 85,
2023-01-15 21:50:41 +00:00
// "Already defined %s search path; '%s' added after other paths"
CLStr86 = 86,
2023-01-15 21:50:41 +00:00
// "License check failed: %s"
CLStr87 = 87,
2023-01-15 21:50:41 +00:00
// "The plugin '%s' (version '%s') cannot be used:\n%s"
CLStr88 = 88,
2023-01-15 21:50:41 +00:00
// "Plugin '%s' has already been registered"
CLStr89 = 89,
2023-01-15 21:50:41 +00:00
// "Preferences for '%s' have already been registered"
CLStr90 = 90,
2023-01-15 21:50:41 +00:00
// "Preferences for '%s' not found"
CLStr91 = 91,
2023-01-15 21:50:41 +00:00
// "Some preferences needed by the plugin '%s' have not been registered"
CLStr92 = 92,
2023-01-15 21:50:41 +00:00
// "Could not load file '%s'"
CLStr93 = 93,
2023-01-15 21:50:41 +00:00
// "Could not find change current working directory to '%s'"
CLStr94 = 94,
2023-01-15 21:50:41 +00:00
// "Out of memory"
CLStr95 = 95,
2023-01-15 21:50:41 +00:00
// "The tool did not produce any output while %s the file '%s'"
CLStr96 = 96,
2023-01-15 21:50:41 +00:00
// "The filename '%s' is invalid"
CLStr97 = 97,
2023-01-15 21:50:41 +00:00
// "The %slinker for this target was not found"
CLStr98 = 98,
2023-01-15 21:50:41 +00:00
// "%s\n%s (OS error %d)"
CLStr99 = 99,
2023-01-15 21:50:41 +00:00
// "%s\n%s (error %d)"
CLStr100 = 100,
2023-01-15 21:50:41 +00:00
// "Note: '%s' did not generate any browse information \nfor '%s'; no browser output generated"
CLStr101 = 101,
2023-01-15 21:50:41 +00:00
// "Source and specified output for the file '%s' are identical; no output will be generated"
CLStr102 = 102,
2023-01-15 21:50:41 +00:00
// "More than one output filename specified for '%s'; ignoring '%s'"
CLStr103 = 103,
2023-01-15 21:50:41 +00:00
// "Pref panel data for '%s' is out-of-date or invalid"
CLStr104 = 104,
2023-01-15 21:50:41 +00:00
// "Changing primary user access path to '%s'"
CLStr105 = 105,
2023-01-15 21:50:41 +00:00
// "The linker does not expect duplicate files; ignoring repeated '%s'"
CLStr106 = 106,
};
2023-01-11 23:26:04 +00:00
#define DO_INTERNAL_ERROR(line, ...) CLInternalError(__FILE__, line, __VA_ARGS__)
#ifdef __MWERKS__
#pragma options align=mac68k
#endif
// TODO fixme
typedef struct CPrepFileInfo {
FSSpec textfile;
void *nameNode;
SInt32 fileModDate;
char *textbuffer;
SInt32 textlength;
SInt32 linenumber;
SInt32 pos;
Boolean hasprepline;
SInt16 fileID;
Boolean recordbrowseinfo;
void *unk;
} CPrepFileInfo;
typedef CPrepFileInfo *CPrepFileInfoStack[];
#ifdef __MWERKS__
#pragma options align=reset
#endif
enum {
OptsCmdLineState_0 = 0,
OptsCmdLineState_1 = 1,
OptsCmdLineState_2 = 2,
OptsCmdLineState_3 = 3
};
enum {
OptsCompilerSbmState_0 = 0,
OptsCompilerSbmState_1 = 1, // sbmRebuild?
OptsCompilerSbmState_2 = 2,
OptsCompilerSbmState_3 = 3 // sbmClean?
};
enum {
CmdLineStage_Cg = 1,
CmdLineStage_Pp = 2,
CmdLineStage_Ds = 3
};
enum {
CmdLineStageMask_Pp = 1,
CmdLineStageMask_Cg = 2,
CmdLineStageMask_Ds = 4,
CmdLineStageMask_Dp = 8
};
// Result codes used by various things in CLMain and CLFileOps
enum {
Result_Success = 0,
Result_Failed = 1,
Result_Cancelled = 2
};
#ifdef __cplusplus
extern "C" {
#endif
typedef struct MessageRef {
OSSpec sourcefile;
OSSpec errorfile;
char *sourceline;
SInt32 linenumber;
SInt32 tokenoffset;
SInt16 tokenlength;
SInt32 selectionoffset;
SInt16 selectionlength;
} MessageRef;
typedef struct Paths {
struct Path **pathsArray;
UInt16 arraySize;
UInt16 pathsCount;
} Paths;
typedef struct Frameworks {
struct Paths_FWInfo **fwsArray;
UInt16 arraySize;
UInt16 fwsCount;
} Frameworks;
typedef struct Path {
OSPathSpec *spec;
Paths *recursive;
char *dirlist;
SInt16 flags;
} Path;
typedef struct Paths_FWInfo {
OSSpec fileSpec;
OSPathSpec version;
OSPathSpec name;
Path *path;
Boolean hidden;
} Paths_FWInfo;
typedef struct InclFile {
SInt32 filenameoffs;
Path *accesspath;
Path *globalpath;
Path *specialpath;
Boolean syspath;
} InclFile;
typedef struct Incls {
struct Target *targ;
SInt32 numincls;
SInt32 maxincls;
InclFile *files;
SInt32 buflen;
SInt32 bufpos;
char *buffer;
Paths *allPaths;
} Incls;
typedef struct Deps {
int numDeps;
int maxDeps;
SInt32 *list;
Incls *incls;
} Deps;
typedef struct OvlAddr {
UInt32 lo, hi;
} OvlAddr;
typedef struct Overlay {
char name[256];
SInt32 *list;
SInt32 cnt;
SInt32 max;
struct Overlay *next;
} Overlay;
typedef struct OvlGroup {
char name[256];
OvlAddr addr;
Overlay *olys;
Overlay *lastoly;
int olycnt;
struct OvlGroup *next;
} OvlGroup;
typedef struct Overlays {
OvlGroup *groups;
OvlGroup *lastgrp;
SInt32 grpcnt;
} Overlays;
typedef struct Segment {
char name[32];
UInt16 attrs;
} Segment;
typedef struct Segments {
Segment **segsArray;
UInt16 arraySize;
UInt16 segsCount;
} Segments;
typedef struct File {
struct File *next;
SInt32 filenum;
UInt16 segnum;
time_t srcmoddate;
time_t outmoddate;
char srcfilename[256];
char outfilename[256];
SInt16 outfileowner;
OSSpec srcfss;
OSSpec outfss;
SInt16 writeToDisk;
SInt16 wroteToDisk;
SInt16 tempOnDisk;
struct Plugin *compiler;
SInt32 dropinflags;
SInt32 objectflags;
SInt32 mappingflags;
SInt16 sourceUsage;
SInt16 objectUsage;
Handle textdata;
Handle objectdata;
Handle browsedata;
SInt32 codesize;
SInt32 udatasize;
SInt32 idatasize;
SInt32 compiledlines;
Boolean recompileDependents;
Boolean gendebug;
Boolean hasobjectcode;
Boolean hasresources;
Boolean isresourcefile;
Boolean weakimport;
Boolean initbefore;
Boolean mergeintooutput;
Deps deps;
Boolean recordbrowseinfo;
SInt16 browseFileID;
char browseoptions[32];
OSType filetype;
OSType filecreator;
} File;
typedef struct Files {
File *fileList;
SInt32 fileCount;
} Files;
typedef struct VFile {
char displayName[32];
Handle data;
struct VFile *next;
} VFile;
enum {
LinkModel0 = 0,
LinkModel1 = 1,
LinkModel2 = 2
};
typedef struct Target {
struct BuildInfo {
UInt32 linesCompiled;
UInt32 codeSize;
UInt32 iDataSize;
UInt32 uDataSize;
} info;
CWTargetInfo *targetinfo;
struct {
Segments segs;
Overlays overlays;
} linkage;
SInt32 linkmodel;
Files files;
Files pchs;
Incls incls;
Paths sysPaths;
Paths userPaths;
OSType lang;
OSType cpu;
OSType os;
char targetName[64];
struct Plugin *preLinker;
struct Plugin *linker;
struct Plugin *postLinker;
UInt32 preLinkerDropinFlags;
UInt32 linkerDropinFlags;
UInt32 postLinkerDropinFlags;
OSPathSpec outputDirectory;
VFile *virtualFiles;
struct Target *next;
} Target;
typedef struct Project {
Target *targets;
OSSpec projectDirectory;
} Project;
enum {
CLStyledMessageDispatch_Type0 = 0,
CLStyledMessageDispatch_Type1 = 1,
CLStyledMessageDispatch_Type2 = 2,
CLStyledMessageDispatch_Type3 = 3,
CLStyledMessageDispatch_Type4 = 4,
CLStyledMessageDispatch_Type5 = 5
};
enum {
IncludeSearch_Type0 = 0,
IncludeSearch_Type1 = 1,
IncludeSearch_Type2 = 2,
IncludeSearch_Type3 = 3,
IncludeSearch_Type4 = 4
};
typedef struct PrefPanel PrefPanel;
typedef struct Plugin {
BasePluginCallbacks *cb;
CompilerLinkerPluginCallbacks *cl_cb;
ParserPluginCallbacks *pr_cb;
CWPluginContext context;
char *cached_ascii_version;
struct Plugin *next;
} Plugin;
/********************************/
/* State */
typedef struct {
int argc;
char **argv;
OSType cpu;
OSType os;
OSType plugintype;
OSType language;
OSType parserstyle;
OSSpec programSpec;
const char *programName;
SInt16 countWarnings;
SInt16 countErrors;
Boolean pluginDebug;
Boolean userBreak;
Boolean withholdWarnings;
Boolean withholdErrors;
OSSpec makefileSpec;
OSPathSpec sbmPathSpec;
OSHandle browseTableHandle;
char *stdout_base;
Boolean stdout_written;
} CLState; // assumed name
extern char cmdline_build_time[32];
extern char cmdline_build_date[32];
extern CLState clState;
extern PCmdLineLinker optsLinker;
extern PCmdLineCompiler optsCompiler;
extern PCmdLineEnvir optsEnvir;
extern PCmdLine optsCmdLine;
extern Target *gTarg;
extern Project mainProj;
extern CWCommandLineArgs *plugin_args;
extern CWCommandLineArgs *panel_args;
extern const char **panelNames;
extern int numPanels;
extern CLPluginInfo *pluginInfo;
extern int numPlugins;
extern jmp_buf exit_program;
/********************************/
/* Callbacks/CLParserCallbacks_V1.cpp */
extern int (*PrefPanelsChangedCallback)(const char *);
/********************************/
/* Clients/ClientGlue.c */
extern int RegisterResource(const char *name, SInt16 rsrcid, const char **list);
extern int RegisterStaticPlugin(const BasePluginCallbacks *callbacks);
extern int RegisterStaticCompilerLinkerPlugin(const BasePluginCallbacks *callbacks, const CompilerLinkerPluginCallbacks *cl_callbacks);
extern int RegisterStaticParserPlugin(const BasePluginCallbacks *cb, const ParserPluginCallbacks *pr_callbacks);
extern void SetBuildTarget(OSType cpu, OSType os);
extern void SetParserType(OSType plang);
extern void SetPluginType(OSType lang, OSType type);
extern int CmdLine_Initialize(int argc, char **argv, const char *builddate, const char *buildtime);
2023-01-11 22:29:53 +00:00
extern int CmdLine_Driver(void);
extern int CmdLine_Terminate(int exitcode);
/********************************/
/* Envir/CLErrors.c */
extern void CLReportError(SInt16 errid, ...);
extern void CLReportWarning(SInt16 errid, ...);
extern void CLReport(SInt16 errid, ...);
extern void CLReportOSError(SInt16 errid, int err, ...);
extern void CLReportCError(SInt16 errid, int err_no, ...);
extern void CLInternalError(const char *file, int line, const char *format, ...);
extern void CLFatalError(const char *format, ...);
/********************************/
/* Envir/CLIO.c */
2023-01-11 22:29:53 +00:00
extern void SetupDebuggingTraps(void);
extern Boolean IO_Initialize(void);
extern Boolean IO_Terminate(void);
extern Boolean IO_HelpInitialize(void);
extern Boolean IO_HelpTerminate(void);
extern void FixHandleForIDE(Handle text, UInt32 size);
extern Boolean ShowHandle(Handle text, UInt32 size, Boolean decorate);
extern Boolean WriteHandleToFile(OSSpec *spec, Handle text, UInt32 size, OSType creator, OSType type);
extern Boolean WriteBinaryHandleToFile(OSSpec *spec, OSType maccreator, OSType mactype, OSHandle *text);
extern Boolean AppendHandleToFile(OSSpec *spec, Handle text, UInt32 size, OSType maccreator, OSType mactype);
2023-01-11 22:29:53 +00:00
extern void InitWorking(void);
extern void ShowWorking(int x);
2023-01-11 22:29:53 +00:00
extern void TermWorking(void);
extern Boolean CheckForUserBreak(void);
extern char *IO_FormatText(char *buffer, SInt32 size, char *newline, const char *format, ...);
extern void CLPrintDispatch(int unk, SInt16 msgtype, const char *message);
extern void CLPrintType(SInt16 msgtype, const char *format, ...);
extern void CLPrint(const char *format, ...);
extern void CLPrintWarning(const char *format, ...);
extern void CLPrintErr(const char *format, ...);
extern SInt16 CLStyledMessageDispatch(Plugin *plugin, MessageRef *ref, SInt32 errorNumber, SInt16 msgType, const char *format, ...);
/********************************/
/* Plugins/CLPlugins.c */
2023-01-11 22:29:53 +00:00
extern const ToolVersionInfo *Plugin_GetToolVersionInfo(void);
extern const char *Plugin_GetDropInName(Plugin *pl);
extern const VersionInfo *Plugin_GetVersionInfo(Plugin *pl);
extern char *Plugin_GetVersionInfoASCII(Plugin *pl);
extern DropInFlags *Plugin_GetDropInFlags(Plugin *pl);
extern OSType Plugin_GetPluginType(Plugin *pl);
extern const CWTargetList *Plugin_CL_GetTargetList(Plugin *pl);
extern const CWPanelList *Plugin_GetPanelList(Plugin *pl);
extern const CWExtMapList *Plugin_CL_GetExtMapList(Plugin *pl);
extern const OSFileTypeMappingList *Plugin_GetFileTypeMappingList(Plugin *pl);
extern const CWObjectFlags *Plugin_CL_GetObjectFlags(Plugin *pl);
extern Boolean Plugin_MatchesName(Plugin *pl, const char *name);
extern Boolean Plugin_CL_MatchesTarget(Plugin *pl, OSType cpu, OSType os, Boolean exact);
extern Boolean Plugins_CL_HaveMatchingTargets(Plugin *p1, Plugin *p2, Boolean exact);
extern Boolean Plugin_CL_MatchesFileType(Plugin *pl, OSType type, const char *extension, Boolean exact);
extern Boolean Plugin_MatchesType(Plugin *pl, OSType type, OSType lang, Boolean exact);
extern Boolean Plugin_Pr_MatchesPlugin(Plugin *pl, CLPluginInfo *pluginfo, OSType cpu, OSType os);
extern Boolean Plugin_Pr_MatchesPanels(Plugin *pl, int numPanels, const char **panelNames);
extern Boolean Plugin_CL_WriteObjectFile(Plugin *pl, FSSpec *srcfss, FSSpec *outfss, OSType creator, OSType type, Handle data);
extern Boolean Plugin_CL_GetCompilerMapping(Plugin *pl, OSType type, const char *ext, UInt32 *flags);
extern Plugin *Plugin_New(const BasePluginCallbacks *cb, const CompilerLinkerPluginCallbacks *cl_cb, const ParserPluginCallbacks *pr_cb);
extern void Plugin_Free(Plugin *pl);
extern Boolean Plugin_VerifyPanels(Plugin *pl);
2023-01-11 22:29:53 +00:00
extern void Plugins_Init(void);
extern void Plugins_Term(void);
extern int Plugins_Add(Plugin *pl);
extern Plugin *Plugins_MatchName(Plugin *list, const char *name);
extern Plugin *Plugins_CL_MatchTarget(Plugin *list, OSType cpu, OSType os, OSType type, OSType lang);
extern Plugin *Plugins_CL_MatchFileType(Plugin *list, OSType type, const char *ext, Boolean exact);
extern Plugin *Plugins_GetPluginForFile(Plugin *list, OSType plugintype, OSType cpu, OSType os, OSType type, const char *ext, OSType lang);
extern Plugin *Plugins_GetLinker(Plugin *list, OSType cpu, OSType os);
extern Plugin *Plugins_GetPreLinker(Plugin *list, OSType cpu, OSType os);
extern Plugin *Plugins_GetPostLinker(Plugin *list, OSType cpu, OSType os);
extern Plugin *Plugins_GetParserForPlugin(Plugin *list, OSType style, int numPlugins, CLPluginInfo *plugins, OSType cpu, OSType os, int numPanels, const char **panelNames);
extern Plugin *Plugins_GetCompilerForLinker(Plugin *list, Plugin *linker, OSType type, const char *ext, OSType edit);
extern int Plugins_GetPluginList(Plugin *list, int *numPlugins, CLPluginInfo **pluginInfo);
extern int Plugins_GetPrefPanelUnion(Plugin *list, int *numPanels, const char ***panelNames);
extern int Plugin_AddFileTypeMappings(Plugin *pl, OSFileTypeMappings **mlist);
extern int Plugins_AddFileTypeMappingsForTarget(Plugin *list, OSFileTypeMappings **mlist, OSType cpu, OSType os);
extern SInt16 Plugin_Call(Plugin *pl, void *context);
/********************************/
/* Project/CLAccessPaths.c */
extern Path *Path_Init(const OSPathSpec *dir, Path *path);
extern Path *Path_New(const OSPathSpec *dir);
extern void Path_Free(Path *path);
extern Boolean Paths_Initialize(Paths *paths);
extern Boolean Paths_Terminate(Paths *paths);
extern Boolean Paths_AddPath(Paths *paths, Path *path);
extern Boolean Paths_InsertPath(Paths *paths, UInt16 index, Path *path);
extern Boolean Paths_RemovePath(Paths *paths, UInt16 index);
extern Boolean Paths_DeletePath(Paths *paths, UInt16 index);
extern Path *Paths_GetPath(Paths *paths, UInt16 pathnum);
extern UInt16 Paths_Count(const Paths *paths);
extern Boolean Paths_FindPath(const Paths *paths, const Path *path);
extern Path *Paths_FindPathSpec(const Paths *paths, const OSPathSpec *dir);
extern Boolean Paths_GatherRecurse(Path *path);
extern int Paths_CountRecurse(Paths *paths);
extern void Paths_CopyRecurseFSS(FSSpec *list, Paths *paths, UInt16 count);
extern Boolean MakeFrameworkPath(char *out, const char *filename, Path *globalpath);
extern void Frameworks_AddPath(const OSPathSpec *oss);
extern int Frameworks_AddFramework(const char *name, const char *version, Boolean hidden);
2023-01-11 22:29:53 +00:00
extern void Framework_GetEnvInfo(void);
extern int Frameworks_GetCount(void);
extern Paths_FWInfo *Frameworks_GetInfo(int which);
// Not sure if this is the right TU for this
extern Paths FrameworkPaths;
/********************************/
/* Project/CLFiles.c */
2023-01-11 22:29:53 +00:00
extern File *File_New(void);
extern void File_Free(File *file);
extern Boolean Files_Initialize(Files *);
extern Boolean Files_Terminate(Files *);
extern Boolean Files_AddFile(Files *, File *file);
extern Boolean Files_InsertFile(Files *, File *file, SInt32 position);
extern File *Files_GetFile(Files *, SInt32 filenum);
extern File *Files_FindFile(Files *, OSSpec *spec);
extern int Files_Count(Files *);
extern Boolean VFiles_Initialize(VFile **list);
extern void VFiles_Terminate(VFile **list);
extern VFile *VFile_New(const char *name, Handle data);
extern Boolean VFiles_Add(VFile **list, VFile *entry);
extern VFile *VFiles_Find(VFile *list, const char *name);
/********************************/
/* Project/CLOverlays.c */
extern Boolean Overlays_Initialize(Overlays *);
extern Boolean Overlays_Terminate(Overlays *);
extern Boolean Overlays_AddOvlGroup(Overlays *, OvlGroup *grp, SInt32 *grpnum);
extern OvlGroup *Overlays_GetOvlGroup(Overlays *, SInt32 grpnum);
extern SInt32 Overlays_CountGroups(Overlays *);
extern Boolean Overlays_AddFileToOverlay(Overlays *, SInt32 grpnum, SInt32 ovlnum, SInt32 filenum);
extern Overlay *Overlays_GetOverlayInGroup(Overlays *, SInt32 grpnum, SInt32 ovlnum);
extern SInt32 Overlays_GetFileInOverlay(Overlays *, SInt32 grpnum, SInt32 ovlnum, SInt32 filnum);
extern OvlGroup *OvlGroup_New(const char *name, OvlAddr addr);
extern void OvlGroup_Delete(OvlGroup *grp);
extern Boolean OvlGroup_AddOverlay(OvlGroup *, Overlay *oly, SInt32 *olynum);
extern Overlay *OvlGroup_GetOverlay(OvlGroup *, SInt32 olynum);
extern SInt32 OvlGroup_CountOverlays(OvlGroup *);
extern Overlay *Overlay_New(const char *name);
extern void Overlay_Delete(Overlay *oly);
extern Boolean Overlay_AddFile(Overlay *oly, SInt32 filenum, SInt32 *filnum);
extern SInt32 Overlay_GetFile(Overlay *oly, SInt32 filnum);
extern SInt32 Overlay_CountFiles(Overlay *oly);
/********************************/
/* Project/CLProj.c */
extern Boolean Proj_Initialize(Project *);
extern Boolean Proj_Terminate(Project *);
/********************************/
/* Project/CLSegs.c */
extern Segment *Segment_New(const char *name, UInt16 attrs);
extern void Segment_Free(Segment *seg);
extern Boolean Segments_Initialize(Segments *segs);
extern Boolean Segments_Terminate(Segments *segs);
extern Boolean Segments_AddSegment(Segments *segs, Segment *seg, UInt16 *index);
extern Boolean Segments_InsertSegment(Segments *segs, UInt16 index, Segment *seg);
extern Boolean Segments_DeleteSegment(Segments *segs, UInt16 index);
extern Segment *Segments_GetSegment(Segments *segs, UInt16 segnum);
extern UInt16 Segments_Count(const Segments *segs);
/********************************/
/* CLBrowser.c */
extern int Browser_Initialize(OSHandle *browsetableptr);
extern int Browser_Terminate(OSHandle *browsetableptr);
extern int Browser_SearchFile(OSHandle *browsetable, const char *fullpath, SInt16 *ID);
extern int Browser_SearchAndAddFile(OSHandle *browsetable, const char *fullpath, SInt16 *ID);
extern int Browser_PackBrowseFile(Handle browsedata, OSHandle *browsetable, OSHandle *browsefileptr);
/********************************/
/* CLDependencies.c */
extern SInt16 *CLT_filesp;
extern CPrepFileInfoStack *CLT_filestack;
extern Boolean Incls_Initialize(Incls *incls, Target *targ);
extern void Incls_Terminate(Incls *incls);
extern Boolean Incls_FindFileInPaths(Incls *incls, char *filename, Boolean fullsearch, OSSpec *spec, SInt32 *inclidx);
extern Boolean Deps_Initialize(Deps *deps, Incls *incls);
extern void Deps_Terminate(Deps *deps);
extern int Deps_ChangeSpecialAccessPath(OSSpec *srcfss, Boolean initialize);
2023-01-11 22:29:53 +00:00
extern Path *Deps_GetSpecialAccessPath(void);
extern void Deps_AddDependency(Deps *deps, SInt32 incl, OSSpec *spec, Boolean unk, SInt16 dependencyType, Boolean *alreadyincluded);
extern void Deps_ListDependencies(Incls *incls, File *file, OSHandle *h);
/********************************/
/* CLFileOps.c */
extern int GetOutputFile(File *file, SInt16 stage);
extern int StoreObjectFile(File *file);
2023-01-11 22:29:53 +00:00
extern int CompileFilesInProject(void);
extern int LinkProject(void);
2023-01-15 21:50:41 +00:00
/********************************/
/* CLFileTypes.c */
extern void AddFileTypeMappingList(OSFileTypeMappings **list, const OSFileTypeMappingList *entry);
extern void UseFileTypeMappings(OSFileTypeMappings *list);
extern OSErr SetMacFileType(const FSSpec *spec, OSType mactype);
extern OSErr GetMacFileType(const FSSpec *spec, OSType *mactype);
/********************************/
/* CLIncludeFileCache.c */
2023-01-11 22:29:53 +00:00
extern void InitializeIncludeCache(void);
extern void CleanupIncludeCache(void);
extern void CacheIncludeFile(OSSpec *spec, Handle text, Boolean precompiled);
extern Handle CachedIncludeFile(OSSpec *spec, Boolean *precompiled);
extern void FreeIncludeFile(Handle text);
/********************************/
/* CLLicenses.c */
2023-01-11 22:29:53 +00:00
extern void License_Initialize(void);
extern void License_Terminate(void);
extern SInt32 License_Checkout(/* unknown args */);
extern void License_Refresh(/* unknown args */);
extern void License_Checkin(/* unknown args */);
extern void License_AutoCheckin(void);
/********************************/
/* CLLoadAndCache.c */
extern short FixTextHandle(Handle txt);
extern int LoadAndCacheFile(OSSpec *spec, Handle *texthandle, Boolean *precomp);
extern void CopyFileText(Handle src, char **text, SInt32 *textsize);
/********************************/
/* CLMain.c */
extern void Main_PreParse(int *argc, char ***argv);
extern void Main_PassSpecialArgs(int *argc, char ***argv);
extern int Main_Initialize(int argc, char **argv);
extern int Main_Terminate(int code);
2023-01-11 22:29:53 +00:00
extern int Main_Driver(void);
/********************************/
/* CLPluginRequests.cpp */
extern Boolean SendParserRequest(
Plugin *plugin,
Target *target,
CWCommandLineArgs *args,
OSType cpu,
OSType os,
int numPlugins,
CLPluginInfo *pluginInfo,
int numPanels,
const char **panelNames,
CWCommandLineArgs *plugin_args,
CWCommandLineArgs *panel_args,
const char *build_date,
const char *build_time,
const ToolVersionInfo *build_tool
);
extern Boolean SendCompilerRequest(Plugin *plugin, File *file, SInt16 stage);
extern Boolean SendTargetInfoRequest(Target *targ, Plugin *linker, SInt32 dropinflags);
extern Boolean SendLinkerRequest(Plugin *plugin, SInt32 dropinflags, CWTargetInfo *targetInfo);
extern Boolean SendDisassemblerRequest(Plugin *linker, File *file);
extern Boolean SendInitOrTermRequest(Plugin *plugin, Boolean reqIsInitialize);
/********************************/
/* CLPrefs.c */
extern PrefPanel *PrefPanel_New(const char *name, void *initdata, SInt32 initdatasize);
extern Handle PrefPanel_GetHandle(PrefPanel *panel);
extern int PrefPanel_PutHandle(PrefPanel *panel, Handle data);
2023-01-11 22:29:53 +00:00
extern void Prefs_Initialize(void);
extern void Prefs_Terminate(void);
extern Boolean Prefs_AddPanel(PrefPanel *panel);
extern PrefPanel *Prefs_FindPanel(const char *name);
/********************************/
/* CLTarg.c */
extern Target *Target_New(const char *name, OSType cpu, OSType os, OSType lang);
extern void Target_Free(Target *targ);
extern void Targets_Term(Target *list);
extern void Target_Add(Target **list, Target *targ);
/********************************/
/* CLToolExec.c */
extern void AppendArgumentList(int *argc, char ***argv, const char *str);
2023-01-11 22:29:53 +00:00
extern int SetupTemporaries(void);
extern int DeleteTemporaries(void);
extern int ExecuteLinker(Plugin *plugin, SInt32 dropinflags, File *file, char *stdoutfile, char *stderrfile);
/********************************/
/* CLWriteObjectFile.c */
extern int WriteObjectFile(File *file, OSType maccreator, OSType mactype);
extern int WriteBrowseData(File *file, OSType maccreator, OSType mactype);
#ifdef __cplusplus
}
#endif
2022-10-25 19:30:28 +00:00
#endif