diff options
author | Ash Wolf <ninji@wuffs.org> | 2022-10-14 23:15:32 +0100 |
---|---|---|
committer | Ash Wolf <ninji@wuffs.org> | 2022-10-14 23:15:32 +0100 |
commit | 775b6861666af36d317fb577cf489e2c6377f878 (patch) | |
tree | 2ae8c829eb861c85a6e2b5acf42f51919a0d78f2 /sdk_hdrs | |
parent | b8df05413a4e8b299de07b915cddce73a3bb16e3 (diff) | |
download | MWCC-775b6861666af36d317fb577cf489e2c6377f878.tar.gz MWCC-775b6861666af36d317fb577cf489e2c6377f878.zip |
add tons of stuff
Diffstat (limited to 'sdk_hdrs')
-rwxr-xr-x | sdk_hdrs/CWPlugins.h | 2 | ||||
-rwxr-xr-x | sdk_hdrs/DropInCompilerLinker.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/sdk_hdrs/CWPlugins.h b/sdk_hdrs/CWPlugins.h index b3dbd2a..ecd690b 100755 --- a/sdk_hdrs/CWPlugins.h +++ b/sdk_hdrs/CWPlugins.h @@ -1 +1 @@ -/*
* CWPlugins.h - Common declarations for Metrowerks CodeWarriorª plugins
*
* Copyright © 1995-1997 Metrowerks, Inc. All rights reserved.
*
*/
#ifndef __CWPlugins_H__
#define __CWPlugins_H__
#ifdef __MWERKS__
# pragma once
#endif
#define CWPLUGIN_HOST_MACOS 1
#define CWPLUGIN_HOST_WIN32 2
#define CWPLUGIN_HOST_SOLARIS 3
#define CWPLUGIN_HOST_LINUX 4
#ifndef CWPLUGIN_HOST
# ifdef WIN32
# define CWPLUGIN_HOST CWPLUGIN_HOST_WIN32
# elif defined(macintosh)
# define CWPLUGIN_HOST CWPLUGIN_HOST_MACOS
# elif defined(__sun__)
# define CWPLUGIN_HOST CWPLUGIN_HOST_SOLARIS
# elif defined(__linux__)
# define CWPLUGIN_HOST CWPLUGIN_HOST_LINUX
# else
# error
# endif
#endif
#define CWPLUGIN_API_MACOS 1
#define CWPLUGIN_API_WIN32 2
#define CWPLUGIN_API_UNIX 3
#ifndef CWPLUGIN_API
# ifdef WIN32
# define CWPLUGIN_API CWPLUGIN_API_WIN32
# elif defined(macintosh)
# define CWPLUGIN_API CWPLUGIN_API_MACOS
# elif defined(__sun__) || defined(__linux__)
# define CWPLUGIN_API CWPLUGIN_API_UNIX
# else
# error
# endif
#endif
/*
** Radix 256 notation where a 32-bit integer is created from four
** ASCII characters. A four-character constant of this form, say
** 'ABCD', must always be represented with the same pattern, 0x41424344
** in this case, regardless of big/little endian issues.
*/
typedef long CWFourCharType;
#define CWFOURCHAR(a, b, c, d) \
(((CWFourCharType) ((a) & 0xff) << 24) \
| ((CWFourCharType) ((b) & 0xff) << 16) \
| ((CWFourCharType) ((c) & 0xff) << 8) \
| ((CWFourCharType) ((d) & 0xff)))
#if CWPLUGIN_API == CWPLUGIN_API_UNIX
#include <sys/param.h>
#endif
#ifndef CW_USE_PRAGMA_EXPORT
#if CWPLUGIN_HOST == CWPLUGIN_HOST_MACOS
#define CW_USE_PRAGMA_EXPORT 1
#else
#define CW_USE_PRAGMA_EXPORT 0
#endif
#endif
#ifndef CW_USE_PRAGMA_IMPORT
#if CWPLUGIN_HOST == CWPLUGIN_HOST_MACOS
#define CW_USE_PRAGMA_IMPORT 1
#else
#define CW_USE_PRAGMA_IMPORT 0
#endif
#endif
#ifdef __MWERKS__
#pragma options align=mac68k
#endif
#ifdef _MSC_VER
#pragma pack(push,2)
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if CW_USE_PRAGMA_IMPORT
#pragma import on
#endif
/* These constants specify the action the IDE is asking the plugin to execute */
enum {
reqInitialize = -2, /* called when the plugin is loaded */
reqTerminate = -1, /* called when the plugin is unloaded */
reqIdle = -100, /* called periodically to allow for plugin tasks EP 6/24/98 */
reqAbout = -101, /* called to ask plugin to display about dialog EP 6/24/98 */
reqPrefsChange = -102 /* called when an associated pref panel changes EP 6/24/98 */
};
/* Used in CWFileInfo.dependencyType to indicate what type of make */
/* dependency to establish between files */
typedef enum CWDependencyType {
cwNoDependency, /* do not establish a dependency */
cwNormalDependency, /* recompile dependent whenever prereq changes */
cwInterfaceDependency /* recompile only if interface to file changes */
} CWDependencyType;
/* Used in CWFileInfo.filedatatype to indicate the type of data in a loaded file */
enum {
cwFileTypeUnknown, /* unknown binary data */
cwFileTypeText, /* normal text file */
cwFileTypePrecompiledHeader /* cached precompiled header */
};
/* constant for CWFileInfo.isdependentoffile */
#define kCurrentCompiledFile -1L
/* constant for CWStorePluginData/CWGetPluginData */
#define kTargetGlobalPluginData -1L
/* constant for CWNewProjectEntryInfo link order, segment, and overlay values */
#define kDefaultLinkPosition -1L
/* Selectors for CWFindLogicalDirectory */
enum {
kIDEDirectorySelector = 1, /* parent directory of IDE application; "bin" folder on Win32 */
kCodeWarriorDirectorySelector, /* root CodeWarrior directory */
kSystemDirectorySelector, /* system directory */
kProjectDirectorySelector, /* parent directory of current project */
kProjectDataDirectorySelector, /* project data directory */
kTargetDataDirectorySelector, /* target data directory (within project data directory) */
kTargetObjectCodeDirectorySelector, /* object code directory (within target data directory) */
kDebuggerCacheDirectorySelector, /* "CW Debugging Cache" directory */
kHelperAppsDirectorySelector, /* "(Helper Apps)" directory */
kPluginsDirectorySelector, /* "CodeWarrior Plugins" (Mac) or "plugins" (Win32) directory */
kPluginParentDirectorySelector, /* parent directory of current plugin */
kStationeryDirectorySelector, /* "(Project Stationery)" directory */
kRADStationeryDirectorySelector, /* "RAD Stationery" directory */
kLocalizedResourcesDirectorySelector /* "resources" directory */
};
/* CWPluginContext is a magic cookie passed to all plugins. It must */
/* be passed back to all IDE callbacks */
typedef struct CWPluginPrivateContext* CWPluginContext;
/* CWResult is the error/status result returned by all IDE API routine. */
/* The most common errors are returned directly. For OS-specific errors, the */
/* CWResult is cwErrOSError, and the OS-specific error can be obtained by */
/* calling CWGetOSError() */
typedef long CWResult;
/* CWMemHandle is an abstraction for memory used in some parts */
/* of the plugin API. API routines must be used to allocate */
/* and free CWMemHandles, or to convert them to pointers. */
typedef struct CWMemHandlePrivateStruct* CWMemHandle;
/* Used to identify custom data associated by a plugin with */
/* a project file or a target as a whole. Must be a four character */
/* constant. All lower case constants are reserved by the IDE */
typedef unsigned long CWDataType;
/* Some information used in the compiler/linker API is platform-dependent */
/* We use some typedefs to isolate the differences */
/* CWFileSpec contains the native platform file specifier. */
/* CWFileName contains the string type for a native file name */
/* CWFileTime contains the native platform file timestamp */
/* CWOSResult contains the native platform error return value */
/* CWResult contains an API routine error/status result */
/* CW_CALLBACK is a macro defining the calling convention and return type for */
/* IDE callback routines. */
/* CW_PLUGINENTRY is a macro defining the calling convention and return type for */
/* plugin entry points. */
/* CWSUCCESS is a macro that evaluates to true when given a CWResult indicating an */
/* routine succeeded */
#if CWPLUGIN_API == CWPLUGIN_API_MACOS
typedef FSSpec CWFileSpec;
typedef char CWFileName[32];
typedef unsigned long CWFileTime;
typedef OSErr CWOSResult;
#elif CWPLUGIN_API == CWPLUGIN_API_WIN32
typedef unsigned char Boolean;
typedef struct CWFileSpec { char path[MAX_PATH]; } CWFileSpec;
typedef char CWFileName[65];
typedef FILETIME CWFileTime;
typedef DWORD CWOSResult;
#elif CWPLUGIN_API == CWPLUGIN_API_UNIX
#define MAX_PATH MAXPATHLEN
#ifndef __MACTYPES__
typedef unsigned char Boolean;
#endif
#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE 1
#endif
typedef struct CWFileSpec { char path[MAX_PATH]; } CWFileSpec;
typedef char CWFileName[65];
typedef time_t CWFileTime;
typedef int CWOSResult;
#else
#error Unknown plugin API!
#endif
#define CWSUCCESS(result) ((result) == 0)
#if CWPLUGIN_HOST == CWPLUGIN_HOST_MACOS
#define CW_CALLBACK pascal CWResult
#define CW_CALLBACK_PTR(function_name) pascal CWResult (function_name)
#define CWPLUGIN_ENTRY(function_name) pascal short (function_name)
#elif CWPLUGIN_HOST == CWPLUGIN_HOST_WIN32
#define CW_CALLBACK CWResult __stdcall
#define CW_CALLBACK_PTR(function_name) CWResult (__stdcall function_name)
#define CWPLUGIN_ENTRY(function_name) short (__stdcall function_name)
#elif CWPLUGIN_HOST==CWPLUGIN_HOST_SOLARIS || CWPLUGIN_HOST==CWPLUGIN_HOST_LINUX
#define CW_CALLBACK CWResult
#define CW_CALLBACK_PTR(function_name) CWResult (function_name)
#define CWPLUGIN_ENTRY(function_name) short (function_name)
#else
#error Unknown plugin host!
#endif
/* information returned by CWFindAndLoadFile */
typedef struct CWFileInfo {
Boolean fullsearch; /* [<-] do we do a full search of paths for file */
char dependencyType; /* [<-] type CWDependencyType */
long isdependentoffile; /* [<-] this file is a dependent of file id */
/* (zero based) or -1L if of current file */
Boolean suppressload; /* [<-] find but don't load the file */
Boolean padding; /* [**] structure padding */
const char* filedata; /* [->] point to the file text/data, or NULL */
long filedatalength; /* [->] length of filedata */
short filedatatype; /* [->] type of data pointed to by filedata */
/* the remaining members are valid only when called by compilers */
short fileID; /* [->] use in browse records and dependencies */
CWFileSpec filespec; /* [->] specifies the file on disk */
Boolean alreadyincluded; /* [->] TRUE if already included in current compile */
Boolean recordbrowseinfo; /* [->] record browse info for this file? */
} CWFileInfo;
/* information maintained by the IDE for each segment in the project */
typedef struct CWProjectSegmentInfo {
char name[32]; /* segment name */
short attributes; /* segment attributes */
} CWProjectSegmentInfo;
/* 64 bit address */
typedef struct CWAddr64 {
long lo; /* low order longword of address */
long hi; /* high order longword of address */
} CWAddr64;
/* describes an overlay group, Use CWGetOverlayGroup1Info to iterate over overlay groups */
typedef struct CWOverlay1GroupInfo {
char name[256]; /* overlay group name */
CWAddr64 address; /* load address */
long numoverlays; /* number of overlays in this group */
} CWOverlay1GroupInfo;
/* describes an overlay, use CWGetOverlay1Info to iterate over overlays */
typedef struct CWOverlay1Info {
char name[256]; /* name of this overlay */
long numfiles; /* number of files in the overlay */
} CWOverlay1Info;
/* describes a file in an overlay, use CWGetOverlayFile1Info to iterate over files. Use */
/* whichfile in calls taking a file number, e.g. CWLoadObjectData or CWGetFileInfo */
typedef struct CWOverlay1FileInfo {
long whichfile; /* flat file number */
} CWOverlay1FileInfo;
/*
* All compiler errors or warnings which occur at some specific location in some
* source file are identified by a CWMessageRef structure. This structure
* provides sufficient information for the development environment to locate
* and display the exact position associated with a message. For each message,
* the compiler provides:
*
* errorstring: contains a description of the error, e.g. "syntax error"
* errorline: contains a subset of the text containing the error
* errorlevel: indicates if the "error" is an error, warning, or informational message
* CWMessageRef: further info so the IDE can perform two tasks:
* - Display a summary of each message, with the "error token"
* underlined within the compiler-provided errorline. This
* information is provided by the tokenoffset and tokenlength
* fields. If tokenLength is zero then no underlining is performed.
*
* - Open the file containing the error and select the full
* text of the error. This information is provided by the
* selectionoffset and selectionlength fields.
*/
typedef struct CWMessageRef
{
CWFileSpec sourcefile; /* file containing error */
long linenumber; /* error linenumber in file */
short tokenoffset; /* offset into errorline of token underline */
short tokenlength; /* length of error token to be underlined */
long selectionoffset; /* start of error for text selection */
long selectionlength; /* length of error for text selection */
} CWMessageRef;
/* message types, used for errorlevel parameter to message routines */
enum {
messagetypeInfo, /* informational only */
messagetypeWarning, /* warning message */
messagetypeError /* error message */
};
/* information maintained by the IDE for each file in the project */
typedef struct CWProjectFileInfo
{
CWFileSpec filespec; /* CW_FileSpec of file in project */
CWFileTime moddate; /* date source file was last modified */
short segment; /* segment number of file */
Boolean hasobjectcode; /* file has object code to be linked */
Boolean hasresources; /* file has resources to be linked */
Boolean isresourcefile; /* file -is- a resource file to be linked */
Boolean weakimport; /* file has "Import Weak" flag set */
Boolean initbefore; /* file has "Init Before" flag set */
Boolean gendebug; /* file has generate debug info on */
CWFileTime objmoddate; /* date object code was last modified */
CWFileName dropinname; /* name of dropin used to process this file */
short fileID; /* fileID to use in browse records */
Boolean recordbrowseinfo; /* record browse info for this file? */
Boolean reserved; /* reserved and used internally */
#if CWPLUGIN_HOST == CWPLUGIN_HOST_MACOS
/* some Macintosh-specific information */
OSType filetype; /* MacOS file type */
OSType filecreator; /* MacOS file creator */
#endif
Boolean hasunitdata; /* file has associated unit data (Pascal) */
Boolean mergeintooutput; /* file has "Merge Into Output" flag set */
unsigned long unitdatadependencytag; /* dependency tag (i.e. checksum) of unit data (Pascal) */
} CWProjectFileInfo;
typedef struct CWNewTextDocumentInfo
{
const char* documentname; /* name for new document, can be NULL */
CWMemHandle text; /* initial text for document */
Boolean markDirty; /* mark doc as needing to be saved? */
} CWNewTextDocumentInfo;
typedef struct CWNewProjectEntryInfo
{ /* use kDefaultLinkPosition to get default link order, overlay, or segment */
long position; /* optional link order position */
long segment; /* optional segment number */
long overlayGroup; /* optional overlay group number */
long overlay; /* optional overlay number */
const char* groupPath; /* optional fully qualified path to file group */
Boolean mergeintooutput; /* set merge into output flag? */
Boolean weakimport; /* set weak import flag? */
Boolean initbefore; /* set initbefore flag? */
} CWNewProjectEntryInfo;
typedef struct CWIDEInfo
{
unsigned short majorVersion;
unsigned short minorVersion;
unsigned short bugFixVersion;
unsigned short buildVersion;
unsigned short dropinAPIVersion;
} CWIDEInfo;
/* Structures for getting the list of access paths. */
/* The callback does the filtering on the host flags, so the list returned */
/* will only contain the paths that are enabled for the host platform. */
/* There are separate APIs to get the Mac OS X framework style access paths. */
typedef enum CWAccessPathType {
cwSystemPath,
cwUserPath
} CWAccessPathType;
typedef struct CWAccessPathInfo
{
CWFileSpec pathSpec;
Boolean recursive;
long subdirectoryCount;
} CWAccessPathInfo;
typedef struct CWAccessPathListInfo
{
long systemPathCount;
long userPathCount;
Boolean alwaysSearchUserPaths;
Boolean convertPaths;
} CWAccessPathListInfo;
/* Structures for getting the list of Mac OS X framework access paths. */
/* The callback does the filtering on the host flags, so the list returned */
/* will only contain the Mac OS X framework style paths that are enabled for */
/* the host platform. */
/* There are separate APIs to get the traditional style access paths. */
typedef struct CWFrameworkAccessPathInfo
{
CWFileSpec pathSpec;
Boolean framework;
} CWFrameworkAccessPathInfo;
typedef struct CWFrameworkAccessPathListInfo
{
long systemPathCount;
long userPathCount;
Boolean alwaysSearchUserPaths;
Boolean convertPaths;
Boolean requireFrameworkIncludes;
} CWFrameworkAccessPathListInfo;
/* constants for different types of plugins */
/* Used in the dropintype in the DropInFlags, as well as for the MacOS file type */
enum
{
CWDROPINLINKERTYPE = CWFOURCHAR('L','i','n','k'), /* type for DropIn linkers */
CWDROPINCOMPILERTYPE= CWFOURCHAR('C','o','m','p'), /* type for DropIn compilers */
CWDROPINPREFSTYPE = CWFOURCHAR('P','a','n','L'), /* type for DropIn panels */
CWDROPINPREFSTYPE_1 = CWFOURCHAR('P','a','n','l'), /* type for 1.x IDE DropIn panels */
CWDROPINVCSTYPE = CWFOURCHAR('V','C','S',' '), /* type for DropIn version control */
CWDROPINCOMTYPE = CWFOURCHAR('C','O','M',' ') /* type for COM-only plugins */
};
typedef long CWPluginType; // one of the above types
/* Format of 'Flag' resources, or data returned by dropin's GetDropinFlags entry */
/* point. */
/* */
/* For the version 2 of these resource, we renamed the 'apiversion' field to */
/* 'earliestCompatibleAPIVersion' and added the 'newestAPIVersion' field. */
/* This allows plugins to support more than one API version and therefore run */
/* under more than one version of the IDE. The CWGetAPIVersion call should be used */
/* to determine what API version the IDE is using to talk to a plugin. */
#define kCurrentDropInFlagsVersion 2
typedef struct DropInFlags {
short rsrcversion; /* version number of resource */
CWDataType dropintype; /* dropin type (compiler, panel, etc) */
/* earliest API support by this plugin */
unsigned short earliestCompatibleAPIVersion;
unsigned long dropinflags; /* capability flags */
CWDataType edit_language; /* language */
unsigned short newestAPIVersion; /* newest API version supported */
} DropInFlags, **DropInFlagsHandle;
#define kCurrentCWPanelListVersion 1
typedef struct CWPanelList {
short version;
short count;
const char** names;
} CWPanelList;
#define kCurrentCWFamilyListVersion 1
#define kCurrentCWFamilyResourceVersion 1
typedef struct CWFamily {
CWDataType type;
const char* name;
} CWFamily;
typedef struct CWFamilyList {
short version;
short count;
CWFamily* families;
} CWFamilyList;
typedef struct CWFamilyResource {
short version;
CWDataType type;
unsigned char name[64];
} CWFamilyResource;
#define kCurrentCWHelpInfoVersion 1
typedef struct CWHelpInfo {
short version;
const char* helpFileName;
} CWHelpInfo;
#define kCurrentCWRelativePathVersion 1
typedef enum CWRelativePathFormat
{
format_Generic = 0, // Simple name, not platform-specific
format_Mac, // Uses : as separator :: for parent directory
format_Win, // Uses \ as separator .. for parent directory
format_Unix // Uses / as separator .. for parent directory
} CWRelativePathFormat;
typedef enum CWRelativePathTypes
{
type_Absolute = 0,
type_Project,
type_Compiler,
type_System,
type_UserDefined
} CWRelativePathTypes;
typedef struct CWRelativePath
{
short version; // version number
unsigned char pathType; // use CWRelativePathTypes
unsigned char pathFormat; // use CWRelativePathFormat
char userDefinedTree[256]; // user-defined tree name
char pathString[512]; // actual path string
} CWRelativePath;
/*
*
*/
#define kCurrentCWPluginInfoVersion 1
typedef struct CWPluginInfo
{
short version; // struct version number
const char* companyName; // i.e. Metrowerks
const char* pluginName; // Defaults to Dropin->GetName()
const char* pluginDisplayName;
const char* familyName; // i.e. Java
unsigned short majorIDEVersion; // Version of IDE Required
unsigned short minorIDEVersion;
} CWPluginInfo;
/* Declaration of plugin entry points that must be implemented by non-MacOS plugins */
/* It can also be implemented for MacOS plugins instead of having a 'Flag' resource */
CWPLUGIN_ENTRY (CWPlugin_GetDropInFlags)(const DropInFlags**, long* flagsSize);
/* Declaration of plugin entry points that may optionally be implemented by plugins */
/* These entry points override the corresponding resources on MacOS */
CWPLUGIN_ENTRY (CWPlugin_GetDropInName)(const char** dropInName);
CWPLUGIN_ENTRY (CWPlugin_GetDisplayName)(const char** displayName);
CWPLUGIN_ENTRY (CWPlugin_GetPanelList)(const CWPanelList** panelList);
CWPLUGIN_ENTRY (CWPlugin_GetFamilyList)(const CWFamilyList** familyList);
CWPLUGIN_ENTRY (CWPlugin_GetHelpInfo)(const CWHelpInfo** helpInfo);
/* Declaration of info plugin entry point that must be implemented by all COM plugins */
CWPLUGIN_ENTRY (CWPlugin_GetPluginInfo)(const CWPluginInfo** pluginInfo);
/* Callback declarations: these callbacks are supported for all CodeWarrior plugins */
/* Get the action the IDE is requesting of the plugin */
CW_CALLBACK CWGetPluginRequest(CWPluginContext context, long* request);
/* Call when finished handling a request, just before returning to the shell */
CW_CALLBACK CWDonePluginRequest(CWPluginContext, CWResult resultCode);
/* Get the version number of API used by the IDE to talk to the plugin */
CW_CALLBACK CWGetAPIVersion(CWPluginContext context, long* version);
/* Get information about the IDE being used */
CW_CALLBACK CWGetIDEInfo(CWPluginContext context, CWIDEInfo* info);
/* Get the OS error associated with the last callback */
CW_CALLBACK CWGetCallbackOSError(CWPluginContext context, CWOSResult* error);
/* Set the OS error associated with a failed plugin request */
CW_CALLBACK CWSetPluginOSError(CWPluginContext context, CWOSResult);
/* Get the file specifier for the current project */
CW_CALLBACK CWGetProjectFile(CWPluginContext context, CWFileSpec* projectSpec);
/* Get the directory where the IDE stores target-specific generated data */
CW_CALLBACK CWGetTargetDataDirectory(CWPluginContext context, CWFileSpec* targetDataDirectorySpec);
/* Get the name of the current target in the current project */
CW_CALLBACK CWGetTargetName(CWPluginContext context, char* name, short maxLength);
/* Get the directory where output files should be stored */
CW_CALLBACK CWGetOutputFileDirectory(CWPluginContext context, CWFileSpec* outputFileDirectory);
/* Get the number of files in the current project */
CW_CALLBACK CWGetProjectFileCount(CWPluginContext context, long* count);
/* Get information about a particular file in the project */
CW_CALLBACK CWGetFileInfo(CWPluginContext context, long whichfile, Boolean checkFileLocation, CWProjectFileInfo* fileinfo);
/* Search for a file by name on the current file's access paths. */
CW_CALLBACK CWFindAndLoadFile(CWPluginContext context, const char* filename, CWFileInfo *fileinfo);
/* Get the access paths for the current target */
CW_CALLBACK CWGetAccessPathListInfo(CWPluginContext context, CWAccessPathListInfo* pathListInfo);
CW_CALLBACK CWGetAccessPathInfo(CWPluginContext context, CWAccessPathType pathType, long whichPath, CWAccessPathInfo* pathInfo);
CW_CALLBACK CWGetAccessPathSubdirectory(CWPluginContext context, CWAccessPathType pathType, long whichPath, long whichSubdirectory, CWFileSpec* subdirectory);
CW_CALLBACK CWGetFrameworkAccessPathListInfo(CWPluginContext context, CWFrameworkAccessPathListInfo* pathListInfo);
CW_CALLBACK CWGetFrameworkAccessPathInfo(CWPluginContext context, CWAccessPathType pathType, long whichPath, CWFrameworkAccessPathInfo* pathInfo);
/* Get file text, from the editor, include file cache, or by reading the file */
CW_CALLBACK CWGetFileText(CWPluginContext context, const CWFileSpec* filespec, const char** text, long* textLength, short* filedatatype);
/* Release file text returned by CWFindAndLoadFile and CWGetFileText */
CW_CALLBACK CWReleaseFileText(CWPluginContext context, const char* text);
/* Get information about a project segment */
CW_CALLBACK CWGetSegmentInfo(CWPluginContext context, long whichsegment, CWProjectSegmentInfo* segmentinfo);
/* Get the number of overlay groups in the target */
CW_CALLBACK CWGetOverlay1GroupsCount(CWPluginContext context, long* count);
/* Get information about a project overlay group */
CW_CALLBACK CWGetOverlay1GroupInfo(CWPluginContext context, long whichgroup, CWOverlay1GroupInfo* groupinfo);
/* Get information about an overlay within a group */
CW_CALLBACK CWGetOverlay1Info(CWPluginContext context, long whichgroup, long whichoverlay, CWOverlay1Info* overlayinfo);
/* Get information about a file in an overlay */
CW_CALLBACK CWGetOverlay1FileInfo(CWPluginContext context, long whichgroup, long whichoverlay, long whichoverlayfile, CWOverlay1FileInfo* fileinfo);
/* Report a error, warning, or informational message */
CW_CALLBACK CWReportMessage(CWPluginContext context, const CWMessageRef* msgRef, const char *line1, const char *line2, short errorlevel, long errorNumber);
/* Display an alert. May actually be put in a message, depending on the plugin request */
CW_CALLBACK CWAlert(CWPluginContext context, const char* msg1, const char* msg2, const char* msg3, const char* msg4);
/* Display one or two status messages to the user */
CW_CALLBACK CWShowStatus(CWPluginContext context, const char *line1, const char *line2);
/* Give to the IDE to handle events and check if user has canceled this operation */
CW_CALLBACK CWUserBreak(CWPluginContext context);
/* Return stored preference data, referenced by name. Typically used for preference */
/* panel settings. */
CW_CALLBACK CWGetNamedPreferences(CWPluginContext context, const char* prefsname, CWMemHandle* prefsdata);
/* Store data referenced by a data type and file number */
CW_CALLBACK CWStorePluginData(CWPluginContext context, long whichfile, CWDataType type, CWMemHandle prefsdata);
/* Return stored data referenced by a data type and file number */
CW_CALLBACK CWGetPluginData(CWPluginContext context, long whichfile, CWDataType type, CWMemHandle* prefsdata);
/* Inform the IDE that a file modification date has changed. isGenerated is for use */
/* by compiler and linker plugins only */
CW_CALLBACK CWSetModDate(CWPluginContext context, const CWFileSpec* filespec, CWFileTime* moddate, Boolean isGenerated);
/* Ask the IDE to add a file to the current target in the current project. isGenerated */
/* is for use by compiler plugins only. */
CW_CALLBACK CWAddProjectEntry(CWPluginContext context, const CWFileSpec* fileSpec, Boolean isGenerated, const CWNewProjectEntryInfo* projectEntryInfo, long* whichfile);
/* Ask the IDE to remove a file from the current target (link-order/segment/overlay) in the current project. */
/* If it's the last target that contains the file, it would be removed from the file list. */
CW_CALLBACK CWRemoveProjectEntry(CWPluginContext context, const CWFileSpec* fileSpec);
/* Create a new editor window, supplying initial text and an optional document name */
CW_CALLBACK CWCreateNewTextDocument(CWPluginContext, const CWNewTextDocumentInfo* docinfo);
/* Allocate memory. Permanent memory is not freed until the plugin is unloaded. */
/* Temporary memory is freed after each plugin request completes. */
CW_CALLBACK CWAllocateMemory(CWPluginContext context, long size, Boolean isPermanent, void** ptr);
/* Free memory allocated via CWAllocateMemory */
CW_CALLBACK CWFreeMemory(CWPluginContext context, void* ptr, Boolean isPermanent);
/* Allocate a memory handle of the requested size. All handles are automatically */
/* freed at the end of each compiler/linker request. useTempMemory is MacOS-specific*/
CW_CALLBACK CWAllocMemHandle(CWPluginContext context, long size, Boolean useTempMemory, CWMemHandle* handle);
/* Free a memory handle */
CW_CALLBACK CWFreeMemHandle(CWPluginContext context, CWMemHandle handle);
/* Return the current size of a memory handle */
CW_CALLBACK CWGetMemHandleSize(CWPluginContext context, CWMemHandle handle, long* size);
/* Resize an existing memory handle */
CW_CALLBACK CWResizeMemHandle(CWPluginContext context, CWMemHandle handle, long newSize);
/* To obtain a pointer to the block, you must lock the handle */
/* moveHi is MacOS-specific */
CW_CALLBACK CWLockMemHandle(CWPluginContext context, CWMemHandle handle, Boolean moveHi, void** ptr);
/* Unlock a memory handle, the pointer returned by locking the handle may no */
/* longer be valid */
CW_CALLBACK CWUnlockMemHandle(CWPluginContext context, CWMemHandle handle);
#if CWPLUGIN_HOST == CWPLUGIN_HOST_MACOS
/* Utility function to map MacOS error codes to a CWResult code. Plugins */
/* may internally generate OSErrs, but need to return CWResult to the */
/* CodeWarrior IDE */
CW_CALLBACK CWMacOSErrToCWResult(CWPluginContext context, OSErr err);
#endif
/* Turn off the built in PP window manager while the plugin displays a dialog */
CW_CALLBACK CWPreDialog(CWPluginContext context);
/* Turn on the built in PP window manager after the plugin is through with its */
/* dialog */
CW_CALLBACK CWPostDialog(CWPluginContext context);
/* Notify the IDE that the plugin will be performing actions on a file */
CW_CALLBACK CWPreFileAction(CWPluginContext context, const CWFileSpec *theFile);
/* Notify the IDE that the plugin is finished performing actions on a file */
CW_CALLBACK CWPostFileAction(CWPluginContext context, const CWFileSpec *theFile);
CW_CALLBACK CWResolveRelativePath(CWPluginContext context, const CWRelativePath* relativePath, CWFileSpec* fileSpec, Boolean create);
CW_CALLBACK CWFindLogicalDirectory(CWPluginContext context, long selector, CWFileSpec *dirSpec);
CW_CALLBACK CWOpenFileInEditor(CWPluginContext context, const CWFileSpec *fileSpec);
#if CWPLUGIN_HOST==CWPLUGIN_HOST_SOLARIS || CWPLUGIN_HOST==CWPLUGIN_HOST_LINUX
/* Forward declarations */
struct ICodeWarriorApp;
struct ICodeWarriorProject;
struct ICodeWarriorDesign;
struct ICodeWarriorTarget;
#endif /* CWPLUGIN_HOST==CWPLUGIN_HOST_SOLARIS || CWPLUGIN_HOST==CWPLUGIN_HOST_LINUX */
/* Get the IDE application COM interface. Fails if called from any thread */
/* other than the main IDE thread, e.g. a build thread. */
CW_CALLBACK CWGetCOMApplicationInterface(CWPluginContext context, struct ICodeWarriorApp **app);
/* Get the current project COM interface. Adds a reference upon return. */
/* Only succeeds if the plugin is being called in the context of a */
/* particular project. Fails if called from any thread */
/* other than the main IDE thread, e.g. a build thread. */
CW_CALLBACK CWGetCOMProjectInterface(CWPluginContext context, struct ICodeWarriorProject **project);
/* Get the current design COM interface. Adds a reference upon return. */
/* Only succeeds if the plugin is being called in the context of a */
/* particular target that is associated with a design. */
/* Fails if called from any thread other than the main IDE thread, */
/* e.g. a build thread. */
CW_CALLBACK CWGetCOMDesignInterface(CWPluginContext context, struct ICodeWarriorDesign **design);
/* Get the current target COM interface. Adds a reference upon return. */
/* Only succeeds if the plugin is being called in the context of a */
/* particular target. Fails if called from any thread */
/* other than the main IDE thread, e.g. a build thread. */
CW_CALLBACK CWGetCOMTargetInterface(CWPluginContext context, struct ICodeWarriorTarget **target);
#if CW_USE_PRAGMA_IMPORT
#pragma import reset
#endif
#ifdef __cplusplus
}
#endif
#ifdef _MSC_VER
#pragma pack(pop)
#endif
#ifdef __MWERKS__
#pragma options align=reset
#endif
#endif /* __CWPlugins_H__ */
\ No newline at end of file +/*
* CWPlugins.h - Common declarations for Metrowerks CodeWarrior� plugins
*
* Copyright � 1995-1997 Metrowerks, Inc. All rights reserved.
*
*/
#include "common.h"
#ifndef __CWPlugins_H__
#define __CWPlugins_H__
#ifdef __MWERKS__
# pragma once
#endif
#define CWPLUGIN_HOST_MACOS 1
#define CWPLUGIN_HOST_WIN32 2
#define CWPLUGIN_HOST_SOLARIS 3
#define CWPLUGIN_HOST_LINUX 4
#ifndef CWPLUGIN_HOST
# ifdef WIN32
# define CWPLUGIN_HOST CWPLUGIN_HOST_WIN32
# elif defined(macintosh)
# define CWPLUGIN_HOST CWPLUGIN_HOST_MACOS
# elif defined(__sun__)
# define CWPLUGIN_HOST CWPLUGIN_HOST_SOLARIS
# elif defined(__linux__) || defined(__CLION_IDE__)
# define CWPLUGIN_HOST CWPLUGIN_HOST_LINUX
# else
# error
# endif
#endif
#define CWPLUGIN_API_MACOS 1
#define CWPLUGIN_API_WIN32 2
#define CWPLUGIN_API_UNIX 3
#ifndef CWPLUGIN_API
# ifdef WIN32
# define CWPLUGIN_API CWPLUGIN_API_WIN32
# elif defined(macintosh)
# define CWPLUGIN_API CWPLUGIN_API_MACOS
# elif defined(__sun__) || defined(__linux__) || defined(__CLION_IDE__)
# define CWPLUGIN_API CWPLUGIN_API_UNIX
# else
# error
# endif
#endif
/*
** Radix 256 notation where a 32-bit integer is created from four
** ASCII characters. A four-character constant of this form, say
** 'ABCD', must always be represented with the same pattern, 0x41424344
** in this case, regardless of big/little endian issues.
*/
typedef SInt32 CWFourCharType;
#define CWFOURCHAR(a, b, c, d) \
(((CWFourCharType) ((a) & 0xff) << 24) \
| ((CWFourCharType) ((b) & 0xff) << 16) \
| ((CWFourCharType) ((c) & 0xff) << 8) \
| ((CWFourCharType) ((d) & 0xff)))
#if CWPLUGIN_API == CWPLUGIN_API_UNIX
#include <sys/param.h>
#endif
#ifndef CW_USE_PRAGMA_EXPORT
#if CWPLUGIN_HOST == CWPLUGIN_HOST_MACOS
#define CW_USE_PRAGMA_EXPORT 1
#else
#define CW_USE_PRAGMA_EXPORT 0
#endif
#endif
#ifndef CW_USE_PRAGMA_IMPORT
#if CWPLUGIN_HOST == CWPLUGIN_HOST_MACOS
#define CW_USE_PRAGMA_IMPORT 1
#else
#define CW_USE_PRAGMA_IMPORT 0
#endif
#endif
#ifdef __MWERKS__
#pragma options align=mac68k
#endif
#ifdef _MSC_VER
#pragma pack(push,2)
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if CW_USE_PRAGMA_IMPORT
#pragma import on
#endif
/* These constants specify the action the IDE is asking the plugin to execute */
enum {
reqInitialize = -2, /* called when the plugin is loaded */
reqTerminate = -1, /* called when the plugin is unloaded */
reqIdle = -100, /* called periodically to allow for plugin tasks EP 6/24/98 */
reqAbout = -101, /* called to ask plugin to display about dialog EP 6/24/98 */
reqPrefsChange = -102 /* called when an associated pref panel changes EP 6/24/98 */
};
/* Used in CWFileInfo.dependencyType to indicate what type of make */
/* dependency to establish between files */
typedef enum CWDependencyType {
cwNoDependency, /* do not establish a dependency */
cwNormalDependency, /* recompile dependent whenever prereq changes */
cwInterfaceDependency /* recompile only if interface to file changes */
} CWDependencyType;
/* Used in CWFileInfo.filedatatype to indicate the type of data in a loaded file */
enum {
cwFileTypeUnknown, /* unknown binary data */
cwFileTypeText, /* normal text file */
cwFileTypePrecompiledHeader /* cached precompiled header */
};
/* constant for CWFileInfo.isdependentoffile */
#define kCurrentCompiledFile -1L
/* constant for CWStorePluginData/CWGetPluginData */
#define kTargetGlobalPluginData -1L
/* constant for CWNewProjectEntryInfo link order, segment, and overlay values */
#define kDefaultLinkPosition -1L
/* Selectors for CWFindLogicalDirectory */
enum {
kIDEDirectorySelector = 1, /* parent directory of IDE application; "bin" folder on Win32 */
kCodeWarriorDirectorySelector, /* root CodeWarrior directory */
kSystemDirectorySelector, /* system directory */
kProjectDirectorySelector, /* parent directory of current project */
kProjectDataDirectorySelector, /* project data directory */
kTargetDataDirectorySelector, /* target data directory (within project data directory) */
kTargetObjectCodeDirectorySelector, /* object code directory (within target data directory) */
kDebuggerCacheDirectorySelector, /* "CW Debugging Cache" directory */
kHelperAppsDirectorySelector, /* "(Helper Apps)" directory */
kPluginsDirectorySelector, /* "CodeWarrior Plugins" (Mac) or "plugins" (Win32) directory */
kPluginParentDirectorySelector, /* parent directory of current plugin */
kStationeryDirectorySelector, /* "(Project Stationery)" directory */
kRADStationeryDirectorySelector, /* "RAD Stationery" directory */
kLocalizedResourcesDirectorySelector /* "resources" directory */
};
/* CWPluginContext is a magic cookie passed to all plugins. It must */
/* be passed back to all IDE callbacks */
typedef struct CWPluginPrivateContext* CWPluginContext;
/* CWResult is the error/status result returned by all IDE API routine. */
/* The most common errors are returned directly. For OS-specific errors, the */
/* CWResult is cwErrOSError, and the OS-specific error can be obtained by */
/* calling CWGetOSError() */
typedef SInt32 CWResult;
/* CWMemHandle is an abstraction for memory used in some parts */
/* of the plugin API. API routines must be used to allocate */
/* and free CWMemHandles, or to convert them to pointers. */
typedef struct CWMemHandlePrivateStruct* CWMemHandle;
/* Used to identify custom data associated by a plugin with */
/* a project file or a target as a whole. Must be a four character */
/* constant. All lower case constants are reserved by the IDE */
typedef UInt32 CWDataType;
/* Some information used in the compiler/linker API is platform-dependent */
/* We use some typedefs to isolate the differences */
/* CWFileSpec contains the native platform file specifier. */
/* CWFileName contains the string type for a native file name */
/* CWFileTime contains the native platform file timestamp */
/* CWOSResult contains the native platform error return value */
/* CWResult contains an API routine error/status result */
/* CW_CALLBACK is a macro defining the calling convention and return type for */
/* IDE callback routines. */
/* CW_PLUGINENTRY is a macro defining the calling convention and return type for */
/* plugin entry points. */
/* CWSUCCESS is a macro that evaluates to true when given a CWResult indicating an */
/* routine succeeded */
#if CWPLUGIN_API == CWPLUGIN_API_MACOS
typedef FSSpec CWFileSpec;
typedef char CWFileName[32];
typedef unsigned long CWFileTime;
typedef OSErr CWOSResult;
#elif CWPLUGIN_API == CWPLUGIN_API_WIN32
typedef unsigned char Boolean;
typedef struct CWFileSpec { char path[MAX_PATH]; } CWFileSpec;
typedef char CWFileName[65];
typedef FILETIME CWFileTime;
typedef DWORD CWOSResult;
#elif CWPLUGIN_API == CWPLUGIN_API_UNIX
#define MAX_PATH MAXPATHLEN
#ifndef __MACTYPES__
typedef unsigned char Boolean;
#endif
#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE 1
#endif
typedef struct CWFileSpec { char path[MAX_PATH]; } CWFileSpec;
typedef char CWFileName[65];
typedef time_t CWFileTime;
typedef int CWOSResult;
#else
#error Unknown plugin API!
#endif
#define CWSUCCESS(result) ((result) == 0)
#if CWPLUGIN_HOST == CWPLUGIN_HOST_MACOS
#define CW_CALLBACK pascal CWResult
#define CW_CALLBACK_PTR(function_name) pascal CWResult (function_name)
#define CWPLUGIN_ENTRY(function_name) pascal short (function_name)
#elif CWPLUGIN_HOST == CWPLUGIN_HOST_WIN32
#define CW_CALLBACK CWResult __stdcall
#define CW_CALLBACK_PTR(function_name) CWResult (__stdcall function_name)
#define CWPLUGIN_ENTRY(function_name) short (__stdcall function_name)
#elif CWPLUGIN_HOST==CWPLUGIN_HOST_SOLARIS || CWPLUGIN_HOST==CWPLUGIN_HOST_LINUX
#define CW_CALLBACK CWResult
#define CW_CALLBACK_PTR(function_name) CWResult (function_name)
#define CWPLUGIN_ENTRY(function_name) short (function_name)
#else
#error Unknown plugin host!
#endif
/* information returned by CWFindAndLoadFile */
typedef struct CWFileInfo {
Boolean fullsearch; /* [<-] do we do a full search of paths for file */
char dependencyType; /* [<-] type CWDependencyType */
SInt32 isdependentoffile; /* [<-] this file is a dependent of file id */
/* (zero based) or -1L if of current file */
Boolean suppressload; /* [<-] find but don't load the file */
Boolean padding; /* [**] structure padding */
const char* filedata; /* [->] point to the file text/data, or NULL */
SInt32 filedatalength; /* [->] length of filedata */
short filedatatype; /* [->] type of data pointed to by filedata */
/* the remaining members are valid only when called by compilers */
short fileID; /* [->] use in browse records and dependencies */
CWFileSpec filespec; /* [->] specifies the file on disk */
Boolean alreadyincluded; /* [->] TRUE if already included in current compile */
Boolean recordbrowseinfo; /* [->] record browse info for this file? */
} CWFileInfo;
/* information maintained by the IDE for each segment in the project */
typedef struct CWProjectSegmentInfo {
char name[32]; /* segment name */
short attributes; /* segment attributes */
} CWProjectSegmentInfo;
/* 64 bit address */
typedef struct CWAddr64 {
SInt32 lo; /* low order longword of address */
SInt32 hi; /* high order longword of address */
} CWAddr64;
/* describes an overlay group, Use CWGetOverlayGroup1Info to iterate over overlay groups */
typedef struct CWOverlay1GroupInfo {
char name[256]; /* overlay group name */
CWAddr64 address; /* load address */
SInt32 numoverlays; /* number of overlays in this group */
} CWOverlay1GroupInfo;
/* describes an overlay, use CWGetOverlay1Info to iterate over overlays */
typedef struct CWOverlay1Info {
char name[256]; /* name of this overlay */
SInt32 numfiles; /* number of files in the overlay */
} CWOverlay1Info;
/* describes a file in an overlay, use CWGetOverlayFile1Info to iterate over files. Use */
/* whichfile in calls taking a file number, e.g. CWLoadObjectData or CWGetFileInfo */
typedef struct CWOverlay1FileInfo {
SInt32 whichfile; /* flat file number */
} CWOverlay1FileInfo;
/*
* All compiler errors or warnings which occur at some specific location in some
* source file are identified by a CWMessageRef structure. This structure
* provides sufficient information for the development environment to locate
* and display the exact position associated with a message. For each message,
* the compiler provides:
*
* errorstring: contains a description of the error, e.g. "syntax error"
* errorline: contains a subset of the text containing the error
* errorlevel: indicates if the "error" is an error, warning, or informational message
* CWMessageRef: further info so the IDE can perform two tasks:
* - Display a summary of each message, with the "error token"
* underlined within the compiler-provided errorline. This
* information is provided by the tokenoffset and tokenlength
* fields. If tokenLength is zero then no underlining is performed.
*
* - Open the file containing the error and select the full
* text of the error. This information is provided by the
* selectionoffset and selectionlength fields.
*/
typedef struct CWMessageRef
{
CWFileSpec sourcefile; /* file containing error */
SInt32 linenumber; /* error linenumber in file */
short tokenoffset; /* offset into errorline of token underline */
short tokenlength; /* length of error token to be underlined */
SInt32 selectionoffset; /* start of error for text selection */
SInt32 selectionlength; /* length of error for text selection */
} CWMessageRef;
/* message types, used for errorlevel parameter to message routines */
enum {
messagetypeInfo, /* informational only */
messagetypeWarning, /* warning message */
messagetypeError /* error message */
};
/* information maintained by the IDE for each file in the project */
typedef struct CWProjectFileInfo
{
CWFileSpec filespec; /* CW_FileSpec of file in project */
CWFileTime moddate; /* date source file was last modified */
short segment; /* segment number of file */
Boolean hasobjectcode; /* file has object code to be linked */
Boolean hasresources; /* file has resources to be linked */
Boolean isresourcefile; /* file -is- a resource file to be linked */
Boolean weakimport; /* file has "Import Weak" flag set */
Boolean initbefore; /* file has "Init Before" flag set */
Boolean gendebug; /* file has generate debug info on */
CWFileTime objmoddate; /* date object code was last modified */
CWFileName dropinname; /* name of dropin used to process this file */
short fileID; /* fileID to use in browse records */
Boolean recordbrowseinfo; /* record browse info for this file? */
Boolean reserved; /* reserved and used internally */
#if CWPLUGIN_HOST == CWPLUGIN_HOST_MACOS
/* some Macintosh-specific information */
OSType filetype; /* MacOS file type */
OSType filecreator; /* MacOS file creator */
#endif
Boolean hasunitdata; /* file has associated unit data (Pascal) */
Boolean mergeintooutput; /* file has "Merge Into Output" flag set */
UInt32 unitdatadependencytag; /* dependency tag (i.e. checksum) of unit data (Pascal) */
} CWProjectFileInfo;
typedef struct CWNewTextDocumentInfo
{
const char* documentname; /* name for new document, can be NULL */
CWMemHandle text; /* initial text for document */
Boolean markDirty; /* mark doc as needing to be saved? */
} CWNewTextDocumentInfo;
typedef struct CWNewProjectEntryInfo
{ /* use kDefaultLinkPosition to get default link order, overlay, or segment */
SInt32 position; /* optional link order position */
SInt32 segment; /* optional segment number */
SInt32 overlayGroup; /* optional overlay group number */
SInt32 overlay; /* optional overlay number */
const char* groupPath; /* optional fully qualified path to file group */
Boolean mergeintooutput; /* set merge into output flag? */
Boolean weakimport; /* set weak import flag? */
Boolean initbefore; /* set initbefore flag? */
} CWNewProjectEntryInfo;
typedef struct CWIDEInfo
{
unsigned short majorVersion;
unsigned short minorVersion;
unsigned short bugFixVersion;
unsigned short buildVersion;
unsigned short dropinAPIVersion;
} CWIDEInfo;
/* Structures for getting the list of access paths. */
/* The callback does the filtering on the host flags, so the list returned */
/* will only contain the paths that are enabled for the host platform. */
/* There are separate APIs to get the Mac OS X framework style access paths. */
typedef enum CWAccessPathType {
cwSystemPath,
cwUserPath
} CWAccessPathType;
typedef struct CWAccessPathInfo
{
CWFileSpec pathSpec;
Boolean recursive;
SInt32 subdirectoryCount;
} CWAccessPathInfo;
typedef struct CWAccessPathListInfo
{
SInt32 systemPathCount;
SInt32 userPathCount;
Boolean alwaysSearchUserPaths;
Boolean convertPaths;
} CWAccessPathListInfo;
/* Structures for getting the list of Mac OS X framework access paths. */
/* The callback does the filtering on the host flags, so the list returned */
/* will only contain the Mac OS X framework style paths that are enabled for */
/* the host platform. */
/* There are separate APIs to get the traditional style access paths. */
typedef struct CWFrameworkAccessPathInfo
{
CWFileSpec pathSpec;
Boolean framework;
} CWFrameworkAccessPathInfo;
typedef struct CWFrameworkAccessPathListInfo
{
SInt32 systemPathCount;
SInt32 userPathCount;
Boolean alwaysSearchUserPaths;
Boolean convertPaths;
Boolean requireFrameworkIncludes;
} CWFrameworkAccessPathListInfo;
/* constants for different types of plugins */
/* Used in the dropintype in the DropInFlags, as well as for the MacOS file type */
enum
{
CWDROPINLINKERTYPE = CWFOURCHAR('L','i','n','k'), /* type for DropIn linkers */
CWDROPINCOMPILERTYPE= CWFOURCHAR('C','o','m','p'), /* type for DropIn compilers */
CWDROPINPREFSTYPE = CWFOURCHAR('P','a','n','L'), /* type for DropIn panels */
CWDROPINPREFSTYPE_1 = CWFOURCHAR('P','a','n','l'), /* type for 1.x IDE DropIn panels */
CWDROPINVCSTYPE = CWFOURCHAR('V','C','S',' '), /* type for DropIn version control */
CWDROPINCOMTYPE = CWFOURCHAR('C','O','M',' ') /* type for COM-only plugins */
};
typedef SInt32 CWPluginType; // one of the above types
/* Format of 'Flag' resources, or data returned by dropin's GetDropinFlags entry */
/* point. */
/* */
/* For the version 2 of these resource, we renamed the 'apiversion' field to */
/* 'earliestCompatibleAPIVersion' and added the 'newestAPIVersion' field. */
/* This allows plugins to support more than one API version and therefore run */
/* under more than one version of the IDE. The CWGetAPIVersion call should be used */
/* to determine what API version the IDE is using to talk to a plugin. */
#define kCurrentDropInFlagsVersion 2
typedef struct DropInFlags {
short rsrcversion; /* version number of resource */
CWDataType dropintype; /* dropin type (compiler, panel, etc) */
/* earliest API support by this plugin */
unsigned short earliestCompatibleAPIVersion;
UInt32 dropinflags; /* capability flags */
CWDataType edit_language; /* language */
unsigned short newestAPIVersion; /* newest API version supported */
} DropInFlags, **DropInFlagsHandle;
#define kCurrentCWPanelListVersion 1
typedef struct CWPanelList {
short version;
short count;
const char** names;
} CWPanelList;
#define kCurrentCWFamilyListVersion 1
#define kCurrentCWFamilyResourceVersion 1
typedef struct CWFamily {
CWDataType type;
const char* name;
} CWFamily;
typedef struct CWFamilyList {
short version;
short count;
CWFamily* families;
} CWFamilyList;
typedef struct CWFamilyResource {
short version;
CWDataType type;
unsigned char name[64];
} CWFamilyResource;
#define kCurrentCWHelpInfoVersion 1
typedef struct CWHelpInfo {
short version;
const char* helpFileName;
} CWHelpInfo;
#define kCurrentCWRelativePathVersion 1
typedef enum CWRelativePathFormat
{
format_Generic = 0, // Simple name, not platform-specific
format_Mac, // Uses : as separator :: for parent directory
format_Win, // Uses \ as separator .. for parent directory
format_Unix // Uses / as separator .. for parent directory
} CWRelativePathFormat;
typedef enum CWRelativePathTypes
{
type_Absolute = 0,
type_Project,
type_Compiler,
type_System,
type_UserDefined
} CWRelativePathTypes;
typedef struct CWRelativePath
{
short version; // version number
unsigned char pathType; // use CWRelativePathTypes
unsigned char pathFormat; // use CWRelativePathFormat
char userDefinedTree[256]; // user-defined tree name
char pathString[512]; // actual path string
} CWRelativePath;
/*
*
*/
#define kCurrentCWPluginInfoVersion 1
typedef struct CWPluginInfo
{
short version; // struct version number
const char* companyName; // i.e. Metrowerks
const char* pluginName; // Defaults to Dropin->GetName()
const char* pluginDisplayName;
const char* familyName; // i.e. Java
unsigned short majorIDEVersion; // Version of IDE Required
unsigned short minorIDEVersion;
} CWPluginInfo;
/* Declaration of plugin entry points that must be implemented by non-MacOS plugins */
/* It can also be implemented for MacOS plugins instead of having a 'Flag' resource */
CWPLUGIN_ENTRY (CWPlugin_GetDropInFlags)(const DropInFlags**, SInt32* flagsSize);
/* Declaration of plugin entry points that may optionally be implemented by plugins */
/* These entry points override the corresponding resources on MacOS */
CWPLUGIN_ENTRY (CWPlugin_GetDropInName)(const char** dropInName);
CWPLUGIN_ENTRY (CWPlugin_GetDisplayName)(const char** displayName);
CWPLUGIN_ENTRY (CWPlugin_GetPanelList)(const CWPanelList** panelList);
CWPLUGIN_ENTRY (CWPlugin_GetFamilyList)(const CWFamilyList** familyList);
CWPLUGIN_ENTRY (CWPlugin_GetHelpInfo)(const CWHelpInfo** helpInfo);
/* Declaration of info plugin entry point that must be implemented by all COM plugins */
CWPLUGIN_ENTRY (CWPlugin_GetPluginInfo)(const CWPluginInfo** pluginInfo);
/* Callback declarations: these callbacks are supported for all CodeWarrior plugins */
/* Get the action the IDE is requesting of the plugin */
CW_CALLBACK CWGetPluginRequest(CWPluginContext context, SInt32* request);
/* Call when finished handling a request, just before returning to the shell */
CW_CALLBACK CWDonePluginRequest(CWPluginContext, CWResult resultCode);
/* Get the version number of API used by the IDE to talk to the plugin */
CW_CALLBACK CWGetAPIVersion(CWPluginContext context, SInt32* version);
/* Get information about the IDE being used */
CW_CALLBACK CWGetIDEInfo(CWPluginContext context, CWIDEInfo* info);
/* Get the OS error associated with the last callback */
CW_CALLBACK CWGetCallbackOSError(CWPluginContext context, CWOSResult* error);
/* Set the OS error associated with a failed plugin request */
CW_CALLBACK CWSetPluginOSError(CWPluginContext context, CWOSResult);
/* Get the file specifier for the current project */
CW_CALLBACK CWGetProjectFile(CWPluginContext context, CWFileSpec* projectSpec);
/* Get the directory where the IDE stores target-specific generated data */
CW_CALLBACK CWGetTargetDataDirectory(CWPluginContext context, CWFileSpec* targetDataDirectorySpec);
/* Get the name of the current target in the current project */
CW_CALLBACK CWGetTargetName(CWPluginContext context, char* name, short maxLength);
/* Get the directory where output files should be stored */
CW_CALLBACK CWGetOutputFileDirectory(CWPluginContext context, CWFileSpec* outputFileDirectory);
/* Get the number of files in the current project */
CW_CALLBACK CWGetProjectFileCount(CWPluginContext context, SInt32* count);
/* Get information about a particular file in the project */
CW_CALLBACK CWGetFileInfo(CWPluginContext context, SInt32 whichfile, Boolean checkFileLocation, CWProjectFileInfo* fileinfo);
/* Search for a file by name on the current file's access paths. */
CW_CALLBACK CWFindAndLoadFile(CWPluginContext context, const char* filename, CWFileInfo *fileinfo);
/* Get the access paths for the current target */
CW_CALLBACK CWGetAccessPathListInfo(CWPluginContext context, CWAccessPathListInfo* pathListInfo);
CW_CALLBACK CWGetAccessPathInfo(CWPluginContext context, CWAccessPathType pathType, SInt32 whichPath, CWAccessPathInfo* pathInfo);
CW_CALLBACK CWGetAccessPathSubdirectory(CWPluginContext context, CWAccessPathType pathType, SInt32 whichPath, SInt32 whichSubdirectory, CWFileSpec* subdirectory);
CW_CALLBACK CWGetFrameworkAccessPathListInfo(CWPluginContext context, CWFrameworkAccessPathListInfo* pathListInfo);
CW_CALLBACK CWGetFrameworkAccessPathInfo(CWPluginContext context, CWAccessPathType pathType, SInt32 whichPath, CWFrameworkAccessPathInfo* pathInfo);
/* Get file text, from the editor, include file cache, or by reading the file */
CW_CALLBACK CWGetFileText(CWPluginContext context, const CWFileSpec* filespec, const char** text, SInt32* textLength, short* filedatatype);
/* Release file text returned by CWFindAndLoadFile and CWGetFileText */
CW_CALLBACK CWReleaseFileText(CWPluginContext context, const char* text);
/* Get information about a project segment */
CW_CALLBACK CWGetSegmentInfo(CWPluginContext context, SInt32 whichsegment, CWProjectSegmentInfo* segmentinfo);
/* Get the number of overlay groups in the target */
CW_CALLBACK CWGetOverlay1GroupsCount(CWPluginContext context, SInt32* count);
/* Get information about a project overlay group */
CW_CALLBACK CWGetOverlay1GroupInfo(CWPluginContext context, SInt32 whichgroup, CWOverlay1GroupInfo* groupinfo);
/* Get information about an overlay within a group */
CW_CALLBACK CWGetOverlay1Info(CWPluginContext context, SInt32 whichgroup, SInt32 whichoverlay, CWOverlay1Info* overlayinfo);
/* Get information about a file in an overlay */
CW_CALLBACK CWGetOverlay1FileInfo(CWPluginContext context, SInt32 whichgroup, SInt32 whichoverlay, SInt32 whichoverlayfile, CWOverlay1FileInfo* fileinfo);
/* Report a error, warning, or informational message */
CW_CALLBACK CWReportMessage(CWPluginContext context, const CWMessageRef* msgRef, const char *line1, const char *line2, short errorlevel, SInt32 errorNumber);
/* Display an alert. May actually be put in a message, depending on the plugin request */
CW_CALLBACK CWAlert(CWPluginContext context, const char* msg1, const char* msg2, const char* msg3, const char* msg4);
/* Display one or two status messages to the user */
CW_CALLBACK CWShowStatus(CWPluginContext context, const char *line1, const char *line2);
/* Give to the IDE to handle events and check if user has canceled this operation */
CW_CALLBACK CWUserBreak(CWPluginContext context);
/* Return stored preference data, referenced by name. Typically used for preference */
/* panel settings. */
CW_CALLBACK CWGetNamedPreferences(CWPluginContext context, const char* prefsname, CWMemHandle* prefsdata);
/* Store data referenced by a data type and file number */
CW_CALLBACK CWStorePluginData(CWPluginContext context, SInt32 whichfile, CWDataType type, CWMemHandle prefsdata);
/* Return stored data referenced by a data type and file number */
CW_CALLBACK CWGetPluginData(CWPluginContext context, SInt32 whichfile, CWDataType type, CWMemHandle* prefsdata);
/* Inform the IDE that a file modification date has changed. isGenerated is for use */
/* by compiler and linker plugins only */
CW_CALLBACK CWSetModDate(CWPluginContext context, const CWFileSpec* filespec, CWFileTime* moddate, Boolean isGenerated);
/* Ask the IDE to add a file to the current target in the current project. isGenerated */
/* is for use by compiler plugins only. */
CW_CALLBACK CWAddProjectEntry(CWPluginContext context, const CWFileSpec* fileSpec, Boolean isGenerated, const CWNewProjectEntryInfo* projectEntryInfo, SInt32* whichfile);
/* Ask the IDE to remove a file from the current target (link-order/segment/overlay) in the current project. */
/* If it's the last target that contains the file, it would be removed from the file list. */
CW_CALLBACK CWRemoveProjectEntry(CWPluginContext context, const CWFileSpec* fileSpec);
/* Create a new editor window, supplying initial text and an optional document name */
CW_CALLBACK CWCreateNewTextDocument(CWPluginContext, const CWNewTextDocumentInfo* docinfo);
/* Allocate memory. Permanent memory is not freed until the plugin is unloaded. */
/* Temporary memory is freed after each plugin request completes. */
CW_CALLBACK CWAllocateMemory(CWPluginContext context, SInt32 size, Boolean isPermanent, void** ptr);
/* Free memory allocated via CWAllocateMemory */
CW_CALLBACK CWFreeMemory(CWPluginContext context, void* ptr, Boolean isPermanent);
/* Allocate a memory handle of the requested size. All handles are automatically */
/* freed at the end of each compiler/linker request. useTempMemory is MacOS-specific*/
CW_CALLBACK CWAllocMemHandle(CWPluginContext context, SInt32 size, Boolean useTempMemory, CWMemHandle* handle);
/* Free a memory handle */
CW_CALLBACK CWFreeMemHandle(CWPluginContext context, CWMemHandle handle);
/* Return the current size of a memory handle */
CW_CALLBACK CWGetMemHandleSize(CWPluginContext context, CWMemHandle handle, SInt32* size);
/* Resize an existing memory handle */
CW_CALLBACK CWResizeMemHandle(CWPluginContext context, CWMemHandle handle, SInt32 newSize);
/* To obtain a pointer to the block, you must lock the handle */
/* moveHi is MacOS-specific */
CW_CALLBACK CWLockMemHandle(CWPluginContext context, CWMemHandle handle, Boolean moveHi, void** ptr);
/* Unlock a memory handle, the pointer returned by locking the handle may no */
/* longer be valid */
CW_CALLBACK CWUnlockMemHandle(CWPluginContext context, CWMemHandle handle);
#if CWPLUGIN_HOST == CWPLUGIN_HOST_MACOS
/* Utility function to map MacOS error codes to a CWResult code. Plugins */
/* may internally generate OSErrs, but need to return CWResult to the */
/* CodeWarrior IDE */
CW_CALLBACK CWMacOSErrToCWResult(CWPluginContext context, OSErr err);
#endif
/* Turn off the built in PP window manager while the plugin displays a dialog */
CW_CALLBACK CWPreDialog(CWPluginContext context);
/* Turn on the built in PP window manager after the plugin is through with its */
/* dialog */
CW_CALLBACK CWPostDialog(CWPluginContext context);
/* Notify the IDE that the plugin will be performing actions on a file */
CW_CALLBACK CWPreFileAction(CWPluginContext context, const CWFileSpec *theFile);
/* Notify the IDE that the plugin is finished performing actions on a file */
CW_CALLBACK CWPostFileAction(CWPluginContext context, const CWFileSpec *theFile);
CW_CALLBACK CWResolveRelativePath(CWPluginContext context, const CWRelativePath* relativePath, CWFileSpec* fileSpec, Boolean create);
CW_CALLBACK CWFindLogicalDirectory(CWPluginContext context, SInt32 selector, CWFileSpec *dirSpec);
CW_CALLBACK CWOpenFileInEditor(CWPluginContext context, const CWFileSpec *fileSpec);
#if CWPLUGIN_HOST==CWPLUGIN_HOST_SOLARIS || CWPLUGIN_HOST==CWPLUGIN_HOST_LINUX
/* Forward declarations */
struct ICodeWarriorApp;
struct ICodeWarriorProject;
struct ICodeWarriorDesign;
struct ICodeWarriorTarget;
#endif /* CWPLUGIN_HOST==CWPLUGIN_HOST_SOLARIS || CWPLUGIN_HOST==CWPLUGIN_HOST_LINUX */
/* Get the IDE application COM interface. Fails if called from any thread */
/* other than the main IDE thread, e.g. a build thread. */
CW_CALLBACK CWGetCOMApplicationInterface(CWPluginContext context, struct ICodeWarriorApp **app);
/* Get the current project COM interface. Adds a reference upon return. */
/* Only succeeds if the plugin is being called in the context of a */
/* particular project. Fails if called from any thread */
/* other than the main IDE thread, e.g. a build thread. */
CW_CALLBACK CWGetCOMProjectInterface(CWPluginContext context, struct ICodeWarriorProject **project);
/* Get the current design COM interface. Adds a reference upon return. */
/* Only succeeds if the plugin is being called in the context of a */
/* particular target that is associated with a design. */
/* Fails if called from any thread other than the main IDE thread, */
/* e.g. a build thread. */
CW_CALLBACK CWGetCOMDesignInterface(CWPluginContext context, struct ICodeWarriorDesign **design);
/* Get the current target COM interface. Adds a reference upon return. */
/* Only succeeds if the plugin is being called in the context of a */
/* particular target. Fails if called from any thread */
/* other than the main IDE thread, e.g. a build thread. */
CW_CALLBACK CWGetCOMTargetInterface(CWPluginContext context, struct ICodeWarriorTarget **target);
#if CW_USE_PRAGMA_IMPORT
#pragma import reset
#endif
#ifdef __cplusplus
}
#endif
#ifdef _MSC_VER
#pragma pack(pop)
#endif
#ifdef __MWERKS__
#pragma options align=reset
#endif
#endif /* __CWPlugins_H__ */
\ No newline at end of file diff --git a/sdk_hdrs/DropInCompilerLinker.h b/sdk_hdrs/DropInCompilerLinker.h index 8551a86..4dd87f6 100755 --- a/sdk_hdrs/DropInCompilerLinker.h +++ b/sdk_hdrs/DropInCompilerLinker.h @@ -1 +1 @@ -/*
* DropInCompilerLinker.h - Drop-In Interface for Metrowerks CodeWarriorª Compilers and Linkers
*
* Copyright © 1996 Metrowerks, Inc. All rights reserved.
*
*/
#ifndef __DROPINCOMPILERLINKER_H__
#define __DROPINCOMPILERLINKER_H__
#ifdef __MWERKS__
# pragma once
#endif
#ifndef __CWPlugins_H__
#include "CWPlugins.h"
#endif
#ifndef __COMPILERMAPPING_H__
#include "CompilerMapping.h"
#endif
#ifdef __MWERKS__
#pragma options align=mac68k
#endif
#ifdef _MSC_VER
#pragma pack(push,2)
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if CW_USE_PRAGMA_IMPORT
#pragma import on
#endif
/* this is the current version number of the API documented herein */
#define DROPINCOMPILERLINKERAPIVERSION_4 4
#define DROPINCOMPILERLINKERAPIVERSION_5 5
#define DROPINCOMPILERLINKERAPIVERSION_6 6
#define DROPINCOMPILERLINKERAPIVERSION_7 7
#define DROPINCOMPILERLINKERAPIVERSION_8 8
#define DROPINCOMPILERLINKERAPIVERSION_9 9
#define DROPINCOMPILERLINKERAPIVERSION_10 10
#define DROPINCOMPILERLINKERAPIVERSION_11 11
#define DROPINCOMPILERLINKERAPIVERSION_12 12
#define DROPINCOMPILERLINKERAPIVERSION_13 13
#define DROPINCOMPILERLINKERAPIVERSION DROPINCOMPILERLINKERAPIVERSION_13
/* deprecated request codes */
enum {
reqInitCompiler = reqInitialize, /* (called when compiler is loaded) */
reqTermCompiler = reqTerminate, /* (called when compiler is unloaded) */
reqInitLinker = reqInitialize, /* (called when linker is loaded) */
reqTermLinker = reqTerminate /* (called when linker is unloaded) */
};
/* request codes (common) */
enum {
reqTargetCompileEnded = -17, /* Sent when target's compile phase ends */
reqTargetCompileStarted = -16, /* Sent when target's compile phase starts */
reqTargetLinkEnded = -15, /* Sent when the link has ended */
reqTargetLinkStarted = -14, /* Sent when the link starts */
reqFileListBuildEnded = -13, /* Sent when the group file build ends */
reqFileListBuildStarted = -12, /* Sent when the group file build starts */
reqSubProjectBuildEnded = -11, /* Sent when subproject's build ends */
reqSubProjectBuildStarted = -10, /* Sent when subproject's build starts */
reqTargetBuildEnded = -9, /* Sent when target's build ends */
reqTargetBuildStarted = -8, /* Sent when target's build starts */
reqProjectBuildEnded = -7, /* Sent when project build ends */
reqProjectBuildStarted = -6, /* Sent when project build starts */
reqTargetLoaded = -5, /* called when the "keeps target info" flag is set */
reqTargetPrefsChanged = -4, /* called when the "keeps target info" flag is set */
reqTargetUnloaded = -3 /* called when the "keeps target info" flag is set */
};
/* requests codes (compilers) */
enum {
reqCompile = 0, /* compile/precompile/preprocess source file */
/* and return results */
reqMakeParse, /* used internally by Metrowerks */
reqCompDisassemble, /* disassemble a specific file in the project */
reqCheckSyntax, /* check syntax, but don't generate code */
reqPreprocessForDebugger /* when preprocess, don't open window w/results */
};
/* requests codes (linkers) */
enum {
reqLink = 0, /* link project and generate executable or library */
reqDisassemble, /* disassemble a specific file in the project */
reqTargetInfo, /* get info about the generated executable */
reqPreRun /* give linker a last chance to modify target info */
};
/* Returned as part of CWFileInfo to indicate the */
/* type of data pointed to by the filedata pointer */
enum {
filetypeText, /* data is text */
filetypeUnknown /* unknown type, could be precompiled header */
};
/* executable linkage types, used in CWTargetInfo.linkType */
enum {
exelinkageFlat, /* flat executable */
exelinkageSegmented, /* uses 68K code segments */
exelinkageOverlay1 /* uses overlay groups and overlays */
};
/* output file type, used in CWTargetInfo.outputType */
enum {
linkOutputNone, /* linker produces no output */
linkOutputFile, /* linker produces a file */
linkOutputDirectory /* linker produces a directory */
};
/* Constants for the targetCPU field of the CWTargetInfo struct */
enum {
targetCPU68K = CWFOURCHAR('6','8','k',' '),
targetCPUPowerPC = CWFOURCHAR('p','p','c',' '),
targetCPUi80x86 = CWFOURCHAR('8','0','8','6'),
targetCPUMips = CWFOURCHAR('m','i','p','s'),
targetCPUNECv800 = CWFOURCHAR('v','8','0','0'),
targetCPUEmbeddedPowerPC = CWFOURCHAR('e','P','P','C'),
targetCPUARM = CWFOURCHAR('a','r','m',' '),
targetCPUSparc = CWFOURCHAR('s','p','r','c'),
targetCPUIA64 = CWFOURCHAR('I','A','6','4'),
targetCPUAny = CWFOURCHAR('*','*','*','*'),
targetCPUMCORE = CWFOURCHAR('m','c','o','r'),
targetCPU_Intent = CWFOURCHAR('n','t','n','t')
};
/* Constants for the targetOS field of the CWTargetInfo struct */
enum {
targetOSMacintosh = CWFOURCHAR('m','a','c',' '),
targetOSWindows = CWFOURCHAR('w','i','n','t'),
targetOSNetware = CWFOURCHAR('n','l','m',' '),
targetOSMagicCap = CWFOURCHAR('m','c','a','p'),
targetOSOS9 = CWFOURCHAR('o','s','9',' '),
targetOSEmbeddedABI = CWFOURCHAR('E','A','B','I'),
targetOSJava = CWFOURCHAR('j','a','v','a'), /* java (no VM specification) */
targetOSJavaMS = CWFOURCHAR('j','v','m','s'), /* Microsoft VM */
targetOSJavaSun = CWFOURCHAR('j','v','s','n'), /* Sun VM */
targetOSJavaMRJ = CWFOURCHAR('j','v','m','r'), /* MRJ VM */
targetOSJavaMW = CWFOURCHAR('j','v','m','w'), /* Metrowerks VM */
targetOSPalm = CWFOURCHAR('p','a','l','m'),
targetOSGTD5 = CWFOURCHAR('g','t','d','5'),
targetOSSolaris = CWFOURCHAR('s','l','r','s'),
targetOSLinux = CWFOURCHAR('l','n','u','x'),
targetOSAny = CWFOURCHAR('*','*','*','*'),
targetOS_Intent = CWFOURCHAR('n','t','n','t')
};
/* linker flags, as used in member dropinflags of DropInFlags struct returned by linkers */
enum {
cantDisassemble = 1L << 31, /* this linker doesn't support 'Disassemble' */
isPostLinker = 1L << 30, /* this is a post linker */
linkAllowDupFileNames = 1L << 29, /* allow multiple project files with the same name */
linkMultiTargAware = 1L << 28, /* the linker can be used with multiple targets */
isPreLinker = 1L << 27, /* this is a pre linker */
linkerUsesTargetStorage = 1L << 26, /* the linker keeps storage per target */
linkerUnmangles = 1L << 25, /* The linker supports unmangling. */
magicCapLinker = 1L << 24, /* Pre- or post-linker is used for MagicCap */
linkAlwaysReload = 1L << 23, /* Always reload the linker before request */
linkRequiresProjectBuildStartedMsg = 1L << 22, /* Linker listens for a Project Build Started/Ended message */
linkRequiresTargetBuildStartedMsg = 1L << 21, /* Linker listens for a Target Build Started/Ended message */
linkRequiresSubProjectBuildStartedMsg = 1L << 20, /* Linker listens for a Sub Project Build Started/Ended message */
linkRequiresFileListBuildStartedMsg = 1L << 19, /* Linker listens for a File List Build Started/Ended message */
linkRequiresTargetLinkStartedMsg = 1L << 18, /* Linker listens for a Target Link Started/Ended message */
linkerWantsPreRunRequest = 1L << 17, /* Linker wants to be sent the pre-run request */
linkerGetTargetInfoThreadSafe = 1L << 16, /* GetTargetInfo call doesn't use any globals, etc. */
linkerUsesCaseInsensitiveSymbols = 1L << 15, /* All languages used by linker contain case insensitive browser symbols */
linkerDisasmRequiresPreprocess = 1L << 14, /* (obsolete) file must be preprocesed before being passed to linker for disasm */
linkerUsesFrameworks = 1L << 13, /* target uses frameworks; enables framework-style file searching */
linkerInitializeOnMainThread = 1L << 12 /* The Linker needs to be intialized on the main thread. */
/* remaining flags are reserved for future use and should be zero-initialized */
};
/* ways to store dependency returned as CWFileSpec in StoreObjectData */
enum {
cwAccessAbsolute,
cwAccessPathRelative,
cwAccessFileName,
cwAccessFileRelative
};
/* specifies what browser information compilers should generate */
/* they should always generate records for globals and functions */
typedef struct CWBrowseOptions {
Boolean recordClasses; /* [<-] do we record info for classes */
Boolean recordEnums; /* [<-] do we record info for enums */
Boolean recordMacros; /* [<-] do we record info for macros */
Boolean recordTypedefs; /* [<-] do we record info for typedefs */
Boolean recordConstants; /* [<-] do we record info for constants */
Boolean recordTemplates; /* [<-] do we record info for templates */
Boolean recordUndefinedFunctions; /* [<-] do we record info for undefined functions */
long reserved1; /* reserved space */
long reserved2; /* reserved space */
} CWBrowseOptions;
/* A dependency tag is associated with unit data in the StoreUnitData callback. It should */
/* change whenever unit data has changed in a way that forces its dependents to be rebuilt. */
/* Typically, it is just a checksum on the unit data. */
typedef unsigned long CWDependencyTag;
/* dependency information passed back in StoreObjectData */
typedef struct CWDependencyInfo {
long fileIndex; /* Another project entry. -1 => use fileSpec */
CWFileSpec fileSpec; /* location of file. Only used if fileIndex < 0 */
short fileSpecAccessType; /* One of cwAccessAbsolute, etc. above. Only */
/* used is specifying via fileSpec. */
short dependencyType; /* cwNormalDependency or cwInterfaceDependency. */
/* Values defined in CWPlugins.h */
} CWDependencyInfo;
/* information used when calling StoreObjectData */
typedef struct CWObjectData {
CWMemHandle objectdata; /* Handle to generated object code, */
/* resource data, or preprocessed text */
CWMemHandle browsedata; /* Handle to generated browse data */
long reserved1; /* reserved for future use, set to zero */
long codesize; /* size of generated code */
long udatasize; /* size of uninitialized data */
long idatasize; /* size of initialized data */
long compiledlines; /* number of lines of source compiled */
Boolean interfaceChanged; /* recompile interface dependents? */
long reserved2; /* reserved for future use, set to zero */
void* compilecontext; /* used internally by Metrowerks */
CWDependencyInfo* dependencies; /* optional array of dependencies */
short dependencyCount; /* overrides those collected by IDE */
CWFileSpec* objectfile; /* external object code file (i.e. .o file) */
} CWObjectData;
/* characteristics of a link target */
typedef struct CWTargetInfo {
short outputType; /* outputs file, directory, or nothing */
CWFileSpec outfile; /* generated executable file/folder spec */
CWFileSpec symfile; /* generated debug file spec */
CWFileSpec runfile; /* file to run, can be same or different from outfile */
short linkType; /* flat, segmented, or overlays */
Boolean canRun; /* "Run" can be performed on this target */
Boolean canDebug; /* "Run with Debugger" can be performed on this target */
CWDataType targetCPU; /* target CPU architecture (e.g. 68K, PowerPC, x86, MIPS)*/
CWDataType targetOS; /* target OS (e.g. MacOS, Windows, Unix) */
#if CWPLUGIN_HOST == CWPLUGIN_HOST_MACOS
OSType outfileCreator; /* file creator, if outputType == linkOutputFile */
OSType outfileType; /* file type, if outputType == linkOutputFile */
OSType debuggerCreator; /* file creator of debugger for this target */
OSType runHelperCreator; /* creator of helper app to use when running this file. */
#endif
#if CWPLUGIN_HOST == CWPLUGIN_HOST_WIN32
Boolean runHelperIsRegKey; /* true if runHelperName is a registry key */
Boolean debugHelperIsRegKey;/* true if debugHelperName is a registry key */
char args[512]; /* command line arguments */
char runHelperName[512]; /* full path to the run helper executable or a reg key */
Boolean runHelperRequiresURL;/* Indicates whether the outfile must be converted to */
/* a file scheme URL before being passed to the run */
/* helper app */
char reserved2;
char debugHelperName[512];/* full path to the debug helper executable or a reg key*/
#endif
// We need the args for Solaris
#if (CWPLUGIN_HOST == CWPLUGIN_HOST_SOLARIS || CWPLUGIN_HOST == CWPLUGIN_HOST_LINUX)
char args[512]; /* command line arguments */
char runHelperName[512]; /* Relative path name from (Helper Apps) to run helper program */
Boolean runHelperRequiresURL; /* Indicates whether the outfile must be converted to */
/* a file scheme URL before being passed to the run */
/* helper app */
char reserved2[3];
char debugHelperName[512]; /* Relative path name from (Helper Apps) to debug helper */
#endif
CWFileSpec linkAgainstFile; /* file parent targets link against (e.g. lib file) */
} CWTargetInfo;
typedef struct CWUnmangleInfo {
void* targetStorage;
const char* mangledName;
char* unmangleBuff;
long unmangleBuffSize;
unsigned short browserClassID;
unsigned char browserLang;
unsigned char filler1;
} CWUnmangleInfo;
/* Types used to get compiler-specific browser symbol information. */
typedef struct CWCompilerBrSymbol {
char symName[32];
char symUIName[32];
} CWCompilerBrSymbol;
typedef struct CWCompilerBrSymbolList {
short count;
CWCompilerBrSymbol items[1];
} CWCompilerBrSymbolList;
typedef struct CWCompilerBrSymbolInfo {
void* targetStorage;
CWCompilerBrSymbolList* symList; /* [<-] Compiler should put a pointer to the read-only list here.*/
} CWCompilerBrSymbolInfo;
typedef struct CWFrameworkInfo {
CWFileSpec fileSpec; /* location of ".framework" directory */
char version[256]; /* which version directory to use; if empty use "Current" sym link */
} CWFrameworkInfo;
/*** Declaration of plugin entry points that must be implemented by non-MacOS plugins ***/
/*** It can also be implemented by a MacOS plugin to override the 'Targ' resource ***/
CWPLUGIN_ENTRY (CWPlugin_GetTargetList)(const struct CWTargetList**);
/*** Optional entry points ***/
CWPLUGIN_ENTRY (CWPlugin_GetDefaultMappingList)(const struct CWExtMapList**);
CWPLUGIN_ENTRY (Helper_Unmangle)(CWUnmangleInfo*);
CWPLUGIN_ENTRY (Helper_GetCompilerBrSymbols)(CWCompilerBrSymbolInfo*);
/*** callbacks to the IDE, in addition to those in CWPlugins.h ***/
CW_CALLBACK CWIsPrecompiling(CWPluginContext context, Boolean* isPrecompiling);
CW_CALLBACK CWIsAutoPrecompiling(CWPluginContext context, Boolean* isAutoPrecompiling);
CW_CALLBACK CWIsPreprocessing(CWPluginContext context, Boolean* isPreprocessing);
CW_CALLBACK CWIsGeneratingDebugInfo(CWPluginContext context, Boolean* isGenerating);
CW_CALLBACK CWIsCachingPrecompiledHeaders(CWPluginContext context, Boolean* isCaching);
CW_CALLBACK CWGetBrowseOptions(CWPluginContext context, CWBrowseOptions* browseOptions);
CW_CALLBACK CWGetBuildSequenceNumber(CWPluginContext context, long* sequenceNumber);
CW_CALLBACK CWGetTargetInfo(CWPluginContext context, CWTargetInfo* targetInfo);
CW_CALLBACK CWSetTargetInfo(CWPluginContext context, CWTargetInfo* targetInfo);
CW_CALLBACK CWGetTargetStorage(CWPluginContext context, void** storage);
CW_CALLBACK CWSetTargetStorage(CWPluginContext context, void* storage);
CW_CALLBACK CWGetMainFileNumber(CWPluginContext context, long* fileNumber);
CW_CALLBACK CWGetMainFileID(CWPluginContext context, short* fileID);
CW_CALLBACK CWGetMainFileSpec(CWPluginContext context, CWFileSpec* fileSpec);
CW_CALLBACK CWGetMainFileText(CWPluginContext context, const char** text, long* textLength);
CW_CALLBACK CWCachePrecompiledHeader(CWPluginContext context, const CWFileSpec* filespec, CWMemHandle pchhandle);
CW_CALLBACK CWLoadObjectData(CWPluginContext context, long whichfile, CWMemHandle* objectdata);
CW_CALLBACK CWFreeObjectData(CWPluginContext context, long whichfile, CWMemHandle objectdata);
CW_CALLBACK CWStoreObjectData(CWPluginContext context, long whichfile, CWObjectData* object);
CW_CALLBACK CWGetSuggestedObjectFileSpec(CWPluginContext context, long whichfile, CWFileSpec* fileSpec);
CW_CALLBACK CWGetStoredObjectFileSpec(CWPluginContext context, long whichfile, CWFileSpec* fileSpec);
CW_CALLBACK CWDisplayLines(CWPluginContext context, long nlines);
CW_CALLBACK CWBeginSubCompile(CWPluginContext context, long whichfile, CWPluginContext* subContext);
CW_CALLBACK CWEndSubCompile(CWPluginContext subContext);
CW_CALLBACK CWGetPrecompiledHeaderSpec(CWPluginContext context, CWFileSpec *pchspec, const char *target);
CW_CALLBACK CWGetResourceFile(CWPluginContext context, CWFileSpec* filespec);
CW_CALLBACK CWPutResourceFile(CWPluginContext context, const char* prompt, const char* name, CWFileSpec* filespec);
/* Metrowerks Pascal support */
CW_CALLBACK CWLookUpUnit(CWPluginContext context, const char* name, Boolean isdependency, const void** unitdata, long* unitdatalength);
CW_CALLBACK CWSBMfiles(CWPluginContext context, short libref);
CW_CALLBACK CWStoreUnit(CWPluginContext context, const char* unitname, CWMemHandle unitdata, CWDependencyTag dependencytag);
CW_CALLBACK CWReleaseUnit(CWPluginContext context, void* unitdata);
CW_CALLBACK CWUnitNameToFileName(CWPluginContext context, const char* unitname, char* filename);
/* obsolete, for MacOS backward compatibility only */
#if CWPLUGIN_API == CWPLUGIN_API_MACOS
CW_CALLBACK CWOSAlert(CWPluginContext context, const char* message, OSErr errorcode);
CW_CALLBACK CWOSErrorMessage(CWPluginContext context, const char *msg, OSErr errorcode);
#endif
CW_CALLBACK CWGetModifiedFiles(CWPluginContext context, long* modifiedFileCount, const long** modifiedFiles);
/* Get information from the "Runtime Settings" panel */
CW_CALLBACK CWGetCommandLineArgs(CWPluginContext context, const char** commandLineArgs);
CW_CALLBACK CWGetWorkingDirectory(CWPluginContext context, CWFileSpec* workingDirectorySpec);
CW_CALLBACK CWGetEnvironmentVariableCount(CWPluginContext context, long* count);
CW_CALLBACK CWGetEnvironmentVariable(CWPluginContext context, long index, const char** name, const char** value);
CW_CALLBACK CWGetFrameworkCount(CWPluginContext context, long* frameworkCount);
CW_CALLBACK CWGetFrameworkInfo(CWPluginContext context, long whichFramework, CWFrameworkInfo* frameworkInfo);
CW_CALLBACK CWGetFrameworkSharedLibrary(CWPluginContext context, long whichFramework, CWFileSpec* frameworkSharedLibrary);
#if CW_USE_PRAGMA_IMPORT
#pragma import reset
#endif
#ifdef __cplusplus
}
#endif
#ifdef _MSC_VER
#pragma pack(pop,2)
#endif
#ifdef __MWERKS__
#pragma options align=reset
#endif
#endif /* __DROPINCOMPILERLINKER_H__ */
\ No newline at end of file +/*
* DropInCompilerLinker.h - Drop-In Interface for Metrowerks CodeWarrior� Compilers and Linkers
*
* Copyright � 1996 Metrowerks, Inc. All rights reserved.
*
*/
#ifndef __DROPINCOMPILERLINKER_H__
#define __DROPINCOMPILERLINKER_H__
#ifdef __MWERKS__
# pragma once
#endif
#ifndef __CWPlugins_H__
#include "CWPlugins.h"
#endif
#ifndef __COMPILERMAPPING_H__
#include "CompilerMapping.h"
#endif
#ifdef __MWERKS__
#pragma options align=mac68k
#endif
#ifdef _MSC_VER
#pragma pack(push,2)
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if CW_USE_PRAGMA_IMPORT
#pragma import on
#endif
/* this is the current version number of the API documented herein */
#define DROPINCOMPILERLINKERAPIVERSION_4 4
#define DROPINCOMPILERLINKERAPIVERSION_5 5
#define DROPINCOMPILERLINKERAPIVERSION_6 6
#define DROPINCOMPILERLINKERAPIVERSION_7 7
#define DROPINCOMPILERLINKERAPIVERSION_8 8
#define DROPINCOMPILERLINKERAPIVERSION_9 9
#define DROPINCOMPILERLINKERAPIVERSION_10 10
#define DROPINCOMPILERLINKERAPIVERSION_11 11
#define DROPINCOMPILERLINKERAPIVERSION_12 12
#define DROPINCOMPILERLINKERAPIVERSION_13 13
#define DROPINCOMPILERLINKERAPIVERSION DROPINCOMPILERLINKERAPIVERSION_13
/* deprecated request codes */
enum {
reqInitCompiler = reqInitialize, /* (called when compiler is loaded) */
reqTermCompiler = reqTerminate, /* (called when compiler is unloaded) */
reqInitLinker = reqInitialize, /* (called when linker is loaded) */
reqTermLinker = reqTerminate /* (called when linker is unloaded) */
};
/* request codes (common) */
enum {
reqTargetCompileEnded = -17, /* Sent when target's compile phase ends */
reqTargetCompileStarted = -16, /* Sent when target's compile phase starts */
reqTargetLinkEnded = -15, /* Sent when the link has ended */
reqTargetLinkStarted = -14, /* Sent when the link starts */
reqFileListBuildEnded = -13, /* Sent when the group file build ends */
reqFileListBuildStarted = -12, /* Sent when the group file build starts */
reqSubProjectBuildEnded = -11, /* Sent when subproject's build ends */
reqSubProjectBuildStarted = -10, /* Sent when subproject's build starts */
reqTargetBuildEnded = -9, /* Sent when target's build ends */
reqTargetBuildStarted = -8, /* Sent when target's build starts */
reqProjectBuildEnded = -7, /* Sent when project build ends */
reqProjectBuildStarted = -6, /* Sent when project build starts */
reqTargetLoaded = -5, /* called when the "keeps target info" flag is set */
reqTargetPrefsChanged = -4, /* called when the "keeps target info" flag is set */
reqTargetUnloaded = -3 /* called when the "keeps target info" flag is set */
};
/* requests codes (compilers) */
enum {
reqCompile = 0, /* compile/precompile/preprocess source file */
/* and return results */
reqMakeParse, /* used internally by Metrowerks */
reqCompDisassemble, /* disassemble a specific file in the project */
reqCheckSyntax, /* check syntax, but don't generate code */
reqPreprocessForDebugger /* when preprocess, don't open window w/results */
};
/* requests codes (linkers) */
enum {
reqLink = 0, /* link project and generate executable or library */
reqDisassemble, /* disassemble a specific file in the project */
reqTargetInfo, /* get info about the generated executable */
reqPreRun /* give linker a last chance to modify target info */
};
/* Returned as part of CWFileInfo to indicate the */
/* type of data pointed to by the filedata pointer */
enum {
filetypeText, /* data is text */
filetypeUnknown /* unknown type, could be precompiled header */
};
/* executable linkage types, used in CWTargetInfo.linkType */
enum {
exelinkageFlat, /* flat executable */
exelinkageSegmented, /* uses 68K code segments */
exelinkageOverlay1 /* uses overlay groups and overlays */
};
/* output file type, used in CWTargetInfo.outputType */
enum {
linkOutputNone, /* linker produces no output */
linkOutputFile, /* linker produces a file */
linkOutputDirectory /* linker produces a directory */
};
/* Constants for the targetCPU field of the CWTargetInfo struct */
enum {
targetCPU68K = CWFOURCHAR('6','8','k',' '),
targetCPUPowerPC = CWFOURCHAR('p','p','c',' '),
targetCPUi80x86 = CWFOURCHAR('8','0','8','6'),
targetCPUMips = CWFOURCHAR('m','i','p','s'),
targetCPUNECv800 = CWFOURCHAR('v','8','0','0'),
targetCPUEmbeddedPowerPC = CWFOURCHAR('e','P','P','C'),
targetCPUARM = CWFOURCHAR('a','r','m',' '),
targetCPUSparc = CWFOURCHAR('s','p','r','c'),
targetCPUIA64 = CWFOURCHAR('I','A','6','4'),
targetCPUAny = CWFOURCHAR('*','*','*','*'),
targetCPUMCORE = CWFOURCHAR('m','c','o','r'),
targetCPU_Intent = CWFOURCHAR('n','t','n','t')
};
/* Constants for the targetOS field of the CWTargetInfo struct */
enum {
targetOSMacintosh = CWFOURCHAR('m','a','c',' '),
targetOSWindows = CWFOURCHAR('w','i','n','t'),
targetOSNetware = CWFOURCHAR('n','l','m',' '),
targetOSMagicCap = CWFOURCHAR('m','c','a','p'),
targetOSOS9 = CWFOURCHAR('o','s','9',' '),
targetOSEmbeddedABI = CWFOURCHAR('E','A','B','I'),
targetOSJava = CWFOURCHAR('j','a','v','a'), /* java (no VM specification) */
targetOSJavaMS = CWFOURCHAR('j','v','m','s'), /* Microsoft VM */
targetOSJavaSun = CWFOURCHAR('j','v','s','n'), /* Sun VM */
targetOSJavaMRJ = CWFOURCHAR('j','v','m','r'), /* MRJ VM */
targetOSJavaMW = CWFOURCHAR('j','v','m','w'), /* Metrowerks VM */
targetOSPalm = CWFOURCHAR('p','a','l','m'),
targetOSGTD5 = CWFOURCHAR('g','t','d','5'),
targetOSSolaris = CWFOURCHAR('s','l','r','s'),
targetOSLinux = CWFOURCHAR('l','n','u','x'),
targetOSAny = CWFOURCHAR('*','*','*','*'),
targetOS_Intent = CWFOURCHAR('n','t','n','t')
};
/* linker flags, as used in member dropinflags of DropInFlags struct returned by linkers */
enum {
cantDisassemble = 1L << 31, /* this linker doesn't support 'Disassemble' */
isPostLinker = 1L << 30, /* this is a post linker */
linkAllowDupFileNames = 1L << 29, /* allow multiple project files with the same name */
linkMultiTargAware = 1L << 28, /* the linker can be used with multiple targets */
isPreLinker = 1L << 27, /* this is a pre linker */
linkerUsesTargetStorage = 1L << 26, /* the linker keeps storage per target */
linkerUnmangles = 1L << 25, /* The linker supports unmangling. */
magicCapLinker = 1L << 24, /* Pre- or post-linker is used for MagicCap */
linkAlwaysReload = 1L << 23, /* Always reload the linker before request */
linkRequiresProjectBuildStartedMsg = 1L << 22, /* Linker listens for a Project Build Started/Ended message */
linkRequiresTargetBuildStartedMsg = 1L << 21, /* Linker listens for a Target Build Started/Ended message */
linkRequiresSubProjectBuildStartedMsg = 1L << 20, /* Linker listens for a Sub Project Build Started/Ended message */
linkRequiresFileListBuildStartedMsg = 1L << 19, /* Linker listens for a File List Build Started/Ended message */
linkRequiresTargetLinkStartedMsg = 1L << 18, /* Linker listens for a Target Link Started/Ended message */
linkerWantsPreRunRequest = 1L << 17, /* Linker wants to be sent the pre-run request */
linkerGetTargetInfoThreadSafe = 1L << 16, /* GetTargetInfo call doesn't use any globals, etc. */
linkerUsesCaseInsensitiveSymbols = 1L << 15, /* All languages used by linker contain case insensitive browser symbols */
linkerDisasmRequiresPreprocess = 1L << 14, /* (obsolete) file must be preprocesed before being passed to linker for disasm */
linkerUsesFrameworks = 1L << 13, /* target uses frameworks; enables framework-style file searching */
linkerInitializeOnMainThread = 1L << 12 /* The Linker needs to be intialized on the main thread. */
/* remaining flags are reserved for future use and should be zero-initialized */
};
/* ways to store dependency returned as CWFileSpec in StoreObjectData */
enum {
cwAccessAbsolute,
cwAccessPathRelative,
cwAccessFileName,
cwAccessFileRelative
};
/* specifies what browser information compilers should generate */
/* they should always generate records for globals and functions */
typedef struct CWBrowseOptions {
Boolean recordClasses; /* [<-] do we record info for classes */
Boolean recordEnums; /* [<-] do we record info for enums */
Boolean recordMacros; /* [<-] do we record info for macros */
Boolean recordTypedefs; /* [<-] do we record info for typedefs */
Boolean recordConstants; /* [<-] do we record info for constants */
Boolean recordTemplates; /* [<-] do we record info for templates */
Boolean recordUndefinedFunctions; /* [<-] do we record info for undefined functions */
SInt32 reserved1; /* reserved space */
SInt32 reserved2; /* reserved space */
} CWBrowseOptions;
/* A dependency tag is associated with unit data in the StoreUnitData callback. It should */
/* change whenever unit data has changed in a way that forces its dependents to be rebuilt. */
/* Typically, it is just a checksum on the unit data. */
typedef UInt32 CWDependencyTag;
/* dependency information passed back in StoreObjectData */
typedef struct CWDependencyInfo {
SInt32 fileIndex; /* Another project entry. -1 => use fileSpec */
CWFileSpec fileSpec; /* location of file. Only used if fileIndex < 0 */
short fileSpecAccessType; /* One of cwAccessAbsolute, etc. above. Only */
/* used is specifying via fileSpec. */
short dependencyType; /* cwNormalDependency or cwInterfaceDependency. */
/* Values defined in CWPlugins.h */
} CWDependencyInfo;
/* information used when calling StoreObjectData */
typedef struct CWObjectData {
CWMemHandle objectdata; /* Handle to generated object code, */
/* resource data, or preprocessed text */
CWMemHandle browsedata; /* Handle to generated browse data */
SInt32 reserved1; /* reserved for future use, set to zero */
SInt32 codesize; /* size of generated code */
SInt32 udatasize; /* size of uninitialized data */
SInt32 idatasize; /* size of initialized data */
SInt32 compiledlines; /* number of lines of source compiled */
Boolean interfaceChanged; /* recompile interface dependents? */
SInt32 reserved2; /* reserved for future use, set to zero */
void* compilecontext; /* used internally by Metrowerks */
CWDependencyInfo* dependencies; /* optional array of dependencies */
short dependencyCount; /* overrides those collected by IDE */
CWFileSpec* objectfile; /* external object code file (i.e. .o file) */
} CWObjectData;
/* characteristics of a link target */
typedef struct CWTargetInfo {
short outputType; /* outputs file, directory, or nothing */
CWFileSpec outfile; /* generated executable file/folder spec */
CWFileSpec symfile; /* generated debug file spec */
CWFileSpec runfile; /* file to run, can be same or different from outfile */
short linkType; /* flat, segmented, or overlays */
Boolean canRun; /* "Run" can be performed on this target */
Boolean canDebug; /* "Run with Debugger" can be performed on this target */
CWDataType targetCPU; /* target CPU architecture (e.g. 68K, PowerPC, x86, MIPS)*/
CWDataType targetOS; /* target OS (e.g. MacOS, Windows, Unix) */
#if CWPLUGIN_HOST == CWPLUGIN_HOST_MACOS
OSType outfileCreator; /* file creator, if outputType == linkOutputFile */
OSType outfileType; /* file type, if outputType == linkOutputFile */
OSType debuggerCreator; /* file creator of debugger for this target */
OSType runHelperCreator; /* creator of helper app to use when running this file. */
#endif
#if CWPLUGIN_HOST == CWPLUGIN_HOST_WIN32
Boolean runHelperIsRegKey; /* true if runHelperName is a registry key */
Boolean debugHelperIsRegKey;/* true if debugHelperName is a registry key */
char args[512]; /* command line arguments */
char runHelperName[512]; /* full path to the run helper executable or a reg key */
Boolean runHelperRequiresURL;/* Indicates whether the outfile must be converted to */
/* a file scheme URL before being passed to the run */
/* helper app */
char reserved2;
char debugHelperName[512];/* full path to the debug helper executable or a reg key*/
#endif
// We need the args for Solaris
#if (CWPLUGIN_HOST == CWPLUGIN_HOST_SOLARIS || CWPLUGIN_HOST == CWPLUGIN_HOST_LINUX)
char args[512]; /* command line arguments */
char runHelperName[512]; /* Relative path name from (Helper Apps) to run helper program */
Boolean runHelperRequiresURL; /* Indicates whether the outfile must be converted to */
/* a file scheme URL before being passed to the run */
/* helper app */
char reserved2[3];
char debugHelperName[512]; /* Relative path name from (Helper Apps) to debug helper */
#endif
CWFileSpec linkAgainstFile; /* file parent targets link against (e.g. lib file) */
} CWTargetInfo;
typedef struct CWUnmangleInfo {
void* targetStorage;
const char* mangledName;
char* unmangleBuff;
SInt32 unmangleBuffSize;
unsigned short browserClassID;
unsigned char browserLang;
unsigned char filler1;
} CWUnmangleInfo;
/* Types used to get compiler-specific browser symbol information. */
typedef struct CWCompilerBrSymbol {
char symName[32];
char symUIName[32];
} CWCompilerBrSymbol;
typedef struct CWCompilerBrSymbolList {
short count;
CWCompilerBrSymbol items[1];
} CWCompilerBrSymbolList;
typedef struct CWCompilerBrSymbolInfo {
void* targetStorage;
CWCompilerBrSymbolList* symList; /* [<-] Compiler should put a pointer to the read-only list here.*/
} CWCompilerBrSymbolInfo;
typedef struct CWFrameworkInfo {
CWFileSpec fileSpec; /* location of ".framework" directory */
char version[256]; /* which version directory to use; if empty use "Current" sym link */
} CWFrameworkInfo;
/*** Declaration of plugin entry points that must be implemented by non-MacOS plugins ***/
/*** It can also be implemented by a MacOS plugin to override the 'Targ' resource ***/
CWPLUGIN_ENTRY (CWPlugin_GetTargetList)(const struct CWTargetList**);
/*** Optional entry points ***/
CWPLUGIN_ENTRY (CWPlugin_GetDefaultMappingList)(const struct CWExtMapList**);
CWPLUGIN_ENTRY (Helper_Unmangle)(CWUnmangleInfo*);
CWPLUGIN_ENTRY (Helper_GetCompilerBrSymbols)(CWCompilerBrSymbolInfo*);
/*** callbacks to the IDE, in addition to those in CWPlugins.h ***/
CW_CALLBACK CWIsPrecompiling(CWPluginContext context, Boolean* isPrecompiling);
CW_CALLBACK CWIsAutoPrecompiling(CWPluginContext context, Boolean* isAutoPrecompiling);
CW_CALLBACK CWIsPreprocessing(CWPluginContext context, Boolean* isPreprocessing);
CW_CALLBACK CWIsGeneratingDebugInfo(CWPluginContext context, Boolean* isGenerating);
CW_CALLBACK CWIsCachingPrecompiledHeaders(CWPluginContext context, Boolean* isCaching);
CW_CALLBACK CWGetBrowseOptions(CWPluginContext context, CWBrowseOptions* browseOptions);
CW_CALLBACK CWGetBuildSequenceNumber(CWPluginContext context, SInt32* sequenceNumber);
CW_CALLBACK CWGetTargetInfo(CWPluginContext context, CWTargetInfo* targetInfo);
CW_CALLBACK CWSetTargetInfo(CWPluginContext context, CWTargetInfo* targetInfo);
CW_CALLBACK CWGetTargetStorage(CWPluginContext context, void** storage);
CW_CALLBACK CWSetTargetStorage(CWPluginContext context, void* storage);
CW_CALLBACK CWGetMainFileNumber(CWPluginContext context, SInt32* fileNumber);
CW_CALLBACK CWGetMainFileID(CWPluginContext context, short* fileID);
CW_CALLBACK CWGetMainFileSpec(CWPluginContext context, CWFileSpec* fileSpec);
CW_CALLBACK CWGetMainFileText(CWPluginContext context, const char** text, SInt32* textLength);
CW_CALLBACK CWCachePrecompiledHeader(CWPluginContext context, const CWFileSpec* filespec, CWMemHandle pchhandle);
CW_CALLBACK CWLoadObjectData(CWPluginContext context, SInt32 whichfile, CWMemHandle* objectdata);
CW_CALLBACK CWFreeObjectData(CWPluginContext context, SInt32 whichfile, CWMemHandle objectdata);
CW_CALLBACK CWStoreObjectData(CWPluginContext context, SInt32 whichfile, CWObjectData* object);
CW_CALLBACK CWGetSuggestedObjectFileSpec(CWPluginContext context, SInt32 whichfile, CWFileSpec* fileSpec);
CW_CALLBACK CWGetStoredObjectFileSpec(CWPluginContext context, SInt32 whichfile, CWFileSpec* fileSpec);
CW_CALLBACK CWDisplayLines(CWPluginContext context, SInt32 nlines);
CW_CALLBACK CWBeginSubCompile(CWPluginContext context, SInt32 whichfile, CWPluginContext* subContext);
CW_CALLBACK CWEndSubCompile(CWPluginContext subContext);
CW_CALLBACK CWGetPrecompiledHeaderSpec(CWPluginContext context, CWFileSpec *pchspec, const char *target);
CW_CALLBACK CWGetResourceFile(CWPluginContext context, CWFileSpec* filespec);
CW_CALLBACK CWPutResourceFile(CWPluginContext context, const char* prompt, const char* name, CWFileSpec* filespec);
/* Metrowerks Pascal support */
CW_CALLBACK CWLookUpUnit(CWPluginContext context, const char* name, Boolean isdependency, const void** unitdata, SInt32* unitdatalength);
CW_CALLBACK CWSBMfiles(CWPluginContext context, short libref);
CW_CALLBACK CWStoreUnit(CWPluginContext context, const char* unitname, CWMemHandle unitdata, CWDependencyTag dependencytag);
CW_CALLBACK CWReleaseUnit(CWPluginContext context, void* unitdata);
CW_CALLBACK CWUnitNameToFileName(CWPluginContext context, const char* unitname, char* filename);
/* obsolete, for MacOS backward compatibility only */
#if CWPLUGIN_API == CWPLUGIN_API_MACOS
CW_CALLBACK CWOSAlert(CWPluginContext context, const char* message, OSErr errorcode);
CW_CALLBACK CWOSErrorMessage(CWPluginContext context, const char *msg, OSErr errorcode);
#endif
CW_CALLBACK CWGetModifiedFiles(CWPluginContext context, SInt32* modifiedFileCount, const SInt32** modifiedFiles);
/* Get information from the "Runtime Settings" panel */
CW_CALLBACK CWGetCommandLineArgs(CWPluginContext context, const char** commandLineArgs);
CW_CALLBACK CWGetWorkingDirectory(CWPluginContext context, CWFileSpec* workingDirectorySpec);
CW_CALLBACK CWGetEnvironmentVariableCount(CWPluginContext context, SInt32* count);
CW_CALLBACK CWGetEnvironmentVariable(CWPluginContext context, SInt32 index, const char** name, const char** value);
CW_CALLBACK CWGetFrameworkCount(CWPluginContext context, SInt32* frameworkCount);
CW_CALLBACK CWGetFrameworkInfo(CWPluginContext context, SInt32 whichFramework, CWFrameworkInfo* frameworkInfo);
CW_CALLBACK CWGetFrameworkSharedLibrary(CWPluginContext context, SInt32 whichFramework, CWFileSpec* frameworkSharedLibrary);
#if CW_USE_PRAGMA_IMPORT
#pragma import reset
#endif
#ifdef __cplusplus
}
#endif
#ifdef _MSC_VER
#pragma pack(pop,2)
#endif
#ifdef __MWERKS__
#pragma options align=reset
#endif
#endif /* __DROPINCOMPILERLINKER_H__ */
\ No newline at end of file |