Index: releases/F-Script Anywhere/1.1.5/Source/CPS.h
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/CPS.h	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/CPS.h	(revision 18)
@@ -0,0 +1,299 @@
+// CPS.h
+
+#pragma once
+
+#include <Carbon/Carbon.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if PRAGMA_STRUCT_ALIGN
+    #pragma options align=mac68k
+#elif PRAGMA_STRUCT_PACKPUSH
+    #pragma pack(push, 2)
+#elif PRAGMA_STRUCT_PACK
+    #pragma pack(2)
+#endif
+
+
+struct CPSProcessSerNum
+{
+	UInt32		lo;
+	UInt32		hi;
+};
+
+typedef struct CPSProcessSerNum	CPSProcessSerNum;
+
+enum
+{
+	kCPSNoProcess		=	0,
+	kCPSSystemProcess	=	1,
+	kCPSCurrentProcess	=	2
+};
+
+
+enum
+{
+	bfCPSIntraProcessSwitch =	1,
+	bfCPSDeathBySignal	=	2
+};
+
+typedef UInt16	CPSEventFlags;
+
+
+enum
+{
+	kCPSBlueApp	=	0,
+	kCPSBlueBox	=	1,
+	kCPSCarbonApp	=	2,
+	kCPSYellowApp	=	3,
+	kCPSUnknownApp	=	4
+};
+
+typedef UInt32	CPSAppFlavour;
+
+
+enum
+{
+	kCPSBGOnlyAttr		=	1024,
+	kCPSUIElementAttr	=	65536,
+	kCPSHiddenAttr		=	131072,
+	kCPSNoConnectAttr	=	262144,
+	kCPSFullScreenAttr	=	524288,
+	kCPSClassicReqAttr	=	1048576,
+	kCPSNativeReqAttr	=	2097152
+};
+
+typedef UInt32	CPSProcAttributes;
+
+
+struct CPSProcessInfoRec
+{
+	CPSProcessSerNum 	Parent;
+	UInt64			LaunchDate;
+	CPSAppFlavour		Flavour;
+	CPSProcAttributes	Attributes;
+	UInt32			ExecFileType;
+	UInt32			ExecFileCreator;
+	UInt32			UnixPID;
+};
+
+typedef struct CPSProcessInfoRec	CPSProcessInfoRec;
+
+
+enum
+{
+	kCPSNotifyChildDeath	=	1,
+	kCPSNotifyNewFront	=	2,
+	kCPSNotifyAppBirth	=	4,
+	kCPSNotifyAppDeath	=	8,
+	kCPSNotifyLaunch	=	9,
+	kCPSNotifyServiceReq	=	16,
+	kCPSNotifyAppHidden	=	32,
+	kCPSNotifyAppRevealed	=	64,
+	kCPSNotifyFGEnabled	=	128,
+	kCPSNotifyLaunchStart	=	256,
+	kCPSNotifyAppReady	=	512,
+	kCPSNotifyLaunchFail	=	1024,
+	kCPSNotifyAppDeathExt	=	2048,
+	kCPSNotifyLostKeyFocus	=	4096
+};
+
+typedef UInt32	CPSNotificationCodes;
+
+
+enum
+{
+	bfCPSLaunchInhibitDaemon	=	128,
+	bfCPSLaunchDontSwitch		=	512,
+	bfCPSLaunchNoProcAttr		=	2048,
+	bfCPSLaunchAsync		=	65536,
+	bfCPSLaunchStartClassic		=	131072,
+	bfCPSLaunchInClassic		=	262144,
+	bfCPSLaunchInstance		=	524288,
+	bfCPSLaunchAndHide		=	1048576,
+	bfCPSLaunchAndHideOthers	=	2097152
+};
+
+typedef UInt32	CPSLaunchOptions;
+
+
+typedef	UInt8	*CPSLaunchRefcon;
+
+
+typedef	UInt8	*CPSLaunchData;
+
+
+enum
+{
+	bfCPSExtLaunchWithData	=	2,
+	bfCPSExtLaunchByParent	=	4,
+	bfCPSExtLaunchAsUidGid	=	8
+};
+
+typedef UInt32	CPSLaunchPBFields;
+
+
+struct CPSLaunchPB
+{
+	CPSLaunchPBFields	Contents;
+	CPSLaunchData		pData;
+	UInt32			DataLen;
+	UInt32			DataTag;
+	UInt32			RefCon;
+	CPSProcessSerNum	Parent;
+	UInt32			ChildUID;
+	UInt32			ChildGID;
+};
+
+typedef struct CPSLaunchPB	CPSLaunchPB;
+
+
+enum
+{
+	bfCPSKillHard		=	1,
+	bfCPSKillAllClassicApps	=	2
+};
+
+typedef UInt32	CPSKillOptions;
+
+
+enum
+{
+	kCPSLaunchService	=	0,
+	kCPSKillService		=	1,
+	kCPSHideService		=	2,
+	kCPSShowService		=	3,
+	kCPSPrivService		=	4,
+	kCPSExtDeathNoteService	=	5
+};
+
+typedef UInt32	CPSServiceReqType;
+
+
+struct CPSLaunchRequest
+{
+	CPSProcessSerNum	TargetPSN;
+	CPSLaunchOptions 	Options;
+	CPSProcAttributes 	ProcAttributes;
+	UInt8			*pUTF8TargetPath;
+	UInt32			PathLen;
+};
+
+typedef struct CPSLaunchRequest	CPSLaunchRequest;
+
+
+struct CPSKillRequest
+{
+	CPSProcessSerNum	TargetPSN;
+	CPSKillOptions		Options;
+};
+
+typedef struct CPSKillRequest	CPSKillRequest;
+
+
+struct CPSHideRequest
+{
+	CPSProcessSerNum 	TargetPSN;
+};
+
+typedef struct CPSHideRequest	CPSHideRequest;
+
+
+struct CPSShowRequest
+{
+	CPSProcessSerNum 	TargetPSN;
+};
+
+typedef struct CPSShowRequest	CPSShowRequest;
+
+
+struct CPSExtDeathNotice
+{
+	CPSProcessSerNum 	DeadPSN;
+	UInt32			Flags;
+	UInt8			*pUTF8AppPath;
+	UInt32			PathLen;
+};
+
+typedef struct CPSExtDeathNotice	CPSExtDeathNotice;
+
+
+union CPSRequestDetails
+{
+	CPSLaunchRequest 	LaunchReq;
+	CPSKillRequest 		KillReq;
+	CPSHideRequest 		HideReq;
+	CPSShowRequest 		ShowReq;
+	CPSExtDeathNotice 	DeathNotice;
+};
+
+typedef union CPSRequestDetails	CPSRequestDetails;
+
+
+struct CPSServiceRequest
+{
+	CPSServiceReqType 	Type;
+	SInt32			ID;
+	CPSRequestDetails 	Details;
+};
+
+typedef struct CPSServiceRequest	CPSServiceRequest;
+
+
+enum
+{
+	kCPSProcessInterruptKey	=	0,
+	kCPSAppSwitchFwdKey	=	1,
+	kCPSAppSwitchBackKey	=	2,
+	kCPSSessionInterruptKey	=	3,
+	kCPSScreenSaverKey	=	4,
+	kCPSDiskEjectKey	=	5,
+	kCPSSpecialKeyCount	=	6
+};
+
+typedef SInt32	CPSSpecialKeyID;
+
+
+extern Boolean	CPSEqualProcess( CPSProcessSerNum *psn1, CPSProcessSerNum *psn2);
+
+extern OSErr	CPSGetCurrentProcess( CPSProcessSerNum *psn);
+
+extern OSErr	CPSGetFrontProcess( CPSProcessSerNum *psn);
+
+extern OSErr	CPSGetNextProcess( CPSProcessSerNum *psn);
+
+extern OSErr	CPSGetNextToFrontProcess( CPSProcessSerNum *psn);
+
+extern OSErr	CPSGetProcessInfo( CPSProcessSerNum *psn, CPSProcessInfoRec *info, char *path, int maxPathLen, int *len, char *name, int maxNameLen);
+
+extern OSErr	CPSPostHideMostReq( CPSProcessSerNum *psn);
+
+extern OSErr	CPSPostHideReq( CPSProcessSerNum *psn);
+
+extern OSErr	CPSPostKillRequest( CPSProcessSerNum *psn, CPSKillOptions options);
+
+extern OSErr	CPSPostShowAllReq( CPSProcessSerNum *psn);
+
+extern OSErr	CPSPostShowReq( CPSProcessSerNum *psn);
+
+extern OSErr	CPSSetFrontProcess( CPSProcessSerNum *psn);
+
+extern OSErr	CPSReleaseKeyFocus( CPSProcessSerNum *psn);
+
+extern OSErr	CPSStealKeyFocus( CPSProcessSerNum *psn);
+
+
+#if PRAGMA_STRUCT_ALIGN
+    #pragma options align=reset
+#elif PRAGMA_STRUCT_PACKPUSH
+    #pragma pack(pop)
+#elif PRAGMA_STRUCT_PACK
+    #pragma pack()
+#endif
+
+#ifdef __cplusplus
+}
+#endif
Index: releases/F-Script Anywhere/1.1.5/Source/DeVercruesseProcess.h
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/DeVercruesseProcess.h	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/DeVercruesseProcess.h	(revision 18)
@@ -0,0 +1,86 @@
+//
+//  DeVercruesseProcess.h
+//
+//  Created by Frank Vercruesse on Wed Apr 04 2001.
+//  Copyright (c) 2001 Frank Vercruesse.
+//
+//
+//  This program is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU General Public License
+//  as published by the Free Software Foundation; either version 2
+//  of the License, or (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+//  02111-1307, USA.
+
+#import <Cocoa/Cocoa.h>
+#import <Carbon/Carbon.h>
+#import "CPS.h"
+
+
+@interface DeVercruesseProcess : NSObject
+{
+    ProcessSerialNumber	psn;
+    
+    UInt32		pid,
+                        flavour,
+                        attributes,
+                        type,
+                        creator;
+    
+    NSString		*bundleIdentifier;
+    NSString		*identifier;
+    NSString		*loc;
+    NSString		*name;
+    NSImage		*img;
+    NSImage		*cachedImage;
+}
+
++ (id)processWithPSN:(ProcessSerialNumber*)sn;
+
+- (id)initWithPSN:(ProcessSerialNumber*)sn;
+
+- (NSString *)executableLoc;
+- (NSString*)loc;
+- (NSString*)name;
+- (NSImage*)img;
+- (NSImage *)cachedImage;
+- (void)setCachedImage:(NSImage *)anImage;
+
+- (ProcessSerialNumber*)psn;
+- (UInt32)pid;
+- (UInt32)flavour;
+- (UInt32)attributes;
+- (UInt32)type;
+- (UInt32)creator;
+- (NSString*)bundleIdentifier;
+- (NSString*)identifier;
+
+- (BOOL)isEqualToCurrent;
+- (BOOL)isEqualToFront;
+
+- (BOOL)isStillRunning;
+
+- (BOOL)isBackgroundOnly;
+- (BOOL)isHidden;
+
+- (BOOL)isClassic;
+- (BOOL)isCarbon;
+- (BOOL)isCocoa;
+
+- (void)show;
+- (void)hide;
+
+- (void)makeFront;
+
+- (void)kill;
+- (void)kill:(BOOL)hard;
+
+@end
Index: releases/F-Script Anywhere/1.1.5/Source/DeVercruesseProcess.m
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/DeVercruesseProcess.m	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/DeVercruesseProcess.m	(revision 18)
@@ -0,0 +1,385 @@
+//
+//  DeVercruesseProcess.m
+//
+//  Created by Frank Vercruesse on Wed Apr 04 2001.
+//  Copyright (c) 2001 Frank Vercruesse.
+//
+//
+//  This program is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU General Public License
+//  as published by the Free Software Foundation; either version 2
+//  of the License, or (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+//  02111-1307, USA.
+
+#import "DeVercruesseProcess.h"
+#import "DeVercruesseProcessManager.h"
+
+
+@implementation DeVercruesseProcess
+
++ (id)processWithPSN:(ProcessSerialNumber*)sn
+{
+    return [[[self alloc] initWithPSN:sn] autorelease];
+}
+
+- (id)init
+{
+    return [self initWithPSN:nil];
+}
+
+- (id)initWithPSN:(ProcessSerialNumber*)sn
+{
+    OSErr		err;
+    CPSProcessInfoRec	pInfo;
+    int			dummy;
+    
+    
+    if( sn )
+    {
+        err = CPSGetProcessInfo( (CPSProcessSerNum*) sn, &pInfo, nil, 0, &dummy, nil, 0);
+        
+        if( !err )
+        {
+            self = [super init];
+            
+            if( self )
+            {
+                psn.highLongOfPSN = sn->highLongOfPSN;
+                psn.lowLongOfPSN = sn->lowLongOfPSN;
+                
+                pid = pInfo.UnixPID;
+                flavour = pInfo.Flavour;
+                attributes = pInfo.Attributes;
+                type = pInfo.ExecFileType;
+                creator = pInfo.ExecFileCreator;
+                
+                bundleIdentifier = nil;
+                identifier = nil;
+                
+                name = nil;
+                loc = nil;
+                img = nil;
+            }
+        }
+        else
+        {
+            [self dealloc];
+            return nil;
+        }
+    }
+    else
+    {
+        [self dealloc];
+        return nil;
+    }
+    
+    return self;
+}
+
+- (void)dealloc
+{
+    [bundleIdentifier release];
+    [identifier release];
+    [name release];
+    [img release];
+    [cachedImage release];
+    [loc release];
+    
+    [super dealloc];
+}
+
+- (NSString *)executableLoc;
+{
+    CFStringRef bundleLoc = (CFStringRef) [self loc];
+    CFURLRef bundleURL;
+    CFBundleRef bundleRef;
+
+    if (bundleLoc == NULL) {
+        // GetProcessBundleLocation returns NULL on 10.1.5 for certain CFM Carbon applications (BBEdit 6.5.3) - njr
+        return nil; // XXX should really handle this better, but for the purposes of F-Script Anywhere, we donÕt care if itÕs not a Carbon app, and this works fine going forward.
+    }
+    
+    bundleURL = CFURLCreateWithFileSystemPath(NULL, bundleLoc, kCFURLPOSIXPathStyle, NO);
+    bundleRef = CFBundleCreate(NULL, bundleURL);
+
+    if (bundleRef == NULL) {
+        BOOL isDir;
+        CFRelease(bundleURL);
+        if ([[NSFileManager defaultManager] fileExistsAtPath: [self loc] isDirectory: &isDir] && !isDir)
+            return [self loc];
+        return nil; // not a bundle or file
+    } else {
+        CFURLRef execURL = CFBundleCopyExecutableURL(bundleRef);
+        CFURLRef absURL = CFURLCopyAbsoluteURL(execURL);
+        CFStringRef execPath = CFURLCopyFileSystemPath(absURL, kCFURLPOSIXPathStyle);
+
+        if (absURL != NULL) CFRelease(absURL);
+        if (execURL != NULL) CFRelease(execURL);
+        CFRelease(bundleRef);
+        return [(NSString *)execPath autorelease];
+    } 
+}
+
+
+- (NSString*)loc
+{
+    char		buffer[1025];
+    FSRef		location;
+    
+    
+    if( !loc )
+    {
+        if( !GetProcessBundleLocation( &psn, &location) )
+        {
+            FSRefMakePath( &location, buffer, 1024);
+            loc = [NSString stringWithUTF8String:buffer];
+            [loc retain];
+        }
+    }
+    
+    return loc;
+}
+
+- (NSString*)name;
+{
+    char		buffer[1025];
+    CFStringRef		pName;
+    
+    
+    if( !name )
+    {
+        if( !name && (CopyProcessName( &psn, &pName) == noErr) )    // with thanks to Dylan Ashe
+        {
+            CFStringGetCString( pName, buffer, 256, CFStringConvertNSStringEncodingToEncoding( [NSString defaultCStringEncoding]));
+            
+            name = [NSString stringWithCString:buffer];
+            [name retain];
+            
+            CFRelease( pName);
+        }
+        // CFBundleName code demoted to alternate method because it was causing plist processing issues in Jaguar, yet CopyProcessName doesn't work for everything, e.g. Help Viewer - njr
+        else if( [self loc] )
+        {
+            NSBundle *b = [NSBundle bundleWithPath:loc];
+            if( b )
+            {
+                name = [b localizedStringForKey:@"CFBundleName" value:@"_AsM_nO_nAmE_" table:@"InfoPlist"];
+
+                if( [name isEqualToString:@"_AsM_nO_nAmE_"] )
+                    name = [[b infoDictionary] objectForKey:@"CFBundleName"];
+
+                if( name )
+                    [name retain];
+            }
+        }
+        
+   }
+
+    return name ? name : @"Çunknown nameÈ";
+}
+
+- (NSImage*)img
+{
+    if( !img )
+    {
+        if( [self loc] )
+        {
+            img = [[NSWorkspace sharedWorkspace] iconForFile:loc];
+            
+            if( img )
+            {
+                [img setDataRetained:YES];
+//                [img setCachedSeparately:YES]; // added 8/26/01 by Frank
+                [img retain];
+            }
+        }
+    }
+    
+    return img;
+}
+
+- (NSImage *)cachedImage;
+{
+    return cachedImage;
+}
+
+- (void)setCachedImage:(NSImage *)anImage;
+{
+    if (anImage != cachedImage) {
+        [anImage retain];
+        [cachedImage release];
+        cachedImage = anImage;
+    }
+}
+
+
+- (ProcessSerialNumber*)psn
+{
+    return &psn;
+}
+
+- (UInt32)pid
+{
+    return pid;
+}
+
+- (UInt32)flavour
+{
+    return flavour;
+}
+
+- (UInt32)attributes
+{
+    CPSProcessInfoRec	pInfo;
+    int			dummy;
+    
+    
+    if( CPSGetProcessInfo( (CPSProcessSerNum*) &psn, &pInfo, nil, 0, &dummy, nil, 0) == noErr )
+        attributes = pInfo.Attributes;
+    
+    return attributes;
+}
+
+- (UInt32)type
+{
+    return type;
+}
+
+- (UInt32)creator
+{
+    return creator;
+}
+
+- (NSString*)identifier
+{
+    if( !identifier )
+    {
+        identifier = [[NSString alloc] initWithFormat:@"%@%.8X%.8X",
+            [self bundleIdentifier], [self type] ? type : 'APPL', [self creator] ? creator : '????'];
+    }
+    
+    return identifier;
+}
+
+- (NSString*)bundleIdentifier
+{
+    NSBundle	*b;
+    
+    
+    if( !bundleIdentifier && [self loc] && (b = [NSBundle bundleWithPath:loc]) )
+        bundleIdentifier = [[b bundleIdentifier] retain];
+    
+    return bundleIdentifier ? bundleIdentifier : @"";
+}
+
+
+- (unsigned)hash
+{
+    return psn.lowLongOfPSN;
+//    return pid;
+}
+
+- (BOOL)isEqual:(id)anObject
+{
+    if( anObject )
+        return CPSEqualProcess( (CPSProcessSerNum*) &psn, (CPSProcessSerNum*) [anObject psn]);
+    else
+        return NO;
+}
+
+- (BOOL)isEqualToCurrent
+{
+    return [self isEqual:[ProcessMgr currentProcess]];
+}
+
+- (BOOL)isEqualToFront
+{
+    return [self isEqual:[ProcessMgr frontProcess]];
+}
+
+- (BOOL)isStillRunning
+{
+    CPSProcessInfoRec	pInfo;
+    int			dummy;
+    
+    
+    if( CPSGetProcessInfo( (CPSProcessSerNum*) &psn, &pInfo, nil, 0, &dummy, nil, 0) == noErr )
+        return YES;
+    else
+        return NO;
+}
+
+- (BOOL)isBackgroundOnly
+{
+    return (((attributes & kCPSBGOnlyAttr) | (attributes & kCPSUIElementAttr)) != 0);
+}
+
+- (BOOL)isHidden
+{
+    return (([self attributes] & kCPSHiddenAttr) != 0);
+}
+
+
+- (BOOL)isClassic
+{
+    return (flavour == kCPSBlueApp);
+}
+
+- (BOOL)isCarbon
+{
+    return (flavour == kCPSCarbonApp);
+}
+
+- (BOOL)isCocoa
+{
+    return (flavour == kCPSYellowApp);
+}
+
+
+- (void)show
+{
+    if( [self isStillRunning] )
+        CPSPostShowReq( (CPSProcessSerNum*) &psn);
+}
+
+- (void)hide
+{
+    if( [self isStillRunning] )
+        CPSPostHideReq( (CPSProcessSerNum*) &psn);
+}
+
+- (void)makeFront
+{
+    if( [self isStillRunning] )
+    {
+        CPSSetFrontProcess( (CPSProcessSerNum*) &psn);
+        CPSPostShowReq( (CPSProcessSerNum*) &psn);
+    }
+}
+
+- (void)kill
+{
+    [self kill:NO];
+}
+
+- (void)kill:(BOOL)hard
+{
+    if( [self isStillRunning] )
+        CPSPostKillRequest( (CPSProcessSerNum*) &psn, hard ? bfCPSKillHard : 0 );
+}
+
+- (NSString *)description;
+{
+    return [NSString stringWithFormat: @"%@ pid %d: '%@' (%@)", [super description], [self pid], [self name], [self identifier]];
+}
+
+@end
Index: releases/F-Script Anywhere/1.1.5/Source/DeVercruesseProcessManager.h
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/DeVercruesseProcessManager.h	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/DeVercruesseProcessManager.h	(revision 18)
@@ -0,0 +1,60 @@
+//
+//  DeVercruesseProcessManager.h
+//
+//  Created by Frank Vercruesse on Wed Apr 04 2001.
+//  Copyright (c) 2001 Frank Vercruesse.
+//
+//
+//  This program is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU General Public License
+//  as published by the Free Software Foundation; either version 2
+//  of the License, or (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+//  02111-1307, USA.
+
+#import "DeVercruesseProcess.h"
+#import <Cocoa/Cocoa.h>
+#import <Carbon/Carbon.h>
+
+
+#define ProcessMgr [DeVercruesseProcessManager defaultManager]
+
+
+@interface DeVercruesseProcessManager : NSObject
+{
+    NSMutableSet	*processes;
+    NSDictionary	*rules;
+}
+
++ (id)defaultManager;
+
+- (DeVercruesseProcess*)currentProcess;
+- (DeVercruesseProcess*)frontProcess;
+- (DeVercruesseProcess*)nextToFrontProcess;
+- (DeVercruesseProcess*)anyNoBGOnlyProcess;
+
+- (NSArray*)processes;
+- (void)update;
+
+- (void)showAll;
+- (void)hideOthers;
+- (void)hideOthers:(BOOL)ignoreRules;
+- (void)hideFront;
+
+- (void)setFront:(DeVercruesseProcess*)process;
+
+- (void)setRules:(NSArray*)r;
+- (BOOL)anyRulesForProcess:(DeVercruesseProcess*)process;
+- (BOOL)checkRule:(NSString*)ruleKey withProcess:(DeVercruesseProcess*)process;
+- (NSSet*)processIdentifiersForRule:(NSString*)ruleKey;
+- (int)optionsForRule:(NSString*)ruleKey withProcess:(DeVercruesseProcess*)process;
+
+@end
Index: releases/F-Script Anywhere/1.1.5/Source/DeVercruesseProcessManager.m
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/DeVercruesseProcessManager.m	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/DeVercruesseProcessManager.m	(revision 18)
@@ -0,0 +1,325 @@
+//
+//  DeVercruesseProcessManager.m
+//
+//  Created by Frank Vercruesse on Wed Apr 04 2001.
+//  Copyright (c) 2001 Frank Vercruesse.
+//
+//
+//  This program is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU General Public License
+//  as published by the Free Software Foundation; either version 2
+//  of the License, or (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+//  02111-1307, USA.
+
+#import "DeVercruesseProcessManager.h"
+
+
+@implementation DeVercruesseProcessManager
+
+static DeVercruesseProcessManager *defaultManager = nil;
+
++ (id)defaultManager
+{
+    return ( defaultManager ? defaultManager : [[self alloc] init] );
+}
+
+- (id)init
+{
+    if( defaultManager )
+    {
+	[self dealloc];
+    }
+    else if( [super init] )
+    {
+        processes = [[NSMutableSet alloc] initWithCapacity:30];
+        defaultManager = self;
+    }
+    
+    return defaultManager;
+}
+
+- (void)dealloc
+{
+    [processes release];
+    
+    if( self == defaultManager )
+        defaultManager = nil;
+}
+
+
+- (DeVercruesseProcess*)currentProcess
+{
+    ProcessSerialNumber	sn;
+    DeVercruesseProcess		*p, *q;
+    
+    
+    CPSGetCurrentProcess( (CPSProcessSerNum*) &sn);
+    
+    if( p = [DeVercruesseProcess processWithPSN:&sn] )
+    {
+        if( q = [processes member:p] )
+            p = q;
+//        else
+//            [processes addObject:p];
+    }
+    
+    return p;
+}
+
+- (DeVercruesseProcess*)frontProcess
+{
+    ProcessSerialNumber	sn;
+    DeVercruesseProcess		*p, *q;
+    
+    
+    if( CPSGetFrontProcess( (CPSProcessSerNum*) &sn) != noErr )
+        CPSGetCurrentProcess( (CPSProcessSerNum*) &sn);
+    
+    if( p = [DeVercruesseProcess processWithPSN:&sn] )
+    {
+        if( q = [processes member:p] )
+            p = q;
+//        else
+//            [processes addObject:p];
+    }
+    
+    return p;
+}
+
+- (DeVercruesseProcess*)nextToFrontProcess
+{
+    ProcessSerialNumber	sn;
+    DeVercruesseProcess		*p, *q;
+    
+    
+    if( CPSGetNextToFrontProcess( (CPSProcessSerNum*) &sn) != noErr )
+        CPSGetCurrentProcess( (CPSProcessSerNum*) &sn);
+    
+    if( p = [DeVercruesseProcess processWithPSN:&sn] )
+    {
+        if( q = [processes member:p] )
+            p = q;
+//        else
+//            [processes addObject:p];
+    }
+    
+    return p;
+}
+
+- (DeVercruesseProcess*)anyNoBGOnlyProcess
+{
+    ProcessSerialNumber	sn;
+    DeVercruesseProcess		*p, *q;
+    
+    
+    sn.highLongOfPSN = 0;
+    sn.lowLongOfPSN = kNoProcess;
+    
+    while( CPSGetNextProcess( (CPSProcessSerNum*) &sn) == noErr )
+    {
+        if( (p = [DeVercruesseProcess processWithPSN:&sn]) && ![p isBackgroundOnly] )
+        {
+            if( q = [processes member:p] )
+                p = q;
+//            else
+//                [processes addObject:p];
+            
+            return p;
+        }
+    }
+    
+    return nil;
+}
+
+
+- (NSArray*)processes
+{
+    [self update];
+    
+    return [NSArray arrayWithArray:[processes allObjects]];
+}
+
+
+- (void)update
+{
+    ProcessSerialNumber	sn;
+    NSMutableSet	*temp;
+    DeVercruesseProcess		*process, *existingProcess;
+    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+    
+    sn.highLongOfPSN = 0;
+    sn.lowLongOfPSN = kNoProcess;
+
+    temp = [[NSMutableSet alloc] initWithCapacity: 30];
+    
+    while( CPSGetNextProcess( (CPSProcessSerNum*) &sn) == noErr )
+    {
+        // njr removed background-only check because we still get process launch notifications for background-only apps...
+        if ( (process = [[DeVercruesseProcess alloc] initWithPSN:&sn]) != nil) {
+            if ( (existingProcess = [processes member: process]) != nil ) {
+                [temp addObject: existingProcess];
+            } else {
+                [temp addObject: process];
+            }
+            [process release];
+        }
+    }
+    
+    [processes setSet: temp];
+    [pool release];
+    [temp release];
+}
+
+
+- (void)showAll
+{
+    ProcessSerialNumber	*psn;
+    
+    
+    psn = [[self frontProcess] psn];
+    
+    CPSPostShowAllReq( (CPSProcessSerNum*) psn );
+    CPSPostShowReq( (CPSProcessSerNum*) psn );
+}
+
+- (void)hideOthers
+{
+    [self hideOthers:YES];
+}
+
+- (void)hideOthers:(BOOL)ignoreRules
+{
+    NSArray		*p;
+    NSEnumerator	*enumerator;
+    DeVercruesseProcess	*process;
+    
+    
+    p = [[ProcessMgr processes] retain];
+    
+    enumerator = [p objectEnumerator];
+    
+    while( process = [enumerator nextObject] )
+    {
+        if( ![process isHidden] && ![process isEqualToFront] &&
+            (ignoreRules ||
+              ![self checkRule:@"optDontHide" withProcess:process]) )
+        {
+            [process hide];
+        }
+    }
+    
+    [p release];
+}
+
+- (void)hideFront
+{
+    [[self frontProcess] hide];
+}
+
+- (void)setFront:(DeVercruesseProcess*)process
+{
+    [process makeFront];
+}
+
+// rules stuff
+
+- (void)setRules:(NSArray*)r
+{
+    NSEnumerator *enumerator;
+    NSDictionary *dict;
+    NSMutableSet *hasRules, *keys;
+    NSMutableDictionary *newRules;
+    
+    
+    newRules = [[NSMutableDictionary alloc] initWithCapacity:10];
+    
+    hasRules = [[NSMutableSet alloc] initWithCapacity:10];
+    [newRules setObject:hasRules forKey:@"_hasRules"];
+    [hasRules release];
+    
+    keys = [[NSMutableSet alloc] initWithCapacity:10];
+    [newRules setObject:keys forKey:@"_keys"];
+    [keys release];
+    
+    enumerator = [r objectEnumerator];
+    while( dict = [enumerator nextObject] )
+    {
+        NSString	*identifier, *key;
+        NSEnumerator 	*keyEnumerator;
+        NSDictionary	*d2;
+        
+        identifier = [[NSString alloc] initWithFormat:@"%@%.8X%.8X", [dict objectForKey:@"identifier"], [[dict objectForKey:@"type"] unsignedIntValue], [[dict objectForKey:@"creator"] unsignedIntValue]];
+        [hasRules addObject:identifier];
+        [identifier release];
+        
+        d2 = [dict objectForKey:@"rules"];
+	keyEnumerator = [d2 keyEnumerator];
+        while( key = [keyEnumerator nextObject] )
+        {
+            NSMutableDictionary	*d3;
+            
+            if( !(d3 = [newRules objectForKey:key]) )
+            {
+                [keys addObject:key];
+                
+                d3 = [[NSMutableDictionary alloc] initWithCapacity:10];
+                [newRules setObject:d3 forKey:key];
+                [d3 release];
+            }
+            
+            [d3 setObject:[d2 objectForKey:key] forKey:identifier];
+        }
+    }
+    
+    [rules release];
+    rules = [[NSDictionary alloc] initWithDictionary:newRules];
+    
+    [newRules release];
+}
+
+- (BOOL)anyRulesForProcess:(DeVercruesseProcess*)process
+{
+    if( !process || !rules )
+        return NO;
+    
+    return [[rules objectForKey:@"_hasRules"] containsObject:[process identifier]];
+}
+
+- (BOOL)checkRule:(NSString*)ruleKey withProcess:(DeVercruesseProcess*)process
+{
+    if( !ruleKey || !process || !rules )
+        return NO;
+    
+    return [[rules objectForKey:ruleKey] containsObject:[process identifier]];
+}
+
+- (NSSet*)processIdentifiersForRule:(NSString*)ruleKey
+{
+    return [rules objectForKey:ruleKey];
+}
+
+- (int)optionsForRule:(NSString*)ruleKey withProcess:(DeVercruesseProcess*)process
+{
+    NSDictionary *rule;
+    NSNumber *options;
+    
+    
+    if( !(rule = [rules objectForKey:ruleKey]) )
+        return 2;	// use global setting
+    
+    if( !(options = [rule objectForKey:[process identifier]]) )
+        return 2;	// use global setting
+    
+    return [options intValue];
+}
+
+@end
Index: releases/F-Script Anywhere/1.1.5/Source/English.lproj/FSAInterpreterPanel.nib/classes.nib
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/English.lproj/FSAInterpreterPanel.nib/classes.nib	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/English.lproj/FSAInterpreterPanel.nib/classes.nib	(revision 18)
@@ -0,0 +1,30 @@
+{
+    IBClasses = (
+        {
+            ACTIONS = {associateInterface = id; setFloating = id; }; 
+            CLASS = FSAController; 
+            LANGUAGE = ObjC; 
+            OUTLETS = {interpreterView = FSInterpreterView; }; 
+            SUPERCLASS = NSWindowController; 
+        }, 
+        {
+            ACTIONS = {newBigBrowser = id; newKVBrowser = id; }; 
+            CLASS = FSInterpreterView; 
+            LANGUAGE = ObjC; 
+            OUTLETS = {
+                object1 = id; 
+                object2 = id; 
+                object3 = id; 
+                object4 = id; 
+                object5 = id; 
+                object6 = id; 
+                object7 = id; 
+                object8 = id; 
+                object9 = id; 
+            }; 
+            SUPERCLASS = NSView; 
+        }, 
+        {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }
+    ); 
+    IBVersion = 1; 
+}
Index: releases/F-Script Anywhere/1.1.5/Source/English.lproj/FSAInterpreterPanel.nib/data.dependency
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/English.lproj/FSAInterpreterPanel.nib/data.dependency	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/English.lproj/FSAInterpreterPanel.nib/data.dependency	(revision 18)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
+<plist version="0.9">
+<dict>
+	<key>IBPaletteDependency</key>
+	<array>
+		<string>FScriptPalette</string>
+	</array>
+</dict>
+</plist>
Index: releases/F-Script Anywhere/1.1.5/Source/English.lproj/FSAInterpreterPanel.nib/info.nib
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/English.lproj/FSAInterpreterPanel.nib/info.nib	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/English.lproj/FSAInterpreterPanel.nib/info.nib	(revision 18)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
+<plist version="0.9">
+<dict>
+	<key>IBDocumentLocation</key>
+	<string>99 33 356 240 0 0 1600 1178 </string>
+	<key>IBFramework Version</key>
+	<string>263.2</string>
+	<key>IBOpenObjects</key>
+	<array>
+		<integer>5</integer>
+	</array>
+	<key>IBSystem Version</key>
+	<string>5S66</string>
+</dict>
+</plist>
Index: releases/F-Script Anywhere/1.1.5/Source/English.lproj/FSAViewAssociationPanel.nib/classes.nib
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/English.lproj/FSAViewAssociationPanel.nib/classes.nib	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/English.lproj/FSAViewAssociationPanel.nib/classes.nib	(revision 18)
@@ -0,0 +1,25 @@
+{
+    IBClasses = (
+        {
+            ACTIONS = {
+                captureView = id; 
+                defineVariable = id; 
+                update = id; 
+                viewInObjectBrowser = id; 
+            }; 
+            CLASS = FSAViewAssociationController; 
+            LANGUAGE = ObjC; 
+            OUTLETS = {
+                associateButton = NSButton; 
+                browseButton = NSButton; 
+                captureButton = NSButton; 
+                descriptionField = NSTextField; 
+                statusField = NSTextField; 
+                variableNameField = NSTextField; 
+            }; 
+            SUPERCLASS = NSWindowController; 
+        }, 
+        {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }
+    ); 
+    IBVersion = 1; 
+}
Index: releases/F-Script Anywhere/1.1.5/Source/English.lproj/FSAViewAssociationPanel.nib/info.nib
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/English.lproj/FSAViewAssociationPanel.nib/info.nib	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/English.lproj/FSAViewAssociationPanel.nib/info.nib	(revision 18)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
+<plist version="0.9">
+<dict>
+	<key>IBDocumentLocation</key>
+	<string>133 92 356 240 0 0 1600 1178 </string>
+	<key>IBFramework Version</key>
+	<string>263.2</string>
+	<key>IBOpenObjects</key>
+	<array>
+		<integer>5</integer>
+	</array>
+	<key>IBSystem Version</key>
+	<string>5S66</string>
+</dict>
+</plist>
Index: releases/F-Script Anywhere/1.1.5/Source/English.lproj/MainMenu.nib/classes.nib
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/English.lproj/MainMenu.nib/classes.nib	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/English.lproj/MainMenu.nib/classes.nib	(revision 18)
@@ -0,0 +1,20 @@
+{
+    IBClasses = (
+        {
+            ACTIONS = {installBundleInSelectedApp = id; terminate = id; }; 
+            CLASS = FSAApp; 
+            LANGUAGE = ObjC; 
+            OUTLETS = {appList = FSAAppList; appListPanel = NSPanel; }; 
+            SUPERCLASS = NSApplication; 
+        }, 
+        {
+            CLASS = FSAAppList; 
+            LANGUAGE = ObjC; 
+            OUTLETS = {installButton = NSButton; tableView = NSTableView; }; 
+            SUPERCLASS = NSObject; 
+        }, 
+        {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, 
+        {CLASS = NJRScrollView; LANGUAGE = ObjC; SUPERCLASS = NSScrollView; }
+    ); 
+    IBVersion = 1; 
+}
Index: releases/F-Script Anywhere/1.1.5/Source/English.lproj/MainMenu.nib/info.nib
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/English.lproj/MainMenu.nib/info.nib	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/English.lproj/MainMenu.nib/info.nib	(revision 18)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>IBDocumentLocation</key>
+	<string>153 16 356 240 0 0 1600 1178 </string>
+	<key>IBEditorPositions</key>
+	<dict>
+		<key>29</key>
+		<string>69 252 213 44 0 0 1600 1178 </string>
+	</dict>
+	<key>IBFramework Version</key>
+	<string>283.0</string>
+	<key>IBOpenObjects</key>
+	<array>
+		<integer>29</integer>
+		<integer>195</integer>
+	</array>
+	<key>IBSystem Version</key>
+	<string>6C115</string>
+</dict>
+</plist>
Index: releases/F-Script Anywhere/1.1.5/Source/F-Script Anywhere.pbproj/nicholas.pbxuser
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/F-Script Anywhere.pbproj/nicholas.pbxuser	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/F-Script Anywhere.pbproj/nicholas.pbxuser	(revision 18)
@@ -0,0 +1,935 @@
+// !$*UTF8*$!
+{
+	103DFC1B016C16650C000109 = {
+		activeExec = 0;
+	};
+	108927070180B1F40C000084 = {
+		uiCtxt = {
+			sepNavWindowFrame = "{{35, 641}, {750, 502}}";
+		};
+	};
+	29B97313FDCFA39411CA2CEA = {
+		activeBuildStyle = 4A9504CCFFE6A4B311CA0CBA;
+		activeExecutable = F59279F301FEA34701AEEC37;
+		activeTarget = 29B97326FDCFA39411CA2CEA;
+		addToTargets = (
+			103DFC1B016C16650C000109,
+		);
+		breakpoints = (
+			F5184FB202DF90C801AEEDB1,
+			F57D63130318A6D601AEEDB1,
+		);
+		executables = (
+			F59279F301FEA34701AEEC37,
+		);
+		perUserDictionary = {
+			PBXPerProjectTemplateStateSaveDate = 55214324;
+			"PBXTemplateGeometry-F5314676015831810DCA290F" = {
+				ContentSize = "{685, 434}";
+				LeftSlideOut = {
+					Collapsed = NO;
+					Frame = "{{0, 23}, {685, 411}}";
+					Split0 = {
+						ActiveTab = 2;
+						Collapsed = NO;
+						Frame = "{{0, 0}, {685, 411}}";
+						Split0 = {
+							Frame = "{{0, 221}, {685, 190}}";
+						};
+						SplitCount = 1;
+						Tab0 = {
+							Debugger = {
+								Collapsed = NO;
+								Frame = "{{0, 0}, {952, 321}}";
+								Split0 = {
+									Frame = "{{0, 24}, {952, 297}}";
+									Split0 = {
+										Frame = "{{0, 0}, {468, 297}}";
+									};
+									Split1 = {
+										DebugVariablesTableConfiguration = (
+											Name,
+											126.803,
+											Value,
+											150.074,
+											Summary,
+											172.123,
+										);
+										Frame = "{{477, 0}, {475, 297}}";
+									};
+									SplitCount = 2;
+								};
+								SplitCount = 1;
+								Tab0 = {
+									Frame = "{{0, 0}, {100, 50}}";
+								};
+								Tab1 = {
+									Frame = "{{0, 0}, {100, 50}}";
+								};
+								TabCount = 2;
+								TabsVisible = YES;
+							};
+							Frame = "{{0, 0}, {952, 321}}";
+							LauncherConfigVersion = 7;
+						};
+						Tab1 = {
+							Frame = "{{0, 0}, {781, 452}}";
+							LauncherConfigVersion = 3;
+							Runner = {
+								Frame = "{{0, 0}, {781, 452}}";
+							};
+						};
+						Tab2 = {
+							BuildMessageFrame = "{{0, 0}, {687, 149}}";
+							BuildTranscriptFrame = "{{0, 158}, {687, 59}}";
+							Frame = "{{0, 0}, {685, 215}}";
+						};
+						Tab3 = {
+							Frame = "{{0, 0}, {612, 295}}";
+						};
+						TabCount = 4;
+						TabsVisible = NO;
+					};
+					SplitCount = 1;
+					Tab0 = {
+						Frame = "{{0, 0}, {300, 533}}";
+						GroupTreeTableConfiguration = (
+							TargetStatusColumn,
+							18,
+							MainColumn,
+							267,
+						);
+					};
+					Tab1 = {
+						ClassesFrame = "{{0, 0}, {280, 398}}";
+						ClassesTreeTableConfiguration = (
+							PBXBookColumnIdentifier,
+							20,
+							PBXClassColumnIdentifier,
+							237,
+						);
+						Frame = "{{0, 0}, {278, 659}}";
+						MembersFrame = "{{0, 407}, {280, 252}}";
+						MembersTreeTableConfiguration = (
+							PBXBookColumnIdentifier,
+							20,
+							PBXMethodColumnIdentifier,
+							236,
+						);
+					};
+					Tab2 = {
+						Frame = "{{0, 0}, {200, 100}}";
+					};
+					Tab3 = {
+						Frame = "{{0, 0}, {200, 100}}";
+						TargetTableConfiguration = (
+							ActiveObject,
+							16,
+							ObjectNames,
+							202.296,
+						);
+					};
+					Tab4 = {
+						BreakpointsTreeTableConfiguration = (
+							breakpointColumn,
+							197,
+							enabledColumn,
+							31,
+						);
+						Frame = "{{0, 0}, {250, 100}}";
+					};
+					TabCount = 5;
+					TabsVisible = NO;
+				};
+				StatusViewVisible = YES;
+				Template = F5314676015831810DCA290F;
+				ToolbarVisible = YES;
+				WindowLocation = "{589, 87}";
+			};
+			"PBXTemplateGeometry-F5CA7ECB015C094F0DCA290F" = {
+				ContentSize = "{668, 621}";
+				LeftSlideOut = {
+					Collapsed = NO;
+					Frame = "{{0, 0}, {668, 621}}";
+					Split0 = {
+						Collapsed = NO;
+						Frame = "{{0, 0}, {668, 621}}";
+						Split0 = {
+							Frame = "{{0, 0}, {668, 621}}";
+						};
+						SplitCount = 1;
+						Tab0 = {
+							Debugger = {
+								Collapsed = NO;
+								Frame = "{{0, 0}, {484, 208}}";
+								Split0 = {
+									Frame = "{{0, 24}, {484, 184}}";
+									Split0 = {
+										Frame = "{{0, 0}, {236, 184}}";
+									};
+									Split1 = {
+										DebugVariablesTableConfiguration = (
+											Name,
+											123,
+											Value,
+											85,
+											Summary,
+											62.123,
+										);
+										Frame = "{{245, 0}, {239, 184}}";
+									};
+									SplitCount = 2;
+								};
+								SplitCount = 1;
+								Tab0 = {
+									Frame = "{{0, 0}, {100, 50}}";
+								};
+								Tab1 = {
+									Frame = "{{0, 0}, {100, 50}}";
+								};
+								TabCount = 2;
+								TabsVisible = YES;
+							};
+							Frame = "{{0, 0}, {484, 208}}";
+							LauncherConfigVersion = 7;
+						};
+						Tab1 = {
+							Frame = "{{0, 0}, {664, 208}}";
+							LauncherConfigVersion = 3;
+							Runner = {
+								Frame = "{{0, 0}, {664, 208}}";
+							};
+						};
+						Tab2 = {
+							BuildMessageFrame = "{{0, 0}, {666, 43}}";
+							BuildTranscriptFrame = "{{0, 52}, {666, 0}}";
+							Frame = "{{0, 0}, {664, 50}}";
+						};
+						Tab3 = {
+							Frame = "{{0, 0}, {612, 295}}";
+						};
+						TabCount = 4;
+						TabsVisible = NO;
+					};
+					SplitCount = 1;
+					Tab0 = {
+						Frame = "{{0, 0}, {313, 531}}";
+						GroupTreeTableConfiguration = (
+							TargetStatusColumn,
+							18,
+							MainColumn,
+							280,
+						);
+					};
+					Tab1 = {
+						ClassesFrame = "{{0, 0}, {280, 398}}";
+						ClassesTreeTableConfiguration = (
+							PBXBookColumnIdentifier,
+							20,
+							PBXClassColumnIdentifier,
+							237,
+						);
+						Frame = "{{0, 0}, {278, 659}}";
+						MembersFrame = "{{0, 407}, {280, 252}}";
+						MembersTreeTableConfiguration = (
+							PBXBookColumnIdentifier,
+							20,
+							PBXMethodColumnIdentifier,
+							236,
+						);
+					};
+					Tab2 = {
+						Frame = "{{0, 0}, {200, 100}}";
+					};
+					Tab3 = {
+						Frame = "{{0, 0}, {200, 557}}";
+						TargetTableConfiguration = (
+							ActiveObject,
+							16,
+							ObjectNames,
+							202.296,
+						);
+					};
+					Tab4 = {
+						BreakpointsTreeTableConfiguration = (
+							breakpointColumn,
+							197,
+							enabledColumn,
+							31,
+						);
+						Frame = "{{0, 0}, {250, 100}}";
+					};
+					TabCount = 5;
+					TabsVisible = NO;
+				};
+				StatusViewVisible = NO;
+				Template = F5CA7ECB015C094F0DCA290F;
+				ToolbarVisible = NO;
+				WindowLocation = "{489, 236}";
+			};
+			"PBXTemplateGeometry-F5CA7ECC015C09990DCA290F" = {
+				ContentSize = "{773, 558}";
+				LeftSlideOut = {
+					Collapsed = NO;
+					Frame = "{{0, 23}, {773, 535}}";
+					Split0 = {
+						ActiveTab = 0;
+						Collapsed = NO;
+						Frame = "{{24, 0}, {749, 535}}";
+						Split0 = {
+							Frame = "{{0, 273}, {749, 262}}";
+						};
+						SplitCount = 1;
+						Tab0 = {
+							Debugger = {
+								ActiveTab = 1;
+								Collapsed = NO;
+								Frame = "{{0, 0}, {749, 267}}";
+								Split0 = {
+									Frame = "{{0, 169}, {749, 98}}";
+									Split0 = {
+										Frame = "{{0, 0}, {366, 98}}";
+									};
+									Split1 = {
+										DebugVariablesTableConfiguration = (
+											Name,
+											93.80298,
+											Value,
+											116.074,
+											Summary,
+											138.123,
+										);
+										Frame = "{{375, 0}, {374, 98}}";
+									};
+									SplitCount = 2;
+								};
+								SplitCount = 1;
+								Tab0 = {
+									Frame = "{{0, 0}, {100, 50}}";
+								};
+								Tab1 = {
+									Frame = "{{0, 0}, {749, 145}}";
+								};
+								TabCount = 2;
+								TabsVisible = YES;
+							};
+							Frame = "{{0, 0}, {749, 267}}";
+							LauncherConfigVersion = 7;
+						};
+						Tab1 = {
+							Frame = "{{0, 0}, {664, 208}}";
+							LauncherConfigVersion = 3;
+							Runner = {
+								Frame = "{{0, 0}, {664, 208}}";
+							};
+						};
+						Tab2 = {
+							BuildMessageFrame = "{{0, 0}, {666, 43}}";
+							BuildTranscriptFrame = "{{0, 52}, {666, 0}}";
+							Frame = "{{0, 0}, {664, 50}}";
+						};
+						Tab3 = {
+							Frame = "{{0, 0}, {612, 295}}";
+						};
+						TabCount = 4;
+						TabsVisible = NO;
+					};
+					SplitCount = 1;
+					Tab0 = {
+						Frame = "{{0, 0}, {313, 531}}";
+						GroupTreeTableConfiguration = (
+							TargetStatusColumn,
+							18,
+							MainColumn,
+							280,
+						);
+					};
+					Tab1 = {
+						ClassesFrame = "{{0, 0}, {280, 398}}";
+						ClassesTreeTableConfiguration = (
+							PBXBookColumnIdentifier,
+							20,
+							PBXClassColumnIdentifier,
+							237,
+						);
+						Frame = "{{0, 0}, {278, 659}}";
+						MembersFrame = "{{0, 407}, {280, 252}}";
+						MembersTreeTableConfiguration = (
+							PBXBookColumnIdentifier,
+							20,
+							PBXMethodColumnIdentifier,
+							236,
+						);
+					};
+					Tab2 = {
+						Frame = "{{0, 0}, {200, 100}}";
+					};
+					Tab3 = {
+						Frame = "{{0, 0}, {200, 557}}";
+						TargetTableConfiguration = (
+							ActiveObject,
+							16,
+							ObjectNames,
+							202.296,
+						);
+					};
+					Tab4 = {
+						BreakpointsTreeTableConfiguration = (
+							breakpointColumn,
+							197,
+							enabledColumn,
+							31,
+						);
+						Frame = "{{0, 0}, {250, 100}}";
+					};
+					TabCount = 5;
+					TabsVisible = YES;
+				};
+				StatusViewVisible = YES;
+				Template = F5CA7ECC015C09990DCA290F;
+				ToolbarVisible = YES;
+				WindowLocation = "{13, 212}";
+			};
+			PBXWorkspaceContents = (
+				{
+					LeftSlideOut = {
+						Split0 = {
+							Split0 = {
+								NavContent0 = {
+									bookmark = F5486B9D034A85A801AEEDB1;
+									history = (
+										F5486B91034A85A801AEEDB1,
+										F5486B92034A85A801AEEDB1,
+										F5486B93034A85A801AEEDB1,
+										F5486B94034A85A801AEEDB1,
+										F5486B95034A85A801AEEDB1,
+									);
+									prevStack = (
+										F5486B96034A85A801AEEDB1,
+										F5486B97034A85A801AEEDB1,
+										F5486B98034A85A801AEEDB1,
+										F5486B99034A85A801AEEDB1,
+										F5486B9A034A85A801AEEDB1,
+										F5486B9B034A85A801AEEDB1,
+										F5486B9C034A85A801AEEDB1,
+									);
+								};
+								NavCount = 1;
+								NavGeometry0 = {
+									Frame = "{{0, 0}, {643, 567}}";
+									NavBarVisible = YES;
+								};
+							};
+							SplitCount = 1;
+							Tab0 = {
+								Debugger = {
+									Split0 = {
+										SplitCount = 2;
+									};
+									SplitCount = 1;
+									TabCount = 2;
+								};
+								LauncherConfigVersion = 7;
+							};
+							Tab1 = {
+								LauncherConfigVersion = 3;
+								Runner = {
+								};
+							};
+							TabCount = 4;
+						};
+						SplitCount = 1;
+						Tab1 = {
+							OptionsSetName = "Hierarchy, all classes";
+						};
+						TabCount = 5;
+					};
+				},
+				{
+					LeftSlideOut = {
+						Split0 = {
+							Split0 = {
+								NavCount = 1;
+								NavGeometry0 = {
+									Frame = "{{0, 0}, {594, 150}}";
+									NavBarVisible = YES;
+								};
+							};
+							SplitCount = 1;
+							Tab0 = {
+								Debugger = {
+									Split0 = {
+										SplitCount = 2;
+									};
+									SplitCount = 1;
+									TabCount = 2;
+								};
+								LauncherConfigVersion = 7;
+							};
+							Tab1 = {
+								LauncherConfigVersion = 3;
+								Runner = {
+								};
+							};
+							TabCount = 4;
+						};
+						SplitCount = 1;
+						Tab1 = {
+							OptionsSetName = "Hierarchy, all classes";
+						};
+						TabCount = 5;
+					};
+				},
+			);
+			PBXWorkspaceGeometries = (
+				{
+					ContentSize = "{927, 590}";
+					LeftSlideOut = {
+						ActiveTab = 0;
+						Collapsed = NO;
+						Frame = "{{0, 23}, {927, 567}}";
+						Split0 = {
+							Collapsed = NO;
+							Frame = "{{284, 0}, {643, 567}}";
+							Split0 = {
+								Frame = "{{0, 0}, {643, 567}}";
+							};
+							SplitCount = 1;
+							Tab0 = {
+								Debugger = {
+									Collapsed = NO;
+									Frame = "{{0, 0}, {681, 289}}";
+									Split0 = {
+										Frame = "{{0, 24}, {681, 265}}";
+										Split0 = {
+											Frame = "{{0, 0}, {333, 265}}";
+										};
+										Split1 = {
+											DebugVariablesTableConfiguration = (
+												Name,
+												82.80298,
+												Value,
+												104.074,
+												Summary,
+												126.123,
+											);
+											Frame = "{{342, 0}, {339, 265}}";
+										};
+										SplitCount = 2;
+									};
+									SplitCount = 1;
+									Tab0 = {
+										Frame = "{{0, 0}, {100, 50}}";
+									};
+									Tab1 = {
+										Frame = "{{0, 0}, {100, 50}}";
+									};
+									TabCount = 2;
+									TabsVisible = YES;
+								};
+								Frame = "{{0, 0}, {681, 289}}";
+								LauncherConfigVersion = 7;
+							};
+							Tab1 = {
+								Frame = "{{0, 0}, {681, 120}}";
+								LauncherConfigVersion = 3;
+								Runner = {
+									Frame = "{{0, 0}, {681, 120}}";
+								};
+							};
+							Tab2 = {
+								BuildMessageFrame = "{{0, 0}, {683, 127}}";
+								BuildTranscriptFrame = "{{0, 136}, {683, 100}}";
+								Frame = "{{0, 0}, {681, 234}}";
+							};
+							Tab3 = {
+								Frame = "{{0, 0}, {681, 238}}";
+							};
+							TabCount = 4;
+							TabsVisible = NO;
+						};
+						SplitCount = 1;
+						Tab0 = {
+							Frame = "{{0, 0}, {260, 567}}";
+							GroupTreeTableConfiguration = (
+								TargetStatusColumn,
+								18,
+								MainColumn,
+								227,
+							);
+						};
+						Tab1 = {
+							ClassesFrame = "{{0, 0}, {250, 333}}";
+							ClassesTreeTableConfiguration = (
+								PBXBookColumnIdentifier,
+								20,
+								PBXClassColumnIdentifier,
+								207,
+							);
+							Frame = "{{0, 0}, {248, 554}}";
+							MembersFrame = "{{0, 342}, {250, 212}}";
+							MembersTreeTableConfiguration = (
+								PBXBookColumnIdentifier,
+								20,
+								PBXMethodColumnIdentifier,
+								206,
+							);
+						};
+						Tab2 = {
+							Frame = "{{0, 0}, {217, 554}}";
+						};
+						Tab3 = {
+							Frame = "{{0, 0}, {239, 554}}";
+							TargetTableConfiguration = (
+								ActiveObject,
+								16,
+								ObjectNames,
+								206.296,
+							);
+						};
+						Tab4 = {
+							BreakpointsTreeTableConfiguration = (
+								breakpointColumn,
+								197,
+								enabledColumn,
+								31,
+							);
+							Frame = "{{0, 0}, {250, 554}}";
+						};
+						TabCount = 5;
+						TabsVisible = YES;
+					};
+					StatusViewVisible = YES;
+					Template = 64ABBB4501FA494900185B06;
+					ToolbarVisible = YES;
+					WindowLocation = "{9, 520}";
+				},
+				{
+					ContentSize = "{594, 303}";
+					LeftSlideOut = {
+						Collapsed = NO;
+						Frame = "{{0, 23}, {594, 280}}";
+						Split0 = {
+							ActiveTab = 1;
+							Collapsed = YES;
+							Frame = "{{0, 0}, {594, 280}}";
+							Split0 = {
+								Frame = "{{1e+06, 1e+06}, {594, 0}}";
+							};
+							SplitCount = 1;
+							Tab0 = {
+								Debugger = {
+									Collapsed = NO;
+									Frame = "{{0, 0}, {804, 321}}";
+									Split0 = {
+										Frame = "{{0, 24}, {804, 297}}";
+										Split0 = {
+											Frame = "{{0, 0}, {394, 297}}";
+										};
+										Split1 = {
+											DebugVariablesTableConfiguration = (
+												Name,
+												123,
+												Value,
+												85,
+												Summary,
+												167.123,
+											);
+											Frame = "{{403, 0}, {401, 297}}";
+										};
+										SplitCount = 2;
+									};
+									SplitCount = 1;
+									Tab0 = {
+										Frame = "{{0, 0}, {100, 50}}";
+									};
+									Tab1 = {
+										Frame = "{{0, 0}, {100, 50}}";
+									};
+									TabCount = 2;
+									TabsVisible = YES;
+								};
+								Frame = "{{0, 0}, {804, 321}}";
+								LauncherConfigVersion = 7;
+							};
+							Tab1 = {
+								Frame = "{{0, 0}, {594, 274}}";
+								LauncherConfigVersion = 3;
+								Runner = {
+									Frame = "{{0, 0}, {594, 274}}";
+								};
+							};
+							Tab2 = {
+								BuildMessageFrame = "{{0, 0}, {806, 237}}";
+								BuildTranscriptFrame = "{{0, 246}, {806, 3}}";
+								Frame = "{{0, 0}, {804, 247}}";
+							};
+							Tab3 = {
+								Frame = "{{0, 0}, {612, 295}}";
+							};
+							TabCount = 4;
+							TabsVisible = NO;
+						};
+						SplitCount = 1;
+						Tab0 = {
+							Frame = "{{0, 0}, {300, 533}}";
+							GroupTreeTableConfiguration = (
+								TargetStatusColumn,
+								18,
+								MainColumn,
+								267,
+							);
+						};
+						Tab1 = {
+							ClassesFrame = "{{0, 0}, {280, 398}}";
+							ClassesTreeTableConfiguration = (
+								PBXBookColumnIdentifier,
+								20,
+								PBXClassColumnIdentifier,
+								237,
+							);
+							Frame = "{{0, 0}, {278, 659}}";
+							MembersFrame = "{{0, 407}, {280, 252}}";
+							MembersTreeTableConfiguration = (
+								PBXBookColumnIdentifier,
+								20,
+								PBXMethodColumnIdentifier,
+								236,
+							);
+						};
+						Tab2 = {
+							Frame = "{{0, 0}, {200, 100}}";
+						};
+						Tab3 = {
+							Frame = "{{0, 0}, {200, 386}}";
+							TargetTableConfiguration = (
+								ActiveObject,
+								16,
+								ObjectNames,
+								202.296,
+							);
+						};
+						Tab4 = {
+							BreakpointsTreeTableConfiguration = (
+								breakpointColumn,
+								197,
+								enabledColumn,
+								31,
+							);
+							Frame = "{{0, 0}, {250, 386}}";
+						};
+						TabCount = 5;
+						TabsVisible = NO;
+					};
+					StatusViewVisible = YES;
+					Template = F5534CB2020F3F8A0DCA290F;
+					ToolbarVisible = YES;
+					WindowLocation = "{4, 633}";
+				},
+			);
+			PBXWorkspaceStateSaveDate = 55214324;
+		};
+		perUserProjectItems = {
+			F5486B91034A85A801AEEDB1 = F5486B91034A85A801AEEDB1;
+			F5486B92034A85A801AEEDB1 = F5486B92034A85A801AEEDB1;
+			F5486B93034A85A801AEEDB1 = F5486B93034A85A801AEEDB1;
+			F5486B94034A85A801AEEDB1 = F5486B94034A85A801AEEDB1;
+			F5486B95034A85A801AEEDB1 = F5486B95034A85A801AEEDB1;
+			F5486B96034A85A801AEEDB1 = F5486B96034A85A801AEEDB1;
+			F5486B97034A85A801AEEDB1 = F5486B97034A85A801AEEDB1;
+			F5486B98034A85A801AEEDB1 = F5486B98034A85A801AEEDB1;
+			F5486B99034A85A801AEEDB1 = F5486B99034A85A801AEEDB1;
+			F5486B9A034A85A801AEEDB1 = F5486B9A034A85A801AEEDB1;
+			F5486B9B034A85A801AEEDB1 = F5486B9B034A85A801AEEDB1;
+			F5486B9C034A85A801AEEDB1 = F5486B9C034A85A801AEEDB1;
+			F5486B9D034A85A801AEEDB1 = F5486B9D034A85A801AEEDB1;
+		};
+		projectwideBuildSettings = {
+		};
+		wantsIndex = 1;
+		wantsSCM = -1;
+	};
+	29B97326FDCFA39411CA2CEA = {
+		activeExec = 0;
+		executables = (
+			F59279F301FEA34701AEEC37,
+		);
+	};
+	F5184FB202DF90C801AEEDB1 = {
+		fileReference = F5EFC2CA020A6CD101AEEDB1;
+		isa = PBXFileBreakpoint;
+		lineNumber = 162;
+		state = 2;
+	};
+	F5486B91034A85A801AEEDB1 = {
+		fRef = F5EFC2C9020A6CD101AEEDB1;
+		isa = PBXTextBookmark;
+		name = "DeVercruesseProcess.m: initWithPSN:";
+		rLen = 0;
+		rLoc = 2022;
+		rType = 0;
+		vrLen = 863;
+		vrLoc = 1426;
+	};
+	F5486B92034A85A801AEEDB1 = {
+		fRef = F5FF50BD02E53B9E01AEEDB1;
+		isa = PBXTextBookmark;
+		name = "FSAViewAssociationController.m: __STDC__";
+		rLen = 0;
+		rLoc = 179;
+		rType = 0;
+		vrLen = 1261;
+		vrLoc = 0;
+	};
+	F5486B93034A85A801AEEDB1 = {
+		fRef = F5FD788A034828E101AEEDB1;
+		isa = PBXTextBookmark;
+		name = "FSAWindowManager.m: 270";
+		rLen = 0;
+		rLoc = 8244;
+		rType = 0;
+		vrLen = 1209;
+		vrLoc = 6919;
+	};
+	F5486B94034A85A801AEEDB1 = {
+		fRef = F574ADDB020ACAC801AEEDB1;
+		isa = PBXTextBookmark;
+		name = "FSAController.m: FSA_associateWithInterface:";
+		rLen = 0;
+		rLoc = 8299;
+		rType = 0;
+		vrLen = 1094;
+		vrLoc = 7296;
+	};
+	F5486B95034A85A801AEEDB1 = {
+		fRef = F523EA2B020CF06A01AEEC37;
+		isa = PBXTextBookmark;
+		name = "FSAnywhere.h: 1";
+		rLen = 0;
+		rLoc = 0;
+		rType = 0;
+		vrLen = 319;
+		vrLoc = 0;
+	};
+	F5486B96034A85A801AEEDB1 = {
+		fRef = F5EFC2C9020A6CD101AEEDB1;
+		isa = PBXTextBookmark;
+		name = "DeVercruesseProcess.m: initWithPSN:";
+		rLen = 0;
+		rLoc = 2022;
+		rType = 0;
+		vrLen = 863;
+		vrLoc = 1426;
+	};
+	F5486B97034A85A801AEEDB1 = {
+		fRef = F523EA2B020CF06A01AEEC37;
+		isa = PBXTextBookmark;
+		name = "FSAnywhere.h: 1";
+		rLen = 0;
+		rLoc = 0;
+		rType = 0;
+		vrLen = 319;
+		vrLoc = 0;
+	};
+	F5486B98034A85A801AEEDB1 = {
+		fRef = F574ADDB020ACAC801AEEDB1;
+		isa = PBXTextBookmark;
+		name = "FSAController.m: __VERSION__";
+		rLen = 0;
+		rLoc = 0;
+		rType = 0;
+		vrLen = 1163;
+		vrLoc = 0;
+	};
+	F5486B99034A85A801AEEDB1 = {
+		fRef = F5FF50BD02E53B9E01AEEDB1;
+		isa = PBXTextBookmark;
+		name = "FSAViewAssociationController.m: __STDC__";
+		rLen = 0;
+		rLoc = 179;
+		rType = 0;
+		vrLen = 1261;
+		vrLoc = 0;
+	};
+	F5486B9A034A85A801AEEDB1 = {
+		fRef = F574ADDB020ACAC801AEEDB1;
+		isa = PBXTextBookmark;
+		name = "FSAController.m: FSA_associateWithInterface:";
+		rLen = 0;
+		rLoc = 8336;
+		rType = 0;
+		vrLen = 1027;
+		vrLoc = 7296;
+	};
+	F5486B9B034A85A801AEEDB1 = {
+		fRef = F5FD788A034828E101AEEDB1;
+		isa = PBXTextBookmark;
+		name = "FSAWindowManager.m: 270";
+		rLen = 0;
+		rLoc = 8244;
+		rType = 0;
+		vrLen = 1209;
+		vrLoc = 6919;
+	};
+	F5486B9C034A85A801AEEDB1 = {
+		fRef = F574ADDB020ACAC801AEEDB1;
+		isa = PBXTextBookmark;
+		name = "FSAController.m: FSA_associateWithInterface:";
+		rLen = 0;
+		rLoc = 8299;
+		rType = 0;
+		vrLen = 1094;
+		vrLoc = 7296;
+	};
+	F5486B9D034A85A801AEEDB1 = {
+		fRef = F523EA2B020CF06A01AEEC37;
+		isa = PBXTextBookmark;
+		name = "FSAnywhere.h: 9";
+		rLen = 0;
+		rLoc = 176;
+		rType = 0;
+		vrLen = 319;
+		vrLoc = 0;
+	};
+	F574ADDB020ACAC801AEEDB1 = {
+		uiCtxt = {
+			sepNavWindowFrame = "{{15, 671}, {750, 502}}";
+		};
+	};
+	F57D63130318A6D601AEEDB1 = {
+		isa = PBXSymbolicBreakpoint;
+		state = 1;
+		symbolName = CFLog;
+	};
+	F59279F301FEA34701AEEC37 = {
+		activeArgIndex = 2147483647;
+		argumentStrings = (
+		);
+		debuggerPlugin = GDBDebugging;
+		dylibVariantSuffix = "";
+		enableDebugStr = 1;
+		environmentEntries = (
+			{
+				active = YES;
+				name = NSZombieEnabled;
+				value = YES;
+			},
+		);
+		isa = PBXExecutable;
+		name = Application;
+		shlibInfoDictList = (
+		);
+		sourceDirectories = (
+		);
+	};
+	F5EFC2CA020A6CD101AEEDB1 = {
+		uiCtxt = {
+			sepNavWindowFrame = "{{61, 629}, {750, 502}}";
+		};
+	};
+	F5EFC2E7020A8F7F01AEEDB1 = {
+		uiCtxt = {
+			sepNavWindowFrame = "{{107, 587}, {750, 502}}";
+		};
+	};
+}
Index: releases/F-Script Anywhere/1.1.5/Source/F-Script Anywhere.pbproj/project.pbxproj
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/F-Script Anywhere.pbproj/project.pbxproj	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/F-Script Anywhere.pbproj/project.pbxproj	(revision 18)
@@ -0,0 +1,1027 @@
+// !$*UTF8*$!
+{
+	archiveVersion = 1;
+	classes = {
+	};
+	objectVersion = 38;
+	objects = {
+		080E96DCFE201CFB7F000001 = {
+			fileRef = 29B97318FDCFA39411CA2CEA;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		089C165CFE840E0CC02AAC07 = {
+			children = (
+				089C165DFE840E0CC02AAC07,
+			);
+			isa = PBXVariantGroup;
+			name = InfoPlist.strings;
+			refType = 4;
+		};
+		089C165DFE840E0CC02AAC07 = {
+			fileEncoding = 10;
+			isa = PBXFileReference;
+			name = English;
+			path = English.lproj/InfoPlist.strings;
+			refType = 4;
+		};
+		089C165EFE840E0CC02AAC07 = {
+			fileRef = 089C165CFE840E0CC02AAC07;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+//080
+//081
+//082
+//083
+//084
+//100
+//101
+//102
+//103
+//104
+		103DFC16016C12D80C000109 = {
+			isa = PBXFileReference;
+			path = FSAApp.h;
+			refType = 2;
+		};
+		103DFC17016C12D80C000109 = {
+			indentWidth = 4;
+			isa = PBXFileReference;
+			path = FSAApp.m;
+			refType = 2;
+			tabWidth = 8;
+			usesTabs = 0;
+		};
+		103DFC18016C12D80C000109 = {
+			fileRef = 103DFC16016C12D80C000109;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		103DFC19016C12D80C000109 = {
+			fileRef = 103DFC17016C12D80C000109;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		103DFC1A016C16650C000109 = {
+			isa = PBXLibraryReference;
+			path = "F-Script Anywhere";
+			refType = 3;
+		};
+		103DFC1B016C16650C000109 = {
+			buildPhases = (
+				103DFC1C016C16650C000109,
+				103DFC1D016C16650C000109,
+				103DFC1E016C16650C000109,
+				103DFC1F016C16650C000109,
+			);
+			buildSettings = {
+				DYLIB_COMPATIBILITY_VERSION = 1;
+				DYLIB_CURRENT_VERSION = 1;
+				LIBRARY_STYLE = BUNDLE;
+				OTHER_CFLAGS = "";
+				OTHER_LDFLAGS = "";
+				OTHER_LIBTOOL_FLAGS = "";
+				OTHER_REZFLAGS = "";
+				PREBINDING = NO;
+				PRODUCT_NAME = "F-Script Anywhere";
+				REZ_EXECUTABLE = YES;
+				SECTORDER_FLAGS = "";
+				WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+			};
+			isa = PBXLibraryTarget;
+			name = Library;
+			productInstallPath = /usr/local/lib;
+			productName = TestPatch;
+			productReference = 103DFC1A016C16650C000109;
+			shouldUseHeadermap = 0;
+		};
+		103DFC1C016C16650C000109 = {
+			buildActionMask = 2147483647;
+			files = (
+				F574ADDF020ACCDF01AEEDB1,
+				F523EA2C020CF06A01AEEC37,
+				F5FF50BE02E53B9E01AEEDB1,
+				F5FD788B034828E101AEEDB1,
+			);
+			isa = PBXHeadersBuildPhase;
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		103DFC1D016C16650C000109 = {
+			buildActionMask = 2147483647;
+			files = (
+				103DFC26016C17070C000109,
+				F574ADE0020ACCDF01AEEDB1,
+				F523EA2F020CF15B01AEEC37,
+				F5FF50BF02E53B9E01AEEDB1,
+				F5FD788C034828E101AEEDB1,
+			);
+			isa = PBXSourcesBuildPhase;
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		103DFC1E016C16650C000109 = {
+			buildActionMask = 2147483647;
+			files = (
+				F59279FA01FED09A01AEEC37,
+				F5EFC2C4020A6C2601AEEDB1,
+			);
+			isa = PBXFrameworksBuildPhase;
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		103DFC1F016C16650C000109 = {
+			buildActionMask = 2147483647;
+			files = (
+			);
+			isa = PBXRezBuildPhase;
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		103DFC20016C16E20C000109 = {
+			isa = PBXFileReference;
+			path = FSABundle.m;
+			refType = 2;
+		};
+		103DFC26016C17070C000109 = {
+			fileRef = 103DFC20016C16E20C000109;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		103DFC28016C17A00C000109 = {
+			buildActionMask = 2147483647;
+			dstPath = "";
+			dstSubfolderSpec = 7;
+			files = (
+				F535E680020CDD4601AEEC37,
+			);
+			isa = PBXCopyFilesBuildPhase;
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		1058C7A1FEA54F0111CA2CBB = {
+			isa = PBXFrameworkReference;
+			name = Cocoa.framework;
+			path = /System/Library/Frameworks/Cocoa.framework;
+			refType = 0;
+		};
+		1058C7A3FEA54F0111CA2CBB = {
+			fileRef = 1058C7A1FEA54F0111CA2CBB;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		108927070180B1F40C000084 = {
+			isa = PBXFileReference;
+			name = libPatchCocoa.a;
+			path = /usr/local/lib/libPatchCocoa.a;
+			refType = 0;
+		};
+		108927080180B1F40C000084 = {
+			fileRef = 108927070180B1F40C000084;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		108927090180B2600C000084 = {
+			isa = PBXTargetDependency;
+			target = 103DFC1B016C16650C000109;
+		};
+//100
+//101
+//102
+//103
+//104
+//170
+//171
+//172
+//173
+//174
+		17587328FF379C6511CA2CBB = {
+			isa = PBXApplicationReference;
+			path = "F-Script Anywhere.app";
+			refType = 3;
+		};
+//170
+//171
+//172
+//173
+//174
+//190
+//191
+//192
+//193
+//194
+		19C28FACFE9D520D11CA2CBB = {
+			children = (
+				17587328FF379C6511CA2CBB,
+				103DFC1A016C16650C000109,
+			);
+			isa = PBXGroup;
+			name = Products;
+			refType = 4;
+		};
+//190
+//191
+//192
+//193
+//194
+//290
+//291
+//292
+//293
+//294
+		29B97313FDCFA39411CA2CEA = {
+			buildStyles = (
+				4A9504CCFFE6A4B311CA0CBA,
+				4A9504CDFFE6A4B311CA0CBA,
+			);
+			isa = PBXProject;
+			mainGroup = 29B97314FDCFA39411CA2CEA;
+			projectDirPath = "";
+			targets = (
+				29B97326FDCFA39411CA2CEA,
+				103DFC1B016C16650C000109,
+			);
+		};
+		29B97314FDCFA39411CA2CEA = {
+			children = (
+				F523EA31020CF1C701AEEC37,
+				29B97315FDCFA39411CA2CEA,
+				F5EFC2DB020A6E4301AEEDB1,
+				F5EFC2D8020A6E0E01AEEDB1,
+				29B97317FDCFA39411CA2CEA,
+				29B97323FDCFA39411CA2CEA,
+				19C28FACFE9D520D11CA2CBB,
+			);
+			isa = PBXGroup;
+			name = PatchTest;
+			path = "";
+			refType = 4;
+		};
+		29B97315FDCFA39411CA2CEA = {
+			children = (
+				103DFC20016C16E20C000109,
+				F574ADDA020ACAC801AEEDB1,
+				F574ADDB020ACAC801AEEDB1,
+				F5FF50BC02E53B9E01AEEDB1,
+				F5FF50BD02E53B9E01AEEDB1,
+				F5FD7889034828E101AEEDB1,
+				F5FD788A034828E101AEEDB1,
+			);
+			isa = PBXGroup;
+			name = "Library sources";
+			path = "";
+			refType = 4;
+		};
+		29B97316FDCFA39411CA2CEA = {
+			isa = PBXFileReference;
+			path = main.m;
+			refType = 4;
+		};
+		29B97317FDCFA39411CA2CEA = {
+			children = (
+				29B97318FDCFA39411CA2CEA,
+				F5680F7A020D0D0401AEEC37,
+				F5FF50C002E53EE101AEEDB1,
+				089C165CFE840E0CC02AAC07,
+				F535E67D020CD95201AEEC37,
+				F5694E2702E96FFE01AEEDB1,
+				F57D63160319B6CA01AEEDB1,
+				F523EA29020CEF5001AEEC37,
+				F5680F83020D369A01AEEC37,
+				F5680F7F020D35ED01AEEC37,
+				F5B11ED902E67DB101AEEDB1,
+			);
+			isa = PBXGroup;
+			name = Resources;
+			path = "";
+			refType = 4;
+		};
+		29B97318FDCFA39411CA2CEA = {
+			children = (
+				29B97319FDCFA39411CA2CEA,
+			);
+			isa = PBXVariantGroup;
+			name = MainMenu.nib;
+			path = "";
+			refType = 4;
+		};
+		29B97319FDCFA39411CA2CEA = {
+			isa = PBXFileReference;
+			name = English;
+			path = English.lproj/MainMenu.nib;
+			refType = 4;
+		};
+		29B97323FDCFA39411CA2CEA = {
+			children = (
+				F59279FB01FED0C901AEEC37,
+				1058C7A1FEA54F0111CA2CBB,
+				108927070180B1F40C000084,
+				F5EFC2C3020A6C2601AEEDB1,
+			);
+			isa = PBXGroup;
+			name = Frameworks;
+			path = "";
+			refType = 4;
+		};
+		29B97326FDCFA39411CA2CEA = {
+			buildPhases = (
+				29B97327FDCFA39411CA2CEA,
+				29B97328FDCFA39411CA2CEA,
+				29B9732BFDCFA39411CA2CEA,
+				29B9732DFDCFA39411CA2CEA,
+				103DFC28016C17A00C000109,
+				F52D400302D2C7A201AEEDB1,
+				F5680F81020D365601AEEC37,
+			);
+			buildSettings = {
+				FRAMEWORK_SEARCH_PATHS = "\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"";
+				HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../Darwin source/Commands/Apple/cctools/include\"";
+				INSTALL_PATH = /;
+				LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../Darwin source/Commands/Apple/cctools/libstuff\"";
+				OTHER_LDFLAGS = "-multiply_defined suppress -lstuff";
+				PREBINDING = NO;
+				PRODUCT_NAME = "F-Script Anywhere";
+				SECTORDER_FLAGS = "";
+				WARNING_CFLAGS = "-Wno-long-double -Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+				WRAPPER_EXTENSION = app;
+			};
+			dependencies = (
+				108927090180B2600C000084,
+			);
+			isa = PBXApplicationTarget;
+			name = Application;
+			productInstallPath = /;
+			productName = PatchTest;
+			productReference = 17587328FF379C6511CA2CBB;
+			productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
+<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
+<plist version=\"1.0\">
+<dict>
+	<key>CFBundleDevelopmentRegion</key>
+	<string>English</string>
+	<key>CFBundleExecutable</key>
+	<string>F-Script Anywhere</string>
+	<key>CFBundleGetInfoString</key>
+	<string>F-Script Anywhere 1.1.5, © 2002 Nicholas Riley</string>
+	<key>CFBundleIconFile</key>
+	<string>Application icon</string>
+	<key>CFBundleIdentifier</key>
+	<string>net.sabi.FScriptAnywhereApp</string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundleName</key>
+	<string>F-Script Anywhere</string>
+	<key>CFBundlePackageType</key>
+	<string>APPL</string>
+	<key>CFBundleShortVersionString</key>
+	<string>1.1.5</string>
+	<key>CFBundleSignature</key>
+	<string>FSAn</string>
+	<key>CFBundleVersion</key>
+	<string>1.1.5</string>
+	<key>NSMainNibFile</key>
+	<string>MainMenu</string>
+	<key>NSPrincipalClass</key>
+	<string>FSAApp</string>
+</dict>
+</plist>
+";
+			shouldUseHeadermap = 1;
+		};
+		29B97327FDCFA39411CA2CEA = {
+			buildActionMask = 2147483647;
+			files = (
+				103DFC18016C12D80C000109,
+				F5EFC2CD020A6CD101AEEDB1,
+				F5EFC2CE020A6CD101AEEDB1,
+				F5EFC2D2020A6CEC01AEEDB1,
+				F5EFC2D9020A6E0E01AEEDB1,
+				F5EFC2DE020A6EB901AEEDB1,
+				F5EFC2E2020A6FD501AEEDB1,
+				F5EFC2E9020A8F7F01AEEDB1,
+				F574ADD7020AC10F01AEEDB1,
+				F523EA2D020CF06A01AEEC37,
+				F53A0D8402750B1F01AEEDB1,
+			);
+			isa = PBXHeadersBuildPhase;
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		29B97328FDCFA39411CA2CEA = {
+			buildActionMask = 2147483647;
+			files = (
+				080E96DCFE201CFB7F000001,
+				089C165EFE840E0CC02AAC07,
+				F535E67E020CD95201AEEC37,
+				F523EA2A020CEF5001AEEC37,
+				F5680F7C020D0D0401AEEC37,
+				F5FF50C202E5418F01AEEDB1,
+				F5694E2802E96FFE01AEEDB1,
+				F57D63170319B6CA01AEEDB1,
+			);
+			isa = PBXResourcesBuildPhase;
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		29B9732BFDCFA39411CA2CEA = {
+			buildActionMask = 2147483647;
+			files = (
+				29B9732CFDCFA39411CA2CEA,
+				103DFC19016C12D80C000109,
+				F5EFC2CF020A6CD101AEEDB1,
+				F5EFC2D0020A6CD101AEEDB1,
+				F5EFC2DA020A6E0E01AEEDB1,
+				F5EFC2DF020A6EB901AEEDB1,
+				F5EFC2E3020A6FD501AEEDB1,
+				F5EFC2EA020A8F7F01AEEDB1,
+				F5EFC2EC020A90DF01AEEDB1,
+				F574ADD8020AC10F01AEEDB1,
+				F523EA30020CF15B01AEEC37,
+				F53A0D8502750B1F01AEEDB1,
+			);
+			isa = PBXSourcesBuildPhase;
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		29B9732CFDCFA39411CA2CEA = {
+			fileRef = 29B97316FDCFA39411CA2CEA;
+			isa = PBXBuildFile;
+			settings = {
+				ATTRIBUTES = (
+				);
+			};
+		};
+		29B9732DFDCFA39411CA2CEA = {
+			buildActionMask = 2147483647;
+			files = (
+				1058C7A3FEA54F0111CA2CBB,
+				108927080180B1F40C000084,
+				F5EFC2D5020A6D3701AEEDB1,
+			);
+			isa = PBXFrameworksBuildPhase;
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+//290
+//291
+//292
+//293
+//294
+//4A0
+//4A1
+//4A2
+//4A3
+//4A4
+		4A9504CCFFE6A4B311CA0CBA = {
+			buildRules = (
+			);
+			buildSettings = {
+				COPY_PHASE_STRIP = NO;
+				OPTIMIZATION_CFLAGS = "-O0";
+			};
+			isa = PBXBuildStyle;
+			name = Development;
+		};
+		4A9504CDFFE6A4B311CA0CBA = {
+			buildRules = (
+			);
+			buildSettings = {
+				COPY_PHASE_STRIP = YES;
+				OTHER_CFLAGS = "-DFSA_DEBUG=0";
+			};
+			isa = PBXBuildStyle;
+			name = Deployment;
+		};
+//4A0
+//4A1
+//4A2
+//4A3
+//4A4
+//F50
+//F51
+//F52
+//F53
+//F54
+		F523EA27020CEB5701AEEC37 = {
+			isa = PBXFileReference;
+			name = English;
+			path = English.lproj/Credits.rtf;
+			refType = 4;
+		};
+		F523EA29020CEF5001AEEC37 = {
+			children = (
+				F523EA27020CEB5701AEEC37,
+			);
+			isa = PBXVariantGroup;
+			name = Credits.rtf;
+			refType = 4;
+		};
+		F523EA2A020CEF5001AEEC37 = {
+			fileRef = F523EA29020CEF5001AEEC37;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F523EA2B020CF06A01AEEC37 = {
+			isa = PBXFileReference;
+			path = FSAnywhere.h;
+			refType = 4;
+		};
+		F523EA2C020CF06A01AEEC37 = {
+			fileRef = F523EA2B020CF06A01AEEC37;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F523EA2D020CF06A01AEEC37 = {
+			fileRef = F523EA2B020CF06A01AEEC37;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F523EA2E020CF15B01AEEC37 = {
+			isa = PBXFileReference;
+			path = FSAnywhere.m;
+			refType = 4;
+		};
+		F523EA2F020CF15B01AEEC37 = {
+			fileRef = F523EA2E020CF15B01AEEC37;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F523EA30020CF15B01AEEC37 = {
+			fileRef = F523EA2E020CF15B01AEEC37;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F523EA31020CF1C701AEEC37 = {
+			children = (
+				F523EA2B020CF06A01AEEC37,
+				F523EA2E020CF15B01AEEC37,
+			);
+			isa = PBXGroup;
+			name = "Shared sources";
+			path = "";
+			refType = 4;
+		};
+		F52D400302D2C7A201AEEDB1 = {
+			buildActionMask = 12;
+			dstPath = "${DSTROOT}";
+			dstSubfolderSpec = 0;
+			files = (
+				F52D400402D2C7A501AEEDB1,
+			);
+			isa = PBXCopyFilesBuildPhase;
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		F52D400402D2C7A501AEEDB1 = {
+			fileRef = F5680F83020D369A01AEEC37;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F535E67D020CD95201AEEC37 = {
+			isa = PBXFileReference;
+			path = "Application icon.icns";
+			refType = 4;
+		};
+		F535E67E020CD95201AEEC37 = {
+			fileRef = F535E67D020CD95201AEEC37;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F535E680020CDD4601AEEC37 = {
+			fileRef = 103DFC1A016C16650C000109;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F53A0D8202750B1F01AEEDB1 = {
+			isa = PBXFileReference;
+			path = "NSTableView-NJRExtensions.h";
+			refType = 4;
+		};
+		F53A0D8302750B1F01AEEDB1 = {
+			isa = PBXFileReference;
+			path = "NSTableView-NJRExtensions.m";
+			refType = 4;
+		};
+		F53A0D8402750B1F01AEEDB1 = {
+			fileRef = F53A0D8202750B1F01AEEDB1;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F53A0D8502750B1F01AEEDB1 = {
+			fileRef = F53A0D8302750B1F01AEEDB1;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F5680F7A020D0D0401AEEC37 = {
+			children = (
+				F5680F7B020D0D0401AEEC37,
+			);
+			isa = PBXVariantGroup;
+			name = FSAInterpreterPanel.nib;
+			path = "";
+			refType = 4;
+		};
+		F5680F7B020D0D0401AEEC37 = {
+			isa = PBXFileReference;
+			name = English;
+			path = English.lproj/FSAInterpreterPanel.nib;
+			refType = 4;
+		};
+		F5680F7C020D0D0401AEEC37 = {
+			fileRef = F5680F7A020D0D0401AEEC37;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F5680F7F020D35ED01AEEC37 = {
+			isa = PBXFileReference;
+			path = "Read Me";
+			refType = 4;
+		};
+		F5680F81020D365601AEEC37 = {
+			buildActionMask = 8;
+			files = (
+			);
+			generatedFileNames = (
+			);
+			isa = PBXShellScriptBuildPhase;
+			neededFileNames = (
+			);
+			runOnlyForDeploymentPostprocessing = 1;
+			shellPath = /bin/sh;
+			shellScript = "# Copy various README files into DSTROOT if building a root\n\nif [ z\"${DSTROOT}\" != z\"\" ] ; then\n    rm -f \"${DSTROOT}/Read Me\"\n    tr '\\n' '\\r' < \"Read Me\" > \"${DSTROOT}/Read Me\"\n    cp \"Read Me.rsrc\" \"${DSTROOT}/Read Me/..namedfork/rsrc\"\n    /Developer/Tools/SetFile -t 'ttro' -c 'ttxt' \"${DSTROOT}/Read Me\"\n        \n    # Create Darwin source directory\n    mkdir \"${DSTROOT}/Darwin source\"\n    \n    # Fix permissions so ditto doesn't lock people out\n    chmod -R a+rX,u+w \"${DSTROOT}\"\nfi";
+		};
+		F5680F83020D369A01AEEC37 = {
+			isa = PBXFileReference;
+			name = LICENSE.rtf;
+			path = ../LICENSE.rtf;
+			refType = 2;
+		};
+		F5694E2702E96FFE01AEEDB1 = {
+			isa = PBXFileReference;
+			path = "Bullseye menu cursor.tiff";
+			refType = 4;
+		};
+		F5694E2802E96FFE01AEEDB1 = {
+			fileRef = F5694E2702E96FFE01AEEDB1;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F574ADD5020AC10F01AEEDB1 = {
+			isa = PBXFileReference;
+			path = NJRScrollView.m;
+			refType = 4;
+		};
+		F574ADD6020AC10F01AEEDB1 = {
+			isa = PBXFileReference;
+			path = NJRScrollView.h;
+			refType = 4;
+		};
+		F574ADD7020AC10F01AEEDB1 = {
+			fileRef = F574ADD6020AC10F01AEEDB1;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F574ADD8020AC10F01AEEDB1 = {
+			fileRef = F574ADD5020AC10F01AEEDB1;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F574ADDA020ACAC801AEEDB1 = {
+			isa = PBXFileReference;
+			path = FSAController.h;
+			refType = 4;
+		};
+		F574ADDB020ACAC801AEEDB1 = {
+			isa = PBXFileReference;
+			path = FSAController.m;
+			refType = 4;
+		};
+		F574ADDF020ACCDF01AEEDB1 = {
+			fileRef = F574ADDA020ACAC801AEEDB1;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F574ADE0020ACCDF01AEEDB1 = {
+			fileRef = F574ADDB020ACAC801AEEDB1;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F57D63160319B6CA01AEEDB1 = {
+			isa = PBXFileReference;
+			path = "Fallback checkmark.tiff";
+			refType = 4;
+		};
+		F57D63170319B6CA01AEEDB1 = {
+			fileRef = F57D63160319B6CA01AEEDB1;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F59279FA01FED09A01AEEC37 = {
+			fileRef = 1058C7A1FEA54F0111CA2CBB;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F59279FB01FED0C901AEEC37 = {
+			isa = PBXFrameworkReference;
+			name = Carbon.framework;
+			path = /System/Library/Frameworks/Carbon.framework;
+			refType = 0;
+		};
+		F5B11ED902E67DB101AEEDB1 = {
+			isa = PBXFileReference;
+			path = VERSION;
+			refType = 4;
+		};
+		F5EFC2C3020A6C2601AEEDB1 = {
+			isa = PBXFrameworkReference;
+			name = FScript.framework;
+			path = /Library/Frameworks/FScript.framework;
+			refType = 0;
+		};
+		F5EFC2C4020A6C2601AEEDB1 = {
+			fileRef = F5EFC2C3020A6C2601AEEDB1;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F5EFC2C9020A6CD101AEEDB1 = {
+			isa = PBXFileReference;
+			path = DeVercruesseProcess.m;
+			refType = 4;
+		};
+		F5EFC2CA020A6CD101AEEDB1 = {
+			isa = PBXFileReference;
+			path = DeVercruesseProcessManager.m;
+			refType = 4;
+		};
+		F5EFC2CB020A6CD101AEEDB1 = {
+			isa = PBXFileReference;
+			path = DeVercruesseProcess.h;
+			refType = 4;
+		};
+		F5EFC2CC020A6CD101AEEDB1 = {
+			isa = PBXFileReference;
+			path = DeVercruesseProcessManager.h;
+			refType = 4;
+		};
+		F5EFC2CD020A6CD101AEEDB1 = {
+			fileRef = F5EFC2CB020A6CD101AEEDB1;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F5EFC2CE020A6CD101AEEDB1 = {
+			fileRef = F5EFC2CC020A6CD101AEEDB1;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F5EFC2CF020A6CD101AEEDB1 = {
+			fileRef = F5EFC2C9020A6CD101AEEDB1;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F5EFC2D0020A6CD101AEEDB1 = {
+			fileRef = F5EFC2CA020A6CD101AEEDB1;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F5EFC2D1020A6CEC01AEEDB1 = {
+			isa = PBXFileReference;
+			path = CPS.h;
+			refType = 4;
+		};
+		F5EFC2D2020A6CEC01AEEDB1 = {
+			fileRef = F5EFC2D1020A6CEC01AEEDB1;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F5EFC2D5020A6D3701AEEDB1 = {
+			fileRef = F59279FB01FED0C901AEEC37;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F5EFC2D6020A6E0E01AEEDB1 = {
+			isa = PBXFileReference;
+			path = FSAAppList.h;
+			refType = 4;
+		};
+		F5EFC2D7020A6E0E01AEEDB1 = {
+			isa = PBXFileReference;
+			path = FSAAppList.m;
+			refType = 4;
+		};
+		F5EFC2D8020A6E0E01AEEDB1 = {
+			children = (
+				F5EFC2D1020A6CEC01AEEDB1,
+				F5EFC2CB020A6CD101AEEDB1,
+				F5EFC2C9020A6CD101AEEDB1,
+				F5EFC2CC020A6CD101AEEDB1,
+				F5EFC2CA020A6CD101AEEDB1,
+			);
+			isa = PBXGroup;
+			name = "ASM sources";
+			path = "";
+			refType = 4;
+		};
+		F5EFC2D9020A6E0E01AEEDB1 = {
+			fileRef = F5EFC2D6020A6E0E01AEEDB1;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F5EFC2DA020A6E0E01AEEDB1 = {
+			fileRef = F5EFC2D7020A6E0E01AEEDB1;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F5EFC2DB020A6E4301AEEDB1 = {
+			children = (
+				29B97316FDCFA39411CA2CEA,
+				103DFC16016C12D80C000109,
+				103DFC17016C12D80C000109,
+				F5EFC2D6020A6E0E01AEEDB1,
+				F5EFC2D7020A6E0E01AEEDB1,
+				F5EFC2E1020A6FD501AEEDB1,
+				F5EFC2E0020A6FD501AEEDB1,
+				F5EFC2DD020A6EB901AEEDB1,
+				F5EFC2DC020A6EB901AEEDB1,
+				F53A0D8202750B1F01AEEDB1,
+				F53A0D8302750B1F01AEEDB1,
+				F574ADD6020AC10F01AEEDB1,
+				F574ADD5020AC10F01AEEDB1,
+				F5EFC2E7020A8F7F01AEEDB1,
+				F5EFC2E8020A8F7F01AEEDB1,
+				F5EFC2EB020A90DF01AEEDB1,
+			);
+			isa = PBXGroup;
+			name = "Application sources";
+			path = "";
+			refType = 4;
+		};
+		F5EFC2DC020A6EB901AEEDB1 = {
+			isa = PBXFileReference;
+			path = "NSString-NJRExtensions.m";
+			refType = 4;
+		};
+		F5EFC2DD020A6EB901AEEDB1 = {
+			isa = PBXFileReference;
+			path = "NSString-NJRExtensions.h";
+			refType = 4;
+		};
+		F5EFC2DE020A6EB901AEEDB1 = {
+			fileRef = F5EFC2DD020A6EB901AEEDB1;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F5EFC2DF020A6EB901AEEDB1 = {
+			fileRef = F5EFC2DC020A6EB901AEEDB1;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F5EFC2E0020A6FD501AEEDB1 = {
+			isa = PBXFileReference;
+			path = NJRLabeledImageCell.m;
+			refType = 4;
+		};
+		F5EFC2E1020A6FD501AEEDB1 = {
+			isa = PBXFileReference;
+			path = NJRLabeledImageCell.h;
+			refType = 4;
+		};
+		F5EFC2E2020A6FD501AEEDB1 = {
+			fileRef = F5EFC2E1020A6FD501AEEDB1;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F5EFC2E3020A6FD501AEEDB1 = {
+			fileRef = F5EFC2E0020A6FD501AEEDB1;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F5EFC2E7020A8F7F01AEEDB1 = {
+			isa = PBXFileReference;
+			path = libMatch.h;
+			refType = 4;
+		};
+		F5EFC2E8020A8F7F01AEEDB1 = {
+			isa = PBXFileReference;
+			path = libMatch.c;
+			refType = 4;
+		};
+		F5EFC2E9020A8F7F01AEEDB1 = {
+			fileRef = F5EFC2E7020A8F7F01AEEDB1;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F5EFC2EA020A8F7F01AEEDB1 = {
+			fileRef = F5EFC2E8020A8F7F01AEEDB1;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F5EFC2EB020A90DF01AEEDB1 = {
+			isa = PBXFileReference;
+			path = bytesex.c;
+			refType = 4;
+		};
+		F5EFC2EC020A90DF01AEEDB1 = {
+			fileRef = F5EFC2EB020A90DF01AEEDB1;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F5FD7889034828E101AEEDB1 = {
+			isa = PBXFileReference;
+			path = FSAWindowManager.h;
+			refType = 4;
+		};
+		F5FD788A034828E101AEEDB1 = {
+			isa = PBXFileReference;
+			path = FSAWindowManager.m;
+			refType = 4;
+		};
+		F5FD788B034828E101AEEDB1 = {
+			fileRef = F5FD7889034828E101AEEDB1;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F5FD788C034828E101AEEDB1 = {
+			fileRef = F5FD788A034828E101AEEDB1;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F5FF50BC02E53B9E01AEEDB1 = {
+			isa = PBXFileReference;
+			path = FSAViewAssociationController.h;
+			refType = 4;
+		};
+		F5FF50BD02E53B9E01AEEDB1 = {
+			isa = PBXFileReference;
+			path = FSAViewAssociationController.m;
+			refType = 4;
+		};
+		F5FF50BE02E53B9E01AEEDB1 = {
+			fileRef = F5FF50BC02E53B9E01AEEDB1;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F5FF50BF02E53B9E01AEEDB1 = {
+			fileRef = F5FF50BD02E53B9E01AEEDB1;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F5FF50C002E53EE101AEEDB1 = {
+			children = (
+				F5FF50C102E53EE101AEEDB1,
+			);
+			isa = PBXVariantGroup;
+			name = FSAViewAssociationPanel.nib;
+			path = "";
+			refType = 4;
+		};
+		F5FF50C102E53EE101AEEDB1 = {
+			isa = PBXFileReference;
+			name = English;
+			path = English.lproj/FSAViewAssociationPanel.nib;
+			refType = 4;
+		};
+		F5FF50C202E5418F01AEEDB1 = {
+			fileRef = F5FF50C002E53EE101AEEDB1;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+	};
+	rootObject = 29B97313FDCFA39411CA2CEA;
+}
Index: releases/F-Script Anywhere/1.1.5/Source/FSAApp.h
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/FSAApp.h	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/FSAApp.h	(revision 18)
@@ -0,0 +1,47 @@
+//
+//  FSAApp.h
+//  F-Script Anywhere
+//
+//  Created by Nicholas Riley on Fri Feb 01 2002.
+//  Copyright (c) 2002 Nicholas Riley. All rights reserved.
+//
+
+/*
+
+ F-Script Anywhere is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ F-Script Anywhere is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with F-Script Anywhere; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+#import <Cocoa/Cocoa.h>
+#import "FSAAppList.h"
+
+@interface FSAApp : NSApplication
+{
+    IBOutlet NSPanel *appListPanel;
+    IBOutlet FSAAppList *appList;
+}
+
+- (void) finishLaunching;
+
+- (IBAction)installBundleInSelectedApp:(id)sender;
+- (void)unloadBundles:(id)sender;
+@end
+
+@interface FSAApp (PatchControllerDelegate)
+
+- (void) notifyProcessLaunch:(pid_t)pid info:(NSDictionary*)info;
+- (void) notifyProcessDeath:(pid_t)pid info:(NSDictionary*)info;
+
+@end
Index: releases/F-Script Anywhere/1.1.5/Source/FSAApp.m
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/FSAApp.m	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/FSAApp.m	(revision 18)
@@ -0,0 +1,202 @@
+//
+//  FSAApp.m
+//  F-Script Anywhere
+//
+//  Created by Nicholas Riley on Fri Feb 01 2002.
+//  Copyright (c) 2002 Nicholas Riley. All rights reserved.
+//
+
+/*
+
+ F-Script Anywhere is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ F-Script Anywhere is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with F-Script Anywhere; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+#import <PatchCocoa.h>
+#import "FSAApp.h"
+#import "FSAnywhere.h"
+
+NSString * const PatchBundleIdentifier = @"net.sabi.FScriptAnywhere";
+
+typedef struct {
+    OSStatus status;
+    NSString * const desc;
+} errRec, errList[];
+
+// These are just educated guesses based on the errors I've seen; I haven't seen these documented anywhere!
+static errList ERRS = {
+    { 5, @"F-Script Anywhere must be installed in a Cocoa application running as the current user.\n\nYou may be attempting to install in a setuid application, which is not supported" },
+    { 11, @"F-Script Anywhere cannot be installed in itself.\n\nIf you wish to install F-Script Anywhere in itself, make a copy of the F-Script Anywhere application and install one copy into the other" },
+    { smUnExBusErr, @"a bus error occurred.\n\nTry switching to the application first then using F-Script AnywhereÕs dock menu to install" },
+    { fnfErr, @"F-Script Anywhere was unable to locate its component to install in the application.  Please try reinstalling F-Script Anywhere" },
+    { cfragDupRegistrationErr, @"another running copy of F-Script Anywhere is already installed in the application"},
+    { 0, nil }
+};
+
+NSMutableDictionary *FSA_errors;
+
+NSString * FSA_descriptionForOSStatus(OSStatus status)
+{
+    NSString *desc = nil;
+    
+    if (FSA_errors != nil)
+        desc = [FSA_errors objectForKey: [NSNumber numberWithLong: status]];
+    
+    if (desc != nil)
+        return desc;
+    
+    return [NSString stringWithFormat: @"an error of type %ld occurred", status];
+}
+
+
+@implementation FSAApp
+
++ (void)initialize;
+{
+    errRec *rec;
+
+    FSA_errors = [[NSMutableDictionary alloc] init];
+    for (rec = &(ERRS[0]) ; rec->status != 0 ; rec++)
+        [FSA_errors setObject: rec->desc forKey: [NSNumber numberWithLong: rec->status]];
+}
+
+- (void)finishLaunching
+{
+    // yes, someone could move the framework while the app is running, but they deserve what they get.
+    NSFileManager *fileMgr = [NSFileManager defaultManager];
+    NSArray *libraryDirectories =
+        NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSAllDomainsMask, TRUE);
+    NSEnumerator *e = [libraryDirectories objectEnumerator];
+    NSString *libPath;
+    NSString *frameworkPath;
+    BOOL isDirectory;
+    BOOL found = NO;
+
+    while ( (libPath = [e nextObject]) != nil) {
+        frameworkPath = [libPath stringByAppendingPathComponent: @"Frameworks"];
+        if ([fileMgr fileExistsAtPath: [frameworkPath stringByAppendingPathComponent: @"FScript.framework"]
+                          isDirectory: &isDirectory] && isDirectory) {
+            found = YES;
+        }
+    }
+    [super finishLaunching];
+    if (!found) {
+        int result = NSRunInformationalAlertPanel(@"F-Script Framework Not Found", @"F-Script Anywhere requires the F-Script framework be installed in a Frameworks directory, such as ~/Library/Frameworks or /Library/Frameworks.\n\nTo download F-Script, please visit its Web site %@.\n\nIf you believe this message is in error, click ÒContinueÓ.", @"Quit", @"Get F-Script", @"Continue", FSA_FScriptURL);
+        switch (result) {
+            case NSAlertOtherReturn:
+                break;
+            case NSAlertAlternateReturn:
+                [[NSWorkspace sharedWorkspace] openURL: [NSURL URLWithString: FSA_FScriptURL]];
+            case NSAlertDefaultReturn:
+            default:
+                [self terminate: self];
+                return;
+        }
+    }
+    [[PatchController sharedPatchController] setDelegate: self];
+    // In Jaguar 6C115, libPatch no longer delivers process death notifications to the application unless it registers for NSWorkspaceDidTerminateApplicationNotification.  (Process launch notifications are still received.)
+    [[[NSWorkspace sharedWorkspace] notificationCenter]
+        addObserver: self
+           selector: @selector(applicationDidTerminate:)
+               name: NSWorkspaceDidTerminateApplicationNotification
+             object: nil];
+}
+
+// This method causes the selected applications to quit, because the Objective-C runtime in Mac OS X does not support unloading of classes.
+- (void)unloadBundles:(id)sender
+{
+    UInt32	index,count;
+    NSArray	*pids;
+
+    
+    pids = [[PatchController sharedPatchController] processPIDsForPatchWithIdentifier:PatchBundleIdentifier];
+    count = [pids count];
+    for (index = 0 ; index < count ; index ++)
+    {
+        [[PatchController sharedPatchController] messagePatchForProcessWithPID:[[pids objectAtIndex:index] longValue]
+                                                                    identifier:PatchBundleIdentifier message:'bye ' data:NULL length:0];
+
+        [[PatchController sharedPatchController] unloadPatchForProcessWithPID:[[pids objectAtIndex:index] longValue]
+                                                                   identifier:PatchBundleIdentifier];
+    }
+
+}
+
+- (void)installBundleInAppWithPID:(pid_t)pid;
+{
+    OSStatus err;
+
+    if (pid == -1) return;
+
+    // XXX Switch to application first, resolves crash in Project Builder.
+    // XXX Fix window closing problem.
+    
+    err = [[PatchController sharedPatchController] loadPatchForProcessWithPID:pid identifier:PatchBundleIdentifier
+                                                                         path:[NSString stringWithFormat:@"%@/F-Script Anywhere",
+                                                                             [[NSBundle mainBundle] resourcePath]]
+                                                                     detached:NO];
+    if (err == noErr) {
+        [[PatchController sharedPatchController] messagePatchForProcessWithPID:pid identifier:PatchBundleIdentifier
+                                                                       message:'helo' data:NULL length:0];
+        [appList didPatchProcessID: pid];
+    }
+    else {
+        NSBeginAlertSheet(@"Installation failed", @"OK", nil, nil, appListPanel, self, nil, nil, nil,
+                          @"F-Script Anywhere was unable to install itself in the selected application (process ID %d), because %@.\n\nThe application may have crashed; restart it if needed.", pid, FSA_descriptionForOSStatus(err));
+    }
+}
+
+- (IBAction)installBundleInSelectedApp:(id)sender;
+{
+    [self installBundleInAppWithPID: [appList selectedProcessID]];
+}
+
+// from dock menu only!
+- (IBAction)installBundleInFrontmostApp:(id)sender;
+{
+    NSAssert1([sender tag] > 0, @"Unable to determine frontmost application from %@", sender);
+    [self installBundleInAppWithPID: (pid_t)[sender tag]];
+}
+
+@end
+
+@implementation FSAApp (NSWorkspaceNotifications)
+
+- (void)applicationDidTerminate:(NSNotification *)notification;
+{
+    NSDictionary *userInfo = [notification userInfo];
+    FSALog(@"Process terminated (pid %6d): %@\n",
+           [[userInfo objectForKey: @"NSApplicationProcessIdentifier"] intValue],
+           [userInfo objectForKey: @"NSApplicationName"]);
+    // Don't do anything here, this is a dummy method triggered by a NSWorkspaceDidTerminateApplicationNotification
+}
+
+@end
+
+@implementation FSAApp (PatchControllerDelegate)
+
+- (void) notifyProcessLaunch:(pid_t)pid info:(NSDictionary*)info
+{
+    [appList applicationLaunchedWithProcessID: pid];
+}
+
+// this delegate method is never invoked in Mac OS X 10.2 unless I register for NSWorkspaceDidTerminateApplicationNotification
+- (void) notifyProcessDeath:(pid_t)pid info:(NSDictionary*)info
+{
+    FSALog(@"Process exited (pid %6d): %@\n", pid, [info objectForKey: PatchControllerNameKey]);
+    [appList applicationQuitWithProcessID: pid];
+}
+
+@end
Index: releases/F-Script Anywhere/1.1.5/Source/FSAAppList.h
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/FSAAppList.h	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/FSAAppList.h	(revision 18)
@@ -0,0 +1,46 @@
+//
+//  FSAAppList.h
+//  F-Script Anywhere
+//
+//  Created by Nicholas Riley on Fri Feb 01 2002.
+//  Copyright (c) 2002 Nicholas Riley. All rights reserved.
+//
+
+/*
+
+ F-Script Anywhere is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ F-Script Anywhere is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with F-Script Anywhere; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+#import <Cocoa/Cocoa.h>
+
+@class DeVercruesseProcessManager;
+
+@interface FSAAppList : NSObject {
+    DeVercruesseProcessManager *processManager;
+    NSMutableArray *cocoaApps;
+    NSMutableDictionary *appsByPID;
+    NSMutableSet *patchedApps;
+    IBOutlet NSButton *installButton;
+    IBOutlet NSTableView *tableView;
+}
+
+- (pid_t)selectedProcessID;
+- (void)didPatchProcessID:(pid_t)pid;
+- (void)applicationLaunchedWithProcessID:(pid_t)pid;
+- (void)applicationQuitWithProcessID:(pid_t)pid;
+- (void)update;
+
+@end
Index: releases/F-Script Anywhere/1.1.5/Source/FSAAppList.m
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/FSAAppList.m	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/FSAAppList.m	(revision 18)
@@ -0,0 +1,410 @@
+//
+//  FSAAppList.m
+//  F-Script Anywhere
+//
+//  Created by Nicholas Riley on Fri Feb 01 2002.
+//  Copyright (c) 2002 Nicholas Riley. All rights reserved.
+//
+
+/*
+
+ F-Script Anywhere is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ F-Script Anywhere is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with F-Script Anywhere; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+#import "FSAnywhere.h"
+#import "FSAAppList.h"
+#import "FSAApp.h"
+#import "libMatch.h"
+#import "DeVercruesseProcessManager.h"
+#import "NJRLabeledImageCell.h"
+#import "NSTableView-NJRExtensions.h"
+
+// for appIsPEF:
+#import <Carbon/Carbon.h>
+#import <fcntl.h>
+#import <unistd.h>
+
+NSString * const FSATableColumnIdentifier_appNameAndIcon = @"appNameAndIcon";
+NSString * const FSATableColumnIdentifier_checkMark = @"checkMark";
+
+NSString *FSACheckMarkCharacter;
+NSImage *FSACheckMarkImage;
+
+static const char *FSACocoaFrameworks[] = {
+    "/System/Library/Frameworks/AppKit.framework",
+    "/System/Library/Frameworks/Foundation.framework",
+    "/System/Library/Frameworks/Cocoa.framework",
+    NULL
+};
+
+@implementation FSAAppList
+
++ (void)initialize;
+{
+    FSACheckMarkCharacter = [[NSString alloc] initWithCharacters: (const unichar *)"\x27\x13" length: 1];
+    FSACheckMarkImage = [NSImage imageNamed: @"NSMenuCheckmark"];
+    if (FSACheckMarkImage == nil) {
+        FSACheckMarkImage = [[NSImage alloc] initByReferencingFile: [[NSBundle mainBundle] pathForResource: @"Fallback checkmark" ofType: @"tiff"]];
+        if (FSACheckMarkImage != nil && ![FSACheckMarkImage isValid]) {
+            [FSACheckMarkImage release];
+            FSACheckMarkImage = nil;
+        }
+        FSALog(@"Falling back to checkmark image from bundle: %@", FSACheckMarkImage);
+    }
+}
+
+- (void)awakeFromNib;
+{
+    processManager = [DeVercruesseProcessManager defaultManager];
+    cocoaApps = [[NSMutableArray alloc] init];
+    patchedApps = [[NSMutableSet alloc] init];
+    appsByPID = [[NSMutableDictionary alloc] init];
+
+    [[tableView tableColumnWithIdentifier: FSATableColumnIdentifier_appNameAndIcon]
+        setDataCell: [NJRLabeledImageCell cell]];
+    if (FSACheckMarkImage != nil)
+        [[tableView tableColumnWithIdentifier: FSATableColumnIdentifier_checkMark]
+            setDataCell: [[[NSImageCell alloc] init] autorelease]];
+    [[tableView window] setResizeIncrements: NSMakeSize(1, [tableView cellHeight])];
+
+    [self update];
+    [[tableView window] makeFirstResponder: tableView];
+}
+
+- (void)dealloc;
+{
+    // don't release processManager, we don't own it
+    [cocoaApps release];
+    [patchedApps release];
+    [appsByPID release];
+    [super dealloc];
+}
+
+- (pid_t)selectedProcessID;
+{
+    int row = [tableView selectedRow];
+    if (row == -1) return -1;
+
+    return [[cocoaApps objectAtIndex: row] pid];
+}
+
+- (void)didPatchProcessID:(pid_t)pid;
+{
+    [patchedApps addObject: [appsByPID objectForKey: [NSNumber numberWithInt: pid]]];
+    [tableView reloadData];
+    [installButton setEnabled: NO];
+}
+
+- (BOOL)appIsPEF:(DeVercruesseProcess *)app;
+{
+    NSString *bundleExecutableLoc = [app executableLoc];
+    const char *bundleExecutablePath;
+    int fd;
+    PEFContainerHeader pefHeader;
+
+    if (bundleExecutableLoc == NULL)
+        return NO;
+    
+    if ( (bundleExecutablePath = [bundleExecutableLoc fileSystemRepresentation]) == NULL)
+	return NO;
+
+    if ( (fd = open(bundleExecutablePath, O_RDONLY, 0)) == -1)
+        return NO;
+
+    if (read(fd, &pefHeader, sizeof(pefHeader)) != sizeof(pefHeader))
+	return NO;
+    
+    if (pefHeader.tag1 != kPEFTag1 || pefHeader.tag2 != kPEFTag2)
+	return NO;
+
+    return YES;
+}
+
+- (BOOL)appIsCocoa:(DeVercruesseProcess *)app;
+{
+    NSString *bundleExecutableLoc = [app executableLoc];
+    if (bundleExecutableLoc == NULL)
+        return NO;
+    return appContainsLibMatching([bundleExecutableLoc fileSystemRepresentation], FSACocoaFrameworks);
+}
+
+- (void)addApp:(DeVercruesseProcess *)app;
+{
+    /* Try to determine if the application is a foreground Cocoa application.
+       In Jaguar, itÕs possible to mix Cocoa in a primarily Carbon application,
+       but we don't support such hybrids because the menu items we add depend
+       on Cocoa dispatch mechanisms.
+    
+       The CPS 'flavor' mechanism (isCarbon, isCocoa) is broken in Mac OS X
+       10.1.2 through 10.1.5 and possibly earlier, reporting that all Cocoa apps
+       are Carbon apps.  So we use some code extracted from otool to check
+       whether the application links to the Foundation, AppKit or Cocoa
+       frameworks.  This problem is fixed in Jaguar, except that certain CFM
+       Carbon apps are reported to be Cocoa apps (Drop Drawers is one example).
+       Conversely, the appIsCocoa: code works on _most_ applications, but
+       Jaguar always correctly identifies Cocoa apps as isCocoa.
+
+       So, our checks go like this:
+         Is the application background-only?
+         Is the application Cocoa or Carbon according to the CPS flavor?
+           If it's Cocoa, is it a CFM app?  If so, CPS is lying to us.
+           If it's "Carbon", does it link to AppKit, Foundation or Cocoa?
+             If so, it's really a Cocoa app.  If not, it's a Carbon app.
+    
+       Be careful not to call appIsCocoa: on a Classic application, you will
+       crash.
+    */
+
+    /*
+    if ([app isCocoa] || [app isCarbon]) {
+        NSLog(@"%@ |%@%@%@%@%@", [app name],
+              [app isBackgroundOnly] ? @" bgOnly" : @"",
+              [app isCocoa] ? @" isCocoa" : @"",
+              [app isCarbon] ? @" isCarbon" : @"",
+	      [self appIsPEF: app] ? @" appIsPEF" : @"",
+              [self appIsCocoa: app] ? @" appIsCocoa" : @"");
+    }
+    */
+          
+    if ( ![app isBackgroundOnly] &&
+	 ( ( [app isCocoa] && ![self appIsPEF: app]) ||
+	   ( [app isCarbon] && [self appIsCocoa: app]))) {
+        [cocoaApps addObject: app];
+    }
+    [appsByPID setObject: app forKey: [NSNumber numberWithInt: [app pid]]];
+}
+
+// XXX should insert/resort on launch too; this is harder because of synchronization issues
+
+- (void)update;
+{
+    NSEnumerator *e;
+    NSArray *allApps;
+    DeVercruesseProcess *app;
+
+    [cocoaApps removeAllObjects];
+    [appsByPID removeAllObjects];
+    // [processManager update]; // [processManager processes] sends update
+
+    allApps = [processManager processes];
+    e = [allApps objectEnumerator];
+
+    while ( (app = [e nextObject]) != nil) {
+        [self addApp: app];
+    }
+
+    [tableView noteNumberOfRowsChanged];
+    [tableView reloadData];
+    // XXX this is broken, it doesn't update properly
+    [self tableView: tableView shouldSelectRow: [tableView selectedRow]];
+}
+
+- (void)applicationLaunchedWithProcessID:(pid_t)pid;
+{
+    NSNumber *pidNum = [NSNumber numberWithInt: pid];
+    DeVercruesseProcess *app = [appsByPID objectForKey: pidNum];
+
+    if (app == nil) {
+        [self update];
+    }
+}
+
+- (void)applicationQuitWithProcessID:(pid_t)pid;
+{
+    NSNumber *pidNum = [NSNumber numberWithInt: pid];
+    DeVercruesseProcess *app = [appsByPID objectForKey: pidNum];
+
+    if (app != nil) {
+        [cocoaApps removeObject: app];
+        [appsByPID removeObjectForKey: pidNum];
+        [patchedApps removeObject: app];
+    }
+
+    [tableView reloadData];
+}
+
+@end
+
+@implementation FSAAppList (NSTableViewDelegate)
+
+- (void)tableView:(NSTableView *)tableView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn row:(int)row;
+{
+    if ([[tableColumn identifier] isEqualToString: FSATableColumnIdentifier_appNameAndIcon]) {
+        DeVercruesseProcess *app = [cocoaApps objectAtIndex: row];
+
+        NSAssert1([cell isKindOfClass: [NJRLabeledImageCell class]], @"Cell is not what we expected, instead %@", cell);
+        [(NJRLabeledImageCell *)cell setImage: [app img]];
+        [(NJRLabeledImageCell *)cell setImageCacheSource: app];
+    }
+}
+
+- (BOOL)tableView:(NSTableView *)tableView shouldSelectRow:(int)row;
+{
+    BOOL canInstall = NO;
+
+    if (row != -1) {
+        canInstall = ![patchedApps containsObject: [cocoaApps objectAtIndex: row]];
+    }
+
+    [installButton setEnabled: canInstall];
+    
+    return YES;
+}
+
+@end
+
+@implementation FSAAppList (NSTableDataSource)
+
+- (int)numberOfRowsInTableView:(NSTableView *)aTableView
+{
+    return [cocoaApps count];
+}
+
+- (id)tableView:(NSTableView *)aTableView
+    objectValueForTableColumn:(NSTableColumn *)aTableColumn
+    row:(int)rowIndex
+{
+    NSString *columnIdentifier = [aTableColumn identifier];
+    
+    if ([columnIdentifier isEqualToString: FSATableColumnIdentifier_appNameAndIcon]) {
+        return [(DeVercruesseProcess *)[cocoaApps objectAtIndex: rowIndex] name];
+    } else if ([columnIdentifier isEqualToString: FSATableColumnIdentifier_checkMark]) {
+        BOOL isPatched = [patchedApps containsObject: [cocoaApps objectAtIndex: rowIndex]];
+        if (FSACheckMarkImage == nil)
+            return isPatched ? FSACheckMarkCharacter : @"";
+        else
+            return isPatched ? FSACheckMarkImage : nil;
+    }
+    return nil;
+}
+
+@end
+
+@implementation FSAAppList (NSWindowDelegate)
+
+- (NSRect)windowWillUseStandardFrame:(NSWindow *)sender defaultFrame:(NSRect)defaultFrame;
+{
+    NSWindow *window = [tableView window];
+    NSRect frame = [window frame];
+    NSScrollView *scrollView = [tableView enclosingScrollView];
+    float displayedHeight = [[scrollView contentView] bounds].size.height;
+    float heightChange = [[scrollView documentView] bounds].size.height - displayedHeight;
+    float heightExcess;
+
+    if (heightChange >= 0 && heightChange <= 1) {
+        // either the window is already optimal size, or it's too big
+        float rowHeight = [tableView cellHeight];
+        heightChange = (rowHeight * [tableView numberOfRows]) - displayedHeight;
+    }
+
+    frame.size.height += heightChange;
+
+    if ( (heightExcess = [window minSize].height - frame.size.height) > 1 ||
+         (heightExcess = [window maxSize].height - frame.size.height) < 1) {
+        heightChange += heightExcess;
+        frame.size.height += heightExcess;
+    }
+
+    frame.origin.y -= heightChange;
+
+    return frame;
+}
+
+- (BOOL)windowShouldClose:(id)sender;
+{
+    if ([patchedApps count] != 0) {
+        NSMutableString *message =  [@"F-Script Anywhere is installed in the following applications:\n\n" mutableCopy];
+        NSEnumerator *e = [patchedApps objectEnumerator];
+        DeVercruesseProcess *app;
+        int retval;
+
+        while ( (app = [e nextObject]) != nil) {
+            [message appendFormat: @"    ¥ %@\n", [app name]];
+        }
+
+        [message appendString: @"\nIf F-Script Anywhere quits now, these applications will be forced to quit, and any changes you have made in them will be lost.\n\nPlease quit these applications before quitting F-Script Anywhere, or click Force Quit to continue."];
+
+        retval = NSRunAlertPanel(@"Force applications to quit?", message, @"DonÕt Quit", @"Force Quit", nil);
+        if (retval != NSAlertAlternateReturn) {
+            return NO;
+        }
+
+        [(FSAApp *)NSApp unloadBundles: self];
+    }
+
+    return YES;
+}
+
+@end
+
+@implementation FSAAppList (NSApplicationDelegate)
+
+- (NSMenu *)applicationDockMenu:(NSApplication *)sender;
+{
+    static NSMenu *dockMenu = nil;
+    NSMenuItem *menuItem;
+    DeVercruesseProcess *frontApp = [processManager frontProcess];
+    NSString *appName = [frontApp name];
+    NSString *status = nil;
+    // XXX workaround for broken dock menu sender
+    NSMethodSignature *sig = [NSApp methodSignatureForSelector: @selector(installBundleInFrontmostApp:)];
+    NSInvocation *inv;
+
+    if (dockMenu != nil) {
+        // XXX release invocation
+        [[[dockMenu itemAtIndex: 0] target] release];
+        [dockMenu removeItemAtIndex: 0];
+    } else {
+        dockMenu = [[NSMenu alloc] init];
+    }
+
+    NSAssert(frontApp != nil && appName != nil, @"CanÕt obtain information on the frontmost application");
+
+    if ([patchedApps containsObject: frontApp]) {
+        status = [NSString stringWithFormat: @"Installed in Ò%@Ó", appName];
+    } else if (![cocoaApps containsObject: frontApp]) {
+        status = [NSString stringWithFormat: @"CanÕt install because Ò%@Ó is not a Cocoa application", appName];
+    }
+
+    if (status == nil) {
+        menuItem = [dockMenu addItemWithTitle: [NSString stringWithFormat: @"Install in Ò%@Ó", appName]
+                                       action: @selector(invoke)
+                                keyEquivalent: @""];
+        inv = [NSInvocation invocationWithMethodSignature: sig];
+        [inv setSelector: @selector(installBundleInFrontmostApp:)];
+        [inv setTarget: NSApp];
+        [inv setArgument: &menuItem atIndex: 2];
+        [menuItem setTag: [frontApp pid]];
+        [menuItem setTarget: [inv retain]];
+    } else {
+        menuItem = [dockMenu addItemWithTitle: status action: nil keyEquivalent: @""];
+        [menuItem setEnabled: NO];
+    }
+
+    return dockMenu;
+}
+
+- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender;
+{
+    return YES;
+}
+
+- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender;
+{
+    return ([self windowShouldClose: self] ? NSTerminateNow : NSTerminateCancel);
+}
+
+@end
Index: releases/F-Script Anywhere/1.1.5/Source/FSABundle.m
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/FSABundle.m	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/FSABundle.m	(revision 18)
@@ -0,0 +1,49 @@
+//
+//  FSABundle.m
+//  F-Script Anywhere
+//
+//  Created by Nicholas Riley on Fri Feb 01 2002.
+//  Copyright (c) 2002 Nicholas Riley. All rights reserved.
+//
+
+/*
+
+ F-Script Anywhere is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ F-Script Anywhere is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with F-Script Anywhere; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+#include <unistd.h>
+#include <Patch.h>
+#import "FSAnywhere.h"
+
+OSStatus PatchInitialize(PatchInitPB *pb)
+{
+    FSALog(@"FSABundle id %s initialized: ppid %d, pid %d\n", pb->identifier, pb->parent, getpid());
+    return noErr;
+}
+
+// Objective-C bundles can't be unloaded, so we don't even try.
+
+OSStatus PatchTerminate(void)
+{
+    FSALog(@"FSABundle terminated\n");
+    return noErr;
+}
+
+OSStatus PatchMessage(UInt32 message, void *data, UInt32 length)
+{
+    FSALog(@"FSABundle received message '%.4s' with data %08lX (length %ld)\n", (char*)&message, (UInt32)data, length);
+    return noErr;
+}
Index: releases/F-Script Anywhere/1.1.5/Source/FSAController.h
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/FSAController.h	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/FSAController.h	(revision 18)
@@ -0,0 +1,45 @@
+//
+//  FSAController.h
+//  F-Script Anywhere
+//
+//  Created by Nicholas Riley on Fri Feb 01 2002.
+//  Copyright (c) 2002 Nicholas Riley. All rights reserved.
+//
+
+/*
+
+ F-Script Anywhere is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ F-Script Anywhere is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with F-Script Anywhere; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+#import <AppKit/AppKit.h>
+#import <FScript/FSInterpreterView.h>
+#import <FScript/System.h>
+
+@class FSAViewAssociationController;
+
+@interface FSAController : NSWindowController {
+    IBOutlet FSInterpreterView *interpreterView;
+    System *system;
+    FSAViewAssociationController *viewAssociationController;
+}
+
+- (IBAction)setFloating:(id)sender;
+- (IBAction)FSA_associateWithInterface:(id)sender;
+
+- (FSInterpreterView *)interpreterView;
+- (System *)system;
+
+@end
Index: releases/F-Script Anywhere/1.1.5/Source/FSAController.m
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/FSAController.m	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/FSAController.m	(revision 18)
@@ -0,0 +1,205 @@
+//
+//  FSAController.m
+//  F-Script Anywhere
+//
+//  Created by Nicholas Riley on Fri Feb 01 2002.
+//  Copyright (c) 2002 Nicholas Riley. All rights reserved.
+//
+
+/*
+
+ F-Script Anywhere is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ F-Script Anywhere is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with F-Script Anywhere; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+#import "FSAController.h"
+#import "FSAViewAssociationController.h"
+#import "FSAnywhere.h"
+#import <FScript/FSInterpreter.h>
+
+@class ShellView;
+
+// XXX workaround for lack of focus on FSInterpreterView
+@interface CLIView : NSView
+- (ShellView *)shellView;
+@end
+
+@interface FSInterpreterView (FSAWorkaround)
+- (CLIView *)cliView;
+@end
+
+@implementation FSAController
+
+// derived from TETextWatcher.m in Mike Ferris's TextExtras
++ (void)installMenu;
+{
+    static BOOL alreadyInstalled = NO;
+    NSMenu *mainMenu = nil;
+    
+    if (!alreadyInstalled && ((mainMenu = [NSApp mainMenu]) != nil)) {
+        NSMenu *insertIntoMenu = nil;
+        NSMenuItem *item;
+        unsigned insertLoc = NSNotFound;
+        NSBundle *bundle = [NSBundle bundleForClass:self];
+        NSMenu * beforeSubmenu = [NSApp windowsMenu];
+        // Succeed or fail, we do not try again.
+        alreadyInstalled = YES;
+
+        // Add it to the main menu.  We try to put it right before the Windows menu if there is one, or right before the Services menu if there is one, and if there's neither we put it right before the the last submenu item (ie above Quit and Hide on Mach, at the end on Windows.)
+
+        if (!beforeSubmenu) {
+            beforeSubmenu = [NSApp servicesMenu];
+        }
+
+        insertIntoMenu = mainMenu;
+
+        if (beforeSubmenu) {
+            NSArray *itemArray = [insertIntoMenu itemArray];
+            unsigned i, c = [itemArray count];
+
+            // Default to end of menu
+            insertLoc = c;
+
+            for (i=0; i<c; i++) {
+                if ([[itemArray objectAtIndex:i] target] == beforeSubmenu) {
+                    insertLoc = i;
+                    break;
+                }
+            }
+        } else {
+            NSArray *itemArray = [insertIntoMenu itemArray];
+            unsigned i = [itemArray count];
+
+            // Default to end of menu
+            insertLoc = i;
+
+            while (i-- > 0) {
+                if ([[itemArray objectAtIndex:i] hasSubmenu]) {
+                    insertLoc = i+1;
+                    break;
+                }
+            }
+        }
+        if (insertIntoMenu) {
+            NSMenu *fsaMenu = [[NSMenu allocWithZone: [NSMenu menuZone]] initWithTitle:NSLocalizedStringFromTableInBundle(@"FSA", @"FSA", bundle, @"Title of F-Script Anywhere menu")];
+
+            item = [insertIntoMenu insertItemWithTitle: NSLocalizedStringFromTableInBundle(@"FSA", @"FSA", bundle, @"Title of F-Script Anywhere menu") action:NULL keyEquivalent:@"" atIndex:insertLoc];
+            [insertIntoMenu setSubmenu:fsaMenu forItem:item];
+            [fsaMenu release];
+
+            // Add the items for the commands.
+            item = [fsaMenu addItemWithTitle: NSLocalizedStringFromTableInBundle(@"New F-Script Workspace", @"FSA", bundle, @"Title of F-Script Workspace menu item") action:@selector(createInterpreterWindow:) keyEquivalent: @""];
+            [item setTarget: self];
+            [fsaMenu addItemWithTitle: NSLocalizedStringFromTableInBundle(@"Associate With Interface", @"FSA", bundle, @"Title of Associate with Interface menu item") action: @selector(FSA_associateWithInterface:) keyEquivalent: @""];
+            [fsaMenu addItem: [NSMenuItem separatorItem]];
+            item = [fsaMenu addItemWithTitle: NSLocalizedStringFromTableInBundle(@"About F-Script AnywhereÉ", @"FSA", bundle, @"Title of Info Panel menu item") action:@selector(showInfo:) keyEquivalent: @""];
+            [item setTarget: self];
+        }
+    }
+
+}
+
++ (BOOL)validateMenuItem:(id <NSMenuItem>)menuItem
+{
+    SEL sel;
+    NSAssert([menuItem target] == self, @"menu item does not target FSAController!");
+    sel = [menuItem action];
+    if (sel == @selector(showInfo:) || sel == @selector(createInterpreterWindow:)) return YES;
+    FSALog(@"-[FSAController validateMenuItem:] unknown menu item for validation: %@", menuItem);
+    return NO;
+}
+
++ (void)createInterpreterWindow:(id)sender;
+{
+    [[self alloc] init];
+}
+
++ (void)showInfo:(id)sender;
+{
+    int result = NSRunInformationalAlertPanel(@"About F-Script Anywhere", @"F-Script Anywhere lets you embed a F-Script interpreter in a Cocoa application while it is running.\n\nF-Script Anywhere is currently installed in this application.  To remove it, quit this application.\n\nFor more information about F-Script, please visit its Web site %@.", @"OK", @"Visit Web Site", nil, FSA_FScriptURL);
+    if (result == NSAlertAlternateReturn) {
+        [[NSWorkspace sharedWorkspace] openURL: [NSURL URLWithString: FSA_FScriptURL]];
+    }
+}
+
++ (void)load;
+{
+    [self installMenu];
+}
+
+- (id)init {
+    self = [super initWithWindowNibName: @"FSAInterpreterPanel"];
+
+    if (self != nil) {
+        NSString *appName = nil;
+        NSWindow *window = [self window];
+
+        NSAssert(window != nil, @"Can't get interpreter window!");
+        NS_DURING
+            appName = [[[NSBundle mainBundle] infoDictionary] objectForKey: @"CFBundleName"];
+        NS_HANDLER
+            FSALog(@"Exception occurred while trying to obtain application name: %@", localException);
+        NS_ENDHANDLER
+        if (appName != nil) {
+            [window setTitle: [NSString stringWithFormat: @"%@: %@", [window title], appName]];
+        }
+
+        [window setLevel: NSNormalWindowLevel]; // XXX if set floating, it is globally floating!
+        [self showWindow: self];
+        [window makeKeyAndOrderFront: self];
+#warning this should go away when F-Script properly accepts firstResponder on the InterpreterView
+        [window makeFirstResponder: (NSView *)[[[self interpreterView] cliView] shellView]];
+        system = [[[self interpreterView] interpreter] objectForIdentifier: @"sys" found: NULL];
+        [system retain];
+        NSAssert1([system isKindOfClass: [System class]], @"Initial value bound to identifier 'sys' is not a System object, but %@", system);
+    }
+    
+    return self;
+}
+
+- (void)dealloc;
+{
+    [system release];
+    [super dealloc];
+}
+
+- (FSInterpreterView *)interpreterView;
+{
+    return interpreterView;
+}
+
+- (System *)system;
+{
+    return system;
+}
+
+- (IBAction)setFloating:(id)sender;
+{
+    [[self window] setLevel: [sender state] == NSOnState ? NSFloatingWindowLevel : NSNormalWindowLevel];
+}
+
+- (IBAction)FSA_associateWithInterface:(id)sender;
+{
+    NS_DURING
+        if (viewAssociationController == nil) {
+            viewAssociationController = [[FSAViewAssociationController alloc] initWithFSAController: self];
+        }
+        [viewAssociationController showWindow: self];
+    NS_HANDLER
+        FSALog(@"%@", localException);
+    NS_ENDHANDLER
+}
+
+@end
Index: releases/F-Script Anywhere/1.1.5/Source/FSAViewAssociationController.h
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/FSAViewAssociationController.h	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/FSAViewAssociationController.h	(revision 18)
@@ -0,0 +1,53 @@
+//
+//  FSAViewAssociationController.h
+//  F-Script Anywhere
+//
+//  Created by Nicholas Riley on Wed Jul 17 2002.
+//  Copyright (c) 2002 Nicholas Riley. All rights reserved.
+//
+
+/*
+
+ F-Script Anywhere is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ F-Script Anywhere is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with F-Script Anywhere; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+#import <Cocoa/Cocoa.h>
+
+@class FSInterpreter, System;
+@class FSAController;
+
+@interface FSAViewAssociationController : NSWindowController
+{
+    IBOutlet NSButton *captureButton;
+    IBOutlet NSButton *browseButton;
+    IBOutlet NSButton *associateButton;
+    IBOutlet NSTextField *descriptionField;
+    IBOutlet NSTextField *variableNameField;
+    IBOutlet NSTextField *statusField;
+    NSView *selectedView;
+    NSMenu *viewHierarchyMenu;
+    FSInterpreter *interpreter;
+    System *system;
+}
+
+- (id)initWithFSAController:(FSAController *)fsa;
+
+- (IBAction)update:(id)sender;
+- (IBAction)captureView:(id)sender;
+- (IBAction)defineVariable:(id)sender;
+- (IBAction)viewInObjectBrowser:(id)sender;
+
+@end
Index: releases/F-Script Anywhere/1.1.5/Source/FSAViewAssociationController.m
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/FSAViewAssociationController.m	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/FSAViewAssociationController.m	(revision 18)
@@ -0,0 +1,199 @@
+//
+//  FSAViewAssociationController.m
+//  F-Script Anywhere
+//
+//  Created by Nicholas Riley on Wed Jul 17 2002.
+//  Copyright (c) 2002 Nicholas Riley. All rights reserved.
+//
+
+/*
+
+ F-Script Anywhere is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ F-Script Anywhere is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with F-Script Anywhere; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+#import "FSAViewAssociationController.h"
+#import "FSAController.h"
+#import "FSAnywhere.h"
+#import <FScript/FSInterpreter.h>
+#import <FScript/System.h>
+
+// XXX workaround for lack of identifier validation; should go away when F-Script adds (promised) direct support for this
+@interface Compiler
++ (BOOL)isValidIndentifier:(NSString *)str;
+@end
+
+@implementation FSAViewAssociationController
+
+- (id)initWithFSAController:(FSAController *)fsa;
+{
+    self = [super initWithWindowNibName: @"FSAViewAssociationPanel"];
+
+    if (self != nil) {
+        interpreter = [[[fsa interpreterView] interpreter] retain];
+        system = [fsa system];
+        [self window];
+        [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(controlTextDidChange:) name: NSControlTextDidChangeNotification object: variableNameField];
+        [[captureButton cell] setShowsStateBy: NSContentsCellMask | NSChangeGrayCellMask];
+        [self update: nil];
+    }
+    return self;
+}
+
+- (void)dealloc;
+{
+    [viewHierarchyMenu release];
+    [selectedView release];
+    [interpreter release];
+    [[NSNotificationCenter defaultCenter] removeObserver: self];
+    [super dealloc];
+}
+
+- (IBAction)update:(id)sender;
+{
+    NSString *variableName = [variableNameField stringValue];
+    BOOL canAssignToVariable = NO;
+    [browseButton setEnabled: selectedView != nil];
+    [statusField setStringValue: @""];
+    if ([variableName length] != 0) {
+        if (![Compiler isValidIndentifier: variableName]) {
+            [statusField setStringValue: @"Invalid name: contains spaces, punctuation or non-ASCII characters"];
+        } else if (selectedView != nil) {
+            [statusField setStringValue: @"Click ÒAssociateÓ to assign to this variable"];
+            canAssignToVariable = YES;
+        }
+    }
+    [associateButton setEnabled: canAssignToVariable];
+    [variableNameField setEnabled: [captureButton state] == NSOffState];
+}
+
+- (void)stopCapturing;
+{
+    FSALog(@"stopping capture");
+    [captureButton setState: NSOffState];
+    [statusField setStringValue: @""];
+    [self update: nil];
+    [variableNameField becomeFirstResponder];
+}
+
+- (void)_addElementToMenu:(id)element;
+{
+    NSMenuItem *item;
+    if (element == nil) return;
+    item = [viewHierarchyMenu addItemWithTitle: [@"  "
+                stringByAppendingString: NSStringFromClass([element class])]
+                                        action: @selector(elementSelected:)
+                                 keyEquivalent: @""];
+    [item setTarget: self];
+    [item setRepresentedObject: element];
+}
+
+- (void)captureOneView;
+{
+    NSEvent *event;
+    NSView *view, *superView = nil, *contentView;
+    NSWindow *eventWindow;
+
+    FSALog(@"capturing one");
+    [captureButton setState: NSOnState];
+
+    event = [NSApp nextEventMatchingMask: NSLeftMouseDownMask | NSRightMouseDownMask | NSKeyUpMask
+                               untilDate: [NSDate distantFuture]
+                                  inMode: NSEventTrackingRunLoopMode
+                                 dequeue: YES];
+    if ([event type] == NSKeyUp) {
+        [self stopCapturing];
+        return;
+    }
+    [viewHierarchyMenu release]; viewHierarchyMenu = nil;
+    viewHierarchyMenu = [[NSMenu alloc] initWithTitle: @""];
+    NS_DURING
+        eventWindow = [event window];
+        contentView = [eventWindow contentView];
+        view = [[contentView superview] hitTest: [event locationInWindow]];
+        if (view == captureButton) {
+            [self stopCapturing];
+            NS_VOIDRETURN;
+        }
+        [viewHierarchyMenu addItemWithTitle: @"View" action: nil keyEquivalent: @""];
+        [self _addElementToMenu: view];
+        superView = view;
+        do {
+            superView = [superView superview];
+            if (superView == nil) break;
+            [self _addElementToMenu: superView];
+        } while (superView != contentView);
+        [viewHierarchyMenu addItem: [NSMenuItem separatorItem]];
+        [viewHierarchyMenu addItemWithTitle: @"Window" action: nil keyEquivalent: @""];
+        [self _addElementToMenu: eventWindow];
+    NS_HANDLER
+        [descriptionField setStringValue:
+            [NSString stringWithFormat: @"Çan exception occurred: %@È", localException]];
+    NS_ENDHANDLER
+    [NSMenu popUpContextMenu: viewHierarchyMenu withEvent: event forView: view];
+    if ([captureButton state] == NSOnState)
+        [self captureOneView];
+}
+
+- (IBAction)captureView:(id)sender
+{
+    [statusField setStringValue: @"Click inside one of this applicationÕs windows to select."];
+    [selectedView release]; selectedView = nil;
+    [self update: nil];
+    [self captureOneView];
+}
+
+- (void)elementSelected:(NSMenuItem *)sender;
+{
+    NSView *element = [sender representedObject];
+    FSALog(@"element selected: %@", sender);
+    NS_DURING
+        [descriptionField setStringValue: [element description]];
+        [selectedView release];
+        selectedView = [element retain];
+    NS_HANDLER
+        [descriptionField setStringValue:
+            [NSString stringWithFormat: @"Çan exception occurred: %@È", localException]];
+    NS_ENDHANDLER
+    [viewHierarchyMenu release]; viewHierarchyMenu = nil;
+    [self captureOneView];
+}
+
+- (IBAction)defineVariable:(id)sender;
+{
+#warning this should change when F-Script supports a public API for identifier validation
+    NS_DURING
+        NSString *variableName = [variableNameField stringValue];
+        [statusField setStringValue: @"AssociatingÉ"];
+        [interpreter setObject: selectedView forIdentifier: variableName];
+        [statusField setStringValue: [NSString stringWithFormat: @"Assigned variable Ò%@Ó", variableName]];
+    NS_HANDLER
+        [statusField setStringValue: [NSString stringWithFormat: @"Assocation failed: %@", localException]];
+    NS_ENDHANDLER
+}
+
+- (IBAction)viewInObjectBrowser:(id)sender;
+{
+    FSALog(@"system: %@", system);
+    [system browse: selectedView];
+    [statusField setStringValue: @"Opened object browser"];
+}
+
+- (void)controlTextDidChange:(NSNotification *)notification;
+{
+    [self update: nil];
+}
+
+@end
Index: releases/F-Script Anywhere/1.1.5/Source/FSAWindowManager.h
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/FSAWindowManager.h	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/FSAWindowManager.h	(revision 18)
@@ -0,0 +1,25 @@
+//
+//  FSAWindowManager.h
+//  F-Script Anywhere
+//
+//  Created by Nicholas Riley on Mon Sep 30 2002.
+//  Copyright (c) 2002 Nicholas Riley. All rights reserved.
+//
+
+#import <AppKit/AppKit.h>
+
+@interface FSAWindowManager : NSObject {
+    NSMenu *menu;
+    NSMutableDictionary *records;
+    NSMenuItem *separator, *label;
+}
+
++ (FSAWindowManager *)sharedManager;
+
+- (void)setWindowMenu:(NSMenu *)windowMenu;
+
+- (void)registerWindow:(NSWindow *)window;
+- (void)registerSubordinateWindow:(NSWindow *)subWindow forWindow:(NSWindow *)window;
+- (BOOL)windowIsRegistered:(NSWindow *)window;
+
+@end
Index: releases/F-Script Anywhere/1.1.5/Source/FSAWindowManager.m
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/FSAWindowManager.m	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/FSAWindowManager.m	(revision 18)
@@ -0,0 +1,271 @@
+//
+//  FSAWindowManager.m
+//  F-Script Anywhere
+//
+//  Created by Nicholas Riley on Mon Sep 30 2002.
+//  Copyright (c) 2002 Nicholas Riley. All rights reserved.
+//
+
+#import "FSAWindowManager.h"
+#import "FSAnywhere.h"
+
+@interface FSAWindowRecord:NSObject
+{
+    unsigned level;
+    NSWindow *window;
+    BOOL windowClosed;
+    FSAWindowRecord *parent;
+    NSMutableArray *subordinates;
+    NSMenuItem *menuItem;
+}
+- (id)initWithWindow:(NSWindow *)aWindow parent:(FSAWindowRecord *)aRecord;
+- (void)addSubordinate:(FSAWindowRecord *)aRecord;
+- (void)removeSubordinate:(FSAWindowRecord *)aRecord;
+- (BOOL)hasSubordinates;
+- (unsigned)level;
+- (NSString *)levelPaddedTitle;
+- (NSMenuItem *)menuItem;
+- (NSWindow *)window;
+@end
+
+@implementation FSAWindowRecord
+
+- (id)initWithWindow:(NSWindow *)aWindow parent:(FSAWindowRecord *)aRecord;
+{
+    if ( (self = [super init]) != nil) {
+        NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
+        window = [aWindow retain];
+        [nc addObserver: self selector: @selector(windowWillClose:)
+                   name: NSWindowWillCloseNotification object: window];
+        [nc addObserver: self selector: @selector(windowDidBecomeKey:)
+                   name: NSWindowDidBecomeKeyNotification object: window];
+        [nc addObserver: self selector: @selector(windowDidResignKey:)
+                   name: NSWindowDidResignKeyNotification object: window];
+        if (aRecord == nil) {
+            level = 1;
+        } else {
+            parent = aRecord; // note: not retaining parent
+            [parent addSubordinate: self];
+            level = [parent level] + 1;
+        }
+        [self retain]; // manage own object lifetime, tie to window lifetime
+    }
+    return self;
+}
+
+- (void)dealloc;
+{
+    [[NSNotificationCenter defaultCenter] removeObserver: self];
+    [[menuItem menu] removeItem: menuItem];
+    [menuItem release]; menuItem = nil;
+    [window release]; window = nil;
+    parent = nil;
+    NSAssert1(![self hasSubordinates], @"Window still has subordinates at dealloc: %@", self);
+    [subordinates release]; subordinates = nil;
+    // XXX still get this from time to time, canÕt reproduce reliably... please let me know if you can!
+    NSAssert1(windowClosed, @"Window hasn't closed at dealloc: %@", self);
+    [super dealloc];
+}
+
+- (unsigned)level;
+{
+    return level;
+}
+
+- (NSWindow *)window;
+{
+    return window;
+}
+
+- (void)addSubordinate:(FSAWindowRecord *)aRecord;
+{
+    if (subordinates == nil)
+        subordinates = [[NSMutableArray alloc] init];
+    NSAssert(![subordinates containsObject: aRecord], @"subordinate already exists");
+    [subordinates addObject: aRecord];
+}
+
+- (BOOL)hasSubordinates;
+{
+    return (subordinates != nil && [subordinates count] > 0);
+}
+
+- (void)removeSubordinate:(FSAWindowRecord *)aRecord;
+{
+    NSAssert(subordinates != nil && [subordinates containsObject: aRecord], @"subordinate does not exist");
+    [subordinates removeObject: aRecord];
+    if ([subordinates count] == 0 && windowClosed)
+        [self release];
+}
+
+- (NSString *)levelPaddedTitle;
+{
+    NSString *windowTitle = [window title];
+    NSMutableString *paddedTitle = [[NSMutableString alloc] initWithCapacity: [windowTitle length] + 3 * level + 2 * windowClosed];
+    unsigned i;
+    for (i = 0 ; i < level ; i++) {
+        [paddedTitle appendString: @"   "];
+    }
+    if (windowClosed) [paddedTitle appendString: @"("];
+    [paddedTitle appendString: windowTitle];
+    if (windowClosed) [paddedTitle appendString: @")"];
+    return [paddedTitle autorelease];
+}
+
+- (NSMenuItem *)menuItem;
+{
+    if (menuItem == nil) {
+        menuItem = [[NSMenuItem alloc] initWithTitle: [self levelPaddedTitle]
+                                              action: @selector(makeKeyAndOrderFront:)
+                                       keyEquivalent: @""];
+        [menuItem setTarget: window];
+        [menuItem setRepresentedObject: window];
+        [menuItem setState: NSOnState];
+    }
+    return menuItem;
+}
+
+- (NSString *)description;
+{
+    return [NSString stringWithFormat: @"%@ [L%u] for %@%@ subs %u%@%@", [super description], level, window, windowClosed ? @" (closed)" : @"", [subordinates count], menuItem == nil ? @"" : [NSString stringWithFormat: @" item %@", menuItem], parent == nil ? @"" : [NSString stringWithFormat: @"\n  parent: %@", parent]];
+}
+
+@end
+
+@implementation FSAWindowRecord (NSWindowNotifications)
+
+- (void)windowWillClose:(NSNotification *)notification;
+{
+    windowClosed = YES;
+
+    [parent removeSubordinate: self];
+
+    FSALog(@"windowWillClose (rc %u): %@", [self retainCount], notification);
+    if ([self hasSubordinates]) {
+        [menuItem setTitle: [self levelPaddedTitle]];
+    } else {
+        [self release];
+    }
+}
+
+- (void)windowDidBecomeKey:(NSNotification *)notification;
+{
+    if (windowClosed) {
+        windowClosed = NO;
+        [menuItem setTitle: [self levelPaddedTitle]];
+        [parent addSubordinate: self];
+    }
+    [menuItem setState: NSOnState];
+}
+
+- (void)windowDidResignKey:(NSNotification *)notification;
+{
+    [menuItem setState: NSOffState];
+}
+
+@end
+
+static FSAWindowManager *FSASharedWindowManager;
+
+@implementation FSAWindowManager
+
++ (FSAWindowManager *)sharedManager;
+{
+    if (FSASharedWindowManager == nil) {
+        FSASharedWindowManager = [[self alloc] init];
+    }
+    return FSASharedWindowManager;
+}
+
+- (id)init;
+{
+    if ( (self = [super init]) != nil) {
+        if (FSASharedWindowManager != nil) {
+            [self release];
+            self = nil;
+        } else {
+            records = [[NSMutableDictionary alloc] init];
+        }
+    }
+    return self;
+}
+
+- (void)setWindowMenu:(NSMenu *)windowMenu;
+{
+    menu = [windowMenu retain];
+}
+
+- (FSAWindowRecord *)recordForWindow:(NSWindow *)window;
+{
+    FSAWindowRecord *record = [records objectForKey: [NSValue valueWithNonretainedObject: window]];
+    NSAssert1(record != nil, @"no record for window %@", window);
+    return record;
+}
+
+- (void)addRecord:(FSAWindowRecord *)aRecord;
+{
+    NSWindow *window = [aRecord window];
+    NSValue *wValue = [NSValue valueWithNonretainedObject: window];
+    [[NSNotificationCenter defaultCenter]
+        addObserver: self selector: @selector(windowWillClose:)
+               name: NSWindowWillCloseNotification object: window];
+    NSAssert1(![self windowIsRegistered: window], @"Window already registered: %@", window);
+    [records setObject: aRecord forKey: wValue];
+    if ([records count] == 1) {
+        separator = [NSMenuItem separatorItem];
+        [menu addItem: separator];
+        label = [menu addItemWithTitle: @"Windows" action: NULL keyEquivalent: @""];
+    }
+    FSALog(@"Registered:\n%@", aRecord);
+}
+
+- (void)registerWindow:(NSWindow *)window;
+{
+    FSAWindowRecord *record = [[FSAWindowRecord alloc] initWithWindow: window parent: nil];
+    [self addRecord: record];
+    [menu addItem: [record menuItem]];
+    [record release];
+}
+
+- (void)registerSubordinateWindow:(NSWindow *)subWindow forWindow:(NSWindow *)window;
+{
+    FSAWindowRecord *record = [[FSAWindowRecord alloc] initWithWindow: subWindow parent:
+        [self recordForWindow: window]];
+    int itemIndex = [menu indexOfItemWithRepresentedObject: window];
+
+    NSAssert1(itemIndex != -1, @"CanÕt get menu item for window %@", window);
+    [self addRecord: record];
+    [menu insertItem: [record menuItem] atIndex: itemIndex + 1];
+    [record release];
+}
+
+- (BOOL)windowIsRegistered:(NSWindow *)window;
+{
+    return [records objectForKey: [NSValue valueWithNonretainedObject: window]] != nil;
+}
+
+@end
+
+@interface FSAWindowManager (Private)
+- (FSAWindowRecord *)recordForWindow:(NSWindow *)window;
+@end
+
+@implementation FSAWindowManager (NSWindowNotifications)
+
+- (void)windowWillClose:(NSNotification *)notification;
+{
+    NSWindow *window = [notification object];
+    FSAWindowRecord *record = [self recordForWindow: window];
+
+    if ([record hasSubordinates]) return;
+    [records removeObjectForKey: [NSValue valueWithNonretainedObject: window]];
+    if ([records count] == 0) {
+        [menu removeItem: separator];
+        [menu removeItem: label];
+        separator = nil;
+    }
+    [[NSNotificationCenter defaultCenter]
+        removeObserver: self name: NSWindowWillCloseNotification object: window];
+}
+
+@end
Index: releases/F-Script Anywhere/1.1.5/Source/FSAnywhere.h
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/FSAnywhere.h	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/FSAnywhere.h	(revision 18)
@@ -0,0 +1,15 @@
+/*
+ *  FSAnywhere.h
+ *  F-Script Anywhere
+ *
+ *  Created by Nicholas Riley on Sat Feb 02 2002.
+ *  Copyright (c) 2002 Nicholas Riley. All rights reserved.
+ *
+ */
+#import <Foundation/Foundation.h>
+
+#define FSA_DEBUG 0
+#define FSA_VERSION "1.1.2"
+
+extern void FSALog(NSString *fmt, ...);
+extern NSString * FSA_FScriptURL;
Index: releases/F-Script Anywhere/1.1.5/Source/FSAnywhere.m
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/FSAnywhere.m	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/FSAnywhere.m	(revision 18)
@@ -0,0 +1,22 @@
+//
+//  FSAnywhere.m
+//  F-Script Anywhere
+//
+//  Created by Nicholas Riley on Sat Feb 02 2002.
+//  Copyright (c) 2002 Nicholas Riley. All rights reserved.
+//
+
+#import "FSAnywhere.h"
+
+// wish we could #define out completely, but it seems impossible to use varargs #defines on OS X's cpp
+
+void FSALog(NSString *fmt, ...) {
+#if FSA_DEBUG
+    va_list ap;
+    va_start(ap, fmt);
+    NSLogv([NSString stringWithFormat: @"F-Script Anywhere: %@", fmt], ap);
+#endif
+}
+
+// XXX put this in a .strings file instead
+NSString * FSA_FScriptURL = @"http://www.fscript.org/";
Index: releases/F-Script Anywhere/1.1.5/Source/NJRLabeledImageCell.h
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/NJRLabeledImageCell.h	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/NJRLabeledImageCell.h	(revision 18)
@@ -0,0 +1,51 @@
+//
+//  NJRLabeledImageCell.h
+//  HostLauncher
+//
+//  Created by nicholas on Wed Aug 01 2001.
+//  Copyright (c) 2001 Nicholas Riley. All rights reserved.
+//
+
+/*
+
+ F-Script Anywhere is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ F-Script Anywhere is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with F-Script Anywhere; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+#import <Cocoa/Cocoa.h>
+
+
+@interface NJRLabeledImageCell : NSTextFieldCell {
+@private
+    NSImage *image;
+    id imageCacheSource;
+}
+
++ (NJRLabeledImageCell *)cell;
+
+- (void)setImage:(NSImage *)anImage;
+- (NSImage *)image;
+- (void)setImageCacheSource:(id)aSource;
+
+- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;
+- (NSSize)cellSize;
+
+@end
+
+// The cell may rescale the image in its drawing routine. To avoid scaling the image each time, if the imageCacheSource is set, the cell will store the scaled image and retrieve it later, using the following methods:
+@interface NJRLabeledImageCell (NJRLabeledImageCellCacheSource)
+- (NSImage *)cachedImage;
+- (void)setCachedImage:(NSImage *)anImage;
+@end
Index: releases/F-Script Anywhere/1.1.5/Source/NJRLabeledImageCell.m
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/NJRLabeledImageCell.m	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/NJRLabeledImageCell.m	(revision 18)
@@ -0,0 +1,192 @@
+//
+//  NJRLabeledImageCell.m
+//  HostLauncher
+//
+//  Created by nicholas on Wed Aug 01 2001.
+//  Copyright (c) 2001 Nicholas Riley. All rights reserved.
+//
+
+/*
+
+ F-Script Anywhere is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ F-Script Anywhere is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with F-Script Anywhere; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+#import "NJRLabeledImageCell.h"
+#import "NSString-NJRExtensions.h"
+
+const static float LEFT_PADDING = 3;
+
+@implementation NJRLabeledImageCell
+
++ (NJRLabeledImageCell *)cell {
+    return [[[self alloc] init] autorelease];
+}
+
+- (void)dealloc {
+    [image release];
+    [imageCacheSource release];
+    image = nil;
+    [super dealloc];
+}
+
+- copyWithZone:(NSZone *)zone {
+    NJRLabeledImageCell *cell = [super copyWithZone:zone];
+    cell->image = [image retain];
+    return cell;
+}
+
+- (void)setImage:(NSImage *)anImage {
+    if (anImage != image) {
+        [image release];
+        image = [anImage retain];
+    }
+}
+
+- (NSImage *)image {
+    return image;
+}
+
+- (void)setImageCacheSource:(id)aSource {
+    if (aSource != imageCacheSource) {
+        [imageCacheSource release];
+        imageCacheSource = [aSource retain];
+    }
+}
+
+- (NSRect)imageFrameForCellFrame:(NSRect)cellFrame {
+    if (image != nil) {
+        NSRect imageFrame;
+        imageFrame.size = [image size];
+        imageFrame.origin = cellFrame.origin;
+        imageFrame.origin.x += LEFT_PADDING;
+        imageFrame.origin.y += ceil((cellFrame.size.height - imageFrame.size.height) / 2);
+        return imageFrame;
+    }
+    return NSZeroRect;
+}
+
+- (void)editWithFrame:(NSRect)aRect inView:(NSView *)controlView editor:(NSText *)textObj delegate:(id)anObject event:(NSEvent *)theEvent {
+    NSRect textFrame, imageFrame;
+    NSDivideRect(aRect, &imageFrame, &textFrame,
+                 LEFT_PADDING + [image size].width, NSMinXEdge);
+    [super editWithFrame: textFrame inView: controlView
+           editor: textObj delegate: anObject event: theEvent];
+}
+
+- (void)selectWithFrame:(NSRect)aRect inView:(NSView *)controlView editor:(NSText *)textObj delegate:(id)anObject start:(int)selStart length:(int)selLength {
+    NSRect textFrame, imageFrame;
+    NSDivideRect(aRect, &imageFrame, &textFrame, LEFT_PADDING + [image size].width,
+                 NSMinXEdge);
+    [super selectWithFrame: textFrame inView: controlView editor:textObj delegate:anObject start:selStart length:selLength];
+}
+
+- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
+    if (image != nil) {
+        NSSize	imageSize;
+        NSRect	imageFrame;
+        NSImageRep *preferredRep, *rep;
+
+        imageSize = NSMakeSize(cellFrame.size.height - 1, cellFrame.size.height - 1);
+
+        preferredRep = [[[imageCacheSource cachedImage] representations] objectAtIndex: 0];
+        if (preferredRep != nil && abs([preferredRep size].width - imageSize.width) < 1 && abs([preferredRep size].height != imageSize.height) < 1) {
+            [self setImage: [imageCacheSource cachedImage]];
+            FSALog(@"%@ accepting cached image: %@", [self stringValue], preferredRep);
+        } else {
+            NSArray	*imageReps = [image representations];
+            int		i, repCount = [imageReps count];
+            NSSize	repSize;
+            
+            preferredRep = [imageReps objectAtIndex: 0];
+            FSALog(@"%@ rejecting cached image: %@", [self stringValue], preferredRep);
+            for (i = 1 ; i < repCount ; i++) {
+                rep = [imageReps objectAtIndex: i];
+                repSize = [rep size];
+                if (repSize.width == imageSize.width && repSize.height == imageSize.height) {
+                    preferredRep = rep;
+                    break;
+                }
+                if (repSize.width >= imageSize.width || repSize.height >= imageSize.height) {
+                    // pick the smallest of the larger representations
+                    if (repSize.width <= [preferredRep size].width ||
+                        repSize.height <= [preferredRep size].height) preferredRep = rep;
+                } else {
+                    // or the largest of the smaller representations
+                    if (repSize.width >= [preferredRep size].width ||
+                        repSize.height >= [preferredRep size].height) preferredRep = rep;
+                }
+            }
+            /* // Working code as of OS X 10.0.4; this breaks in 10.1
+                for (i = repCount - 1 ; i >= 0 ; i--) {
+                    rep = [imageReps objectAtIndex: i];
+                    if (rep != preferredRep) {
+                        [image removeRepresentation: rep];
+                    }
+                }
+            // End working code
+            */
+            // Begin workaround code for bug in OS X 10.1 (removeRepresentation: has no effect)
+            if ([preferredRep size].width > imageSize.width || [preferredRep size].height > imageSize.height) {
+                NSImage *scaledImage = [[NSImage alloc] initWithSize: imageSize];
+                NSRect rect = { NSZeroPoint, imageSize };
+                FSALog(@"rescaling %@", [self stringValue]);
+                [scaledImage setFlipped: [controlView isFlipped]]; // XXX this works, but is correct?
+                [scaledImage lockFocus];
+                [preferredRep drawInRect: rect];
+                [scaledImage unlockFocus];
+                [image release];
+                image = scaledImage;
+            } else if (repCount > 1) {
+                NSImage *sizedImage = [[NSImage alloc] initWithSize: [preferredRep size]];
+                [sizedImage addRepresentation: preferredRep];
+                [image release];
+                image = sizedImage;
+            }
+            // End workaround code
+        }
+        
+        NSDivideRect(cellFrame, &imageFrame, &cellFrame,
+                     LEFT_PADDING + imageSize.width, NSMinXEdge);
+        if ([self drawsBackground]) {
+            [[self backgroundColor] set];
+            NSRectFill(imageFrame);
+        }
+        imageFrame.origin.x += LEFT_PADDING;
+        imageFrame.size = imageSize;
+
+        imageFrame.origin.y += ceil((cellFrame.size.height +
+                                     ([controlView isFlipped] ? -1 : 1) *
+                                        imageFrame.size.height - 2) / 2);
+        if ([image isFlipped] != [controlView isFlipped])
+            [image setFlipped: [controlView isFlipped]];
+        [image drawInRect: imageFrame
+            fromRect: NSOffsetRect(imageFrame, -imageFrame.origin.x, -imageFrame.origin.y)
+            operation: NSCompositeSourceOver fraction: 1.0];
+        [imageCacheSource setCachedImage: image];
+    }
+    [self setAttributedStringValue:
+        [[self stringValue] asAttributedStringTruncatedToWidth: cellFrame.size.width - 4]];
+    [self setImageCacheSource: nil]; // without this, we crash (multiple cells get created!)
+    [super drawWithFrame: cellFrame inView: controlView];
+}
+
+- (NSSize)cellSize {
+    NSSize cellSize = [super cellSize];
+    cellSize.width += (image ? [image size].width : 0) + LEFT_PADDING;
+    return cellSize;
+}
+
+@end
Index: releases/F-Script Anywhere/1.1.5/Source/NJRScrollView.h
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/NJRScrollView.h	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/NJRScrollView.h	(revision 18)
@@ -0,0 +1,17 @@
+//
+//  NJRScrollView.h
+//  HostLauncher
+//
+//  Created by nicholas on Tue Oct 30 2001.
+//  Copyright (c) 2001 Nicholas Riley. All rights reserved.
+//
+
+#import <AppKit/AppKit.h>
+
+
+@interface NJRScrollView : NSScrollView {
+    BOOL shouldDrawFocusRing;
+    NSResponder *lastResp;
+}
+
+@end
Index: releases/F-Script Anywhere/1.1.5/Source/NJRScrollView.m
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/NJRScrollView.m	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/NJRScrollView.m	(revision 18)
@@ -0,0 +1,38 @@
+//
+//  NJRScrollView.m
+//  HostLauncher
+//
+//  Created by nicholas on Tue Oct 30 2001.
+//  Copyright (c) 2001 Nicholas Riley. All rights reserved.
+//
+
+#import "NJRScrollView.h"
+
+
+@implementation NJRScrollView
+
+- (BOOL)needsDisplay;
+{
+    NSResponder *resp = nil;
+    if ([[self window] isKeyWindow]) {
+        resp = [[self window] firstResponder];
+        if (resp == lastResp) return [super needsDisplay];
+    } else if (lastResp == nil) {
+        return [super needsDisplay];
+    }
+    shouldDrawFocusRing = (resp != nil && [resp isKindOfClass: [NSView class]] &&
+                           [(NSView *)resp isDescendantOf: self]); // [sic]
+    lastResp = resp;
+    [self setKeyboardFocusRingNeedsDisplayInRect: [self bounds]];
+    return YES;
+}
+
+- (void)drawRect:(NSRect)rect {
+    [super drawRect: rect];
+    if (shouldDrawFocusRing) {
+        NSSetFocusRingStyle(NSFocusRingOnly);
+        NSRectFill([self bounds]);
+    }
+}
+
+@end
Index: releases/F-Script Anywhere/1.1.5/Source/NSString-NJRExtensions.h
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/NSString-NJRExtensions.h	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/NSString-NJRExtensions.h	(revision 18)
@@ -0,0 +1,16 @@
+//
+//  NSString-NJRExtensions.h
+//  HostLauncher
+//
+//  Created by nicholas on Wed Oct 31 2001.
+//  Copyright (c) 2001 Nicholas Riley. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+#import "FSAnywhere.h"
+
+@interface NSString (NJRExtensions)
+
+- (NSAttributedString *)asAttributedStringTruncatedToWidth:(float)width;
+
+@end
Index: releases/F-Script Anywhere/1.1.5/Source/NSString-NJRExtensions.m
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/NSString-NJRExtensions.m	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/NSString-NJRExtensions.m	(revision 18)
@@ -0,0 +1,53 @@
+//
+//  NSString-NJRExtensions.m
+//  HostLauncher
+//
+//  Created by nicholas on Wed Oct 31 2001.
+//  Copyright (c) 2001 Nicholas Riley. All rights reserved.
+//
+
+// This is a reduced version of the version I use in HostLauncher, for use in F-Script Anywhere.
+// It removes methods that rely on OmniFoundation.
+// Don't forget to apply changes forward!
+
+#import <Carbon/Carbon.h>
+#import "NSString-NJRExtensions.h"
+
+@implementation NSString (NJRExtensions)
+
+- (NSAttributedString *)asAttributedStringTruncatedToWidth:(float)width {
+    NSMutableString *text = [self mutableCopy];
+    NSAttributedString *s = [NSAttributedString alloc];
+    NSMutableParagraphStyle *ps = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
+    OSStatus err;
+    /*
+    NSString *fs;
+    Str255 font;
+    SInt16 size; // label font is 10, pushbutton font 13, views font is 12!
+    err = GetThemeFont(kThemeViewsFont, smUnicodeScript, font, &size, NULL);
+    fs = CFStringCreateWithPascalString(kCFAllocatorDefault, font, CFStringGetSystemEncoding());
+    NSLog(@"Theme font: %@ %d", fs, size);
+    */
+    err = TruncateThemeText((CFMutableStringRef) text, kThemeViewsFont,
+                            kThemeStateActive, width, truncMiddle, NULL);
+    /* // There's a workaround for a 10.1 bug in Connections' awakeFromNib: the initial
+       // column size is wrong, until you resize the window.  Here's how to demonstrate the bug:
+    {   static float lastWidth = 0; // XXX debug
+        if (lastWidth != width) {
+            lastWidth = width;
+            NSLog(@"Got width %f", width);
+        }
+    }
+    */
+    if (err != noErr) FSALog(@"-[NSString asAttributedStringTruncatedToWidth:]: TruncateThemeText failed with error %d", err);
+    // XXX Should be able to skip the above by using NSLineBreakByTruncatingMiddle,
+    // XXX but OS X 10.1 doesn't implement it yet.
+    [ps setLineBreakMode: NSLineBreakByClipping];
+    s = [s initWithString: text attributes:
+           [NSDictionary dictionaryWithObjectsAndKeys: ps, NSParagraphStyleAttributeName, nil]];
+    [text release];
+    [ps release];
+    return [s autorelease];
+}
+
+@end
Index: releases/F-Script Anywhere/1.1.5/Source/NSTableView-NJRExtensions.h
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/NSTableView-NJRExtensions.h	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/NSTableView-NJRExtensions.h	(revision 18)
@@ -0,0 +1,16 @@
+//
+//  NSTableView-NJRExtensions.h
+//  HostLauncher
+//
+//  Created by Nicholas Riley on Mon Apr 22 2002.
+//  Copyright (c) 2002 Nicholas Riley. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+
+
+@interface NSTableView (NJRExtensions)
+
+- (float)cellHeight;
+
+@end
Index: releases/F-Script Anywhere/1.1.5/Source/NSTableView-NJRExtensions.m
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/NSTableView-NJRExtensions.m	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/NSTableView-NJRExtensions.m	(revision 18)
@@ -0,0 +1,19 @@
+//
+//  NSTableView-NJRExtensions.m
+//  HostLauncher
+//
+//  Created by Nicholas Riley on Mon Apr 22 2002.
+//  Copyright (c) 2002 Nicholas Riley. All rights reserved.
+//
+
+#import "NSTableView-NJRExtensions.h"
+
+
+@implementation NSTableView (NJRExtensions)
+
+- (float)cellHeight;
+{
+    return [self rowHeight] + [self intercellSpacing].height;
+}
+
+@end
Index: releases/F-Script Anywhere/1.1.5/Source/Read Me
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/Read Me	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/Read Me	(revision 18)
@@ -0,0 +1,268 @@
+F-Script Anywhere 1.1.5 [1 October 2002]
+=======================
+
+Add a F-Script interpreter to Cocoa applications dynamically.
+
+Written by Nicholas Riley <mailto:fsa@sabi.net>.
+Obtain updates from <http://web.sabi.net/nriley/software/>.
+
+
+WHAT IS IT?
+-----------
+
+Ever wanted to inspect a Cocoa applicationÕs objects from the inside?
+Frustrated with using GDB to debug Objective-C?
+
+You need F-Script Anywhere! (with apologies to Guido van Rossum)
+
+
+INSTALLATION
+------------
+
+Install F-Script; you can download it at <http://www.fscript.org/>.
+In particular, make sure the framework is installed in a Frameworks
+directory, such as /Library/Frameworks or ~/Library/Frameworks.
+
+F-Script Anywhere 1.1.5 was tested with FScript.framework 1.2.2
+(20020604), Mac OS X 10.1.5 (5S66) and 10.2.1 (6D52).  It may or may
+not work with earlier or later versions, I don't know.  If you are
+using an earlier F-Script version, please upgrade.
+
+
+USAGE
+-----
+
+Open the F-Script Anywhere application.  Pick a Cocoa application from
+the list and click Install or press return.  F-Script Anywhere will
+either install itself in that application, give you an error message,
+or crash.  (Hopefully not the latter!)
+
+Switch to the application, and you should find a ÒFSAÓ menu there.
+Select ÒNew F-Script WorkspaceÓ to display a F-Script workspace.
+This behaves like any other workspace, except it's executing within
+the context of the application.
+
+You can also install F-Script Anywhere by using its dock menu.  If
+the frontmost application is a Cocoa application, just pick ÒInstallÉÓ
+from the menu and F-Script Anywhere will install in that application.
+If F-Script Anywhere canÕt install, the menu item will tell you so,
+or F-Script AnywhereÕs icon will bounce to indicate a pending sheet
+explaining the problem.
+
+When you're finished, quit the application before quitting F-Script
+Anywhere, otherwise the application will crash.  This is an inherent
+limitation of the Objective-C runtime, and I can't do anything about
+it.  F-Script Anywhere will warn you if you try to quit it when it's
+still installed in active applications.
+
+
+BUILDING
+--------
+
+The source to F-Script Anywhere is included.  It has a number of
+dependencies.
+
+1. Install FScript.framework (see above).
+
+2. Install libPatch 1.2.1.
+
+   <http://web.sabi.net/nriley/software/libPatch-1.2.1.tgz>
+
+   I'd suggest you do it this way:
+
+   % cd /
+   % sudo gnutar --preserve-permissions -zxf libPatch-1.2.1.tgz
+   Password:
+     (please don't use StuffIt Expander)
+
+   This installs files in /Developer/Examples and
+   /usr/local/{bin,include,lib}.  If you're paranoid, you may want to
+   check the contents of the directory before installing.
+
+   Please note that the layout of the libPatch distribution has changed
+   since libPatch 1.0; the above instructions will not work for 1.0.
+   
+   I did not write libPatch, but am distributing it for your convenience
+   because it may be unavailable from its original source.  libPatch is
+   unsupported; please do not contact libPatchÕs author for support.
+
+3. Check out the source of 'otool' from the Darwin CVS repository.
+   This is required because there's a bug in the function that returns
+   the 'flavo(u)r' of an application: Cocoa, Carbon, Classic, etc.
+   It identifies all Cocoa applications as Carbon ones.  So as a
+   workaround, F-Script Anywhere examines the application itself to
+   see what libraries it links with.  (This may fail if you're doing
+   something weird like linking to development versions of Foundation
+   and AppKit, but since I don't work for Apple, I couldn't test that
+   eventuality.)
+
+   Check out Commands/Apple/cctools/{include,libstuff} from Darwin
+   CVS into the "Darwin source" directory.  If you don't have a CVS
+   account, go to <http://www.opensource.apple.com/> and get one.
+
+   cd to the libstuff directory and type 'make' (it doesn't use
+   jam/pbxbuild).  I _think_ this is all you need.
+
+4. Open 'F-Script Anywhere.pbproj' in Project Builder and build the
+   Application target.  It depends on the Library target, so you don't
+   need to build it separately.  You shouldnÕt see any errors or
+   warnings, and the F-Script Anywhere application (as well as the
+   library, which you can ignore because it is also copied into the
+   application bundle) will appear in the build product directory.
+
+If you have any problems building F-Script Anywhere, please let me
+know.
+
+
+FREQUENTLY ASKED QUESTIONS
+--------------------------
+
+Q. What is F-Script?
+
+A. F-Script is a dialect of Smalltalk which includes a bridge to
+   the Objective-C runtime on Mac OS X.  It's open-source, and
+   very nice.  Its author, Philippe Mougin, has written several
+   articles on it, and documentation is available from the
+   F-Script Web site:
+
+   <http://www.fscript.org/>
+
+
+Q. How do you access user interface elements?
+
+A. One way is to access a window and its views programmatically:
+
+   > app := NSApplication sharedApplication
+
+   > windows := app windows
+
+   > windows
+   NSCFArray {<NSWindow: 0x186770>, <NSWindow: 0x1ba4a0>, <NSWindow:
+   0x1f0cea0>}
+
+   > windows collect: [:each | each title]
+
+   error: an instance of NSWindow does not respond to "collect:"
+
+   (...a gentle reminder that this is not Smalltalk...)
+
+   > windows title
+   {'F-Script', '', ''}
+
+   (...but F-Script has some tricks of its own...)
+
+   > fsw := windows at: 0
+
+   > fswView := fsw contentView
+
+   To open an F-Script object browser on fswView, type:
+
+   > sys browse: fswView
+
+   Or, click ÒNew Browser: Object...Ó, then click on fswView.
+   Click 'subviews' in the message list.  You can use 'subviews'
+   repeatedly on container views if needed.
+
+
+Q. ThatÕs too hard, especially all that scrolling.
+
+A. If you need to access a view (such as a button or text field), menu or
+   window, youÕre in luck.  Click in an F-Script workspace window, then
+   choose ÒAssociate With InterfaceÓ from the ÒFSAÓ menu.
+   Follow the instructions in the window to select a user interface
+   element, view it in an object browser or assign it to a variable.
+
+
+Q. F-Script Anywhere fails miserably on Jaguar.
+
+A. It shouldnÕt.  Apple re-added support for libPatch to Jaguar late
+   in the development process, with the result that F-Script Anywhere
+   works.  libPatch nevertheless needs to be replaced with a more
+   robust mechanism, and I am currently working on using the Application
+   Enhancer SDK <http://www.unsanity.com/haxies/ape/sdk/> for a future
+   version of F-Script Anywhere.
+
+
+Q. F-Script Anywhere fails to recognize Spring as a Cocoa application.
+
+A. Yes, I'm aware of the irony: I contributed code to Spring.  Spring
+   uses a unique application launching mechanism which makes it
+   difficult to determine what type of application it is.  The only
+   current workaround is to upgrade to Jaguar, where Spring will be
+   correctly identified.  This problem will be remedied with the move
+   to Application Enhancer, described above, in a future version of
+   F-Script Anywhere.
+
+
+Q. I donÕt like F-ScriptÕs syntax.  I don't like the object browser.
+   I donÕt like you either.
+
+A. I didnÕt write F-Script.  Please address your questions to
+   F-ScriptÕs author or the F-Script mailing list.
+   
+   <http://www.fscript.org/contacts.htm>
+
+   Oh, and get lost.
+
+
+Q. My question isn't answered here.
+
+A. That's not a question.  But if you have a question about F-Script
+   Anywhere, a suggestion or a bug to report, please email it to me at
+   <fsa@sabi.net>.  Please try to keep your messages short and to the
+   point, and I'll get back to you as soon as my schedule will allow.
+   Thanks!
+
+
+VERSION HISTORY
+---------------
+
+1.1.5 - 1 October 2002  - better identify Cocoa vs. Carbon applications
+                          on Jaguar; added hierarchical window list to
+                          FSA menu; fixed startup crash on Puma with
+                          certain Carbon CFM applications
+1.1.4 - 25 August 2002  - fixed miscellaneous Jaguar issues; worked
+                          around broken application quit notifications;
+                          added unique interpreter/associate window titles
+1.1.3 - 24 July 2002    - added bullseye-menu targeting cursor; added menu
+                          association; work around bug by stopping capture
+                          on suspend; added delegate, data source, target,
+                          cell selection for views; window controller for
+                          windows
+1.1.2 - 18 July 2002    - fixed more startup issues with list management;
+                          properly scale icons of apps which have no
+                          small icons; added user interface association
+1.1.1 - 3 July 2002     - fixed inefficiencies responsible for long
+                          startup time; reorganized Window menu; support
+                          paths to applications which contain non-ASCII
+                          characters [Martin Hcker]; added sample code
+                          to grab UI elements [Philippe Mougin]; cleaned
+                          up code and distribution layout
+1.1   - 25 April 2002   - revised terminology; updated for F-Script 1.2;
+                          zoom to fit in application list; added help
+                          tags for workspace; focus workspace initially
+1.0.2 - (unreleased)    - minor cleanups, added error messages, updated
+                          scroll view component for faster UI response,
+                          removed help menu item because it's useless
+1.0.1 - 1 March 2002    - corrected message for error 5; libPatch 1.2;
+                          fixed endless confirmation on window close
+1.0.1d1 1 February 2002 - added error messages
+1.0   - 3 February 2002 - added dock menu, URL launching, check for
+                          F-Script framework, floating window,
+                          application name in interpreter window title,
+                          fixed bugs, cleaned up error handling,
+                          licensed under the GPL (because of ASM code),
+                          packaged, added Read Me file and license
+1.0d1 - 1 February 2002 - proof of feasibility, private test version
+
+
+CREDITS
+-------
+
+Thanks to the following people for their software and generous
+donations of source code:
+
+Philippe Mougin, for F-Script
+Mike Ferris, for TextExtras
+Apple, for Darwin
+Frank Vercruesse, for ASM
Index: releases/F-Script Anywhere/1.1.5/Source/VERSION
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/VERSION	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/VERSION	(revision 18)
@@ -0,0 +1,1 @@
+1.1.5
Index: releases/F-Script Anywhere/1.1.5/Source/bytesex.c
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/bytesex.c	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/bytesex.c	(revision 18)
@@ -0,0 +1,1980 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  This file contains Original Code and/or Modifications of
+ * Original Code as defined in and that are subject to the Apple Public
+ * Source License Version 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource and read it before using
+ * this file.
+ * 
+ * The Original Code and all software distributed under the License are
+ * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/* byte_sex.c */
+#include <string.h>
+#include <mach-o/fat.h>
+#include <mach-o/loader.h>
+#import <mach/m68k/thread_status.h>
+#import <mach/ppc/thread_status.h>
+#import <mach/m88k/thread_status.h>
+#import <mach/i860/thread_status.h>
+#import <mach/i386/thread_status.h>
+#import <mach/hppa/thread_status.h>
+#import <mach/sparc/thread_status.h>
+#include <mach-o/nlist.h>
+#include <mach-o/reloc.h>
+#include <mach-o/ranlib.h>
+#include "stuff/bool.h"
+#include "stuff/bytesex.h"
+
+__private_extern__
+double
+SWAP_DOUBLE(
+double d)
+{
+	union {
+	    char c[8];
+	    double d;
+	} in, out;
+	in.d = d;
+	out.c[0] = in.c[7];
+	out.c[1] = in.c[6];
+	out.c[2] = in.c[5];
+	out.c[3] = in.c[4];
+	out.c[4] = in.c[3];
+	out.c[5] = in.c[2];
+	out.c[6] = in.c[1];
+	out.c[7] = in.c[0];
+	return(out.d);
+}
+
+__private_extern__
+float
+SWAP_FLOAT(
+float f)
+{
+	union {
+	    char c[7];
+	    float f;
+	} in, out;
+	in.f = f;
+	out.c[0] = in.c[3];
+	out.c[1] = in.c[2];
+	out.c[2] = in.c[1];
+	out.c[3] = in.c[0];
+	return(out.f);
+}
+
+/*
+ * get_host_byte_sex() returns the enum constant for the byte sex of the host
+ * it is running on.
+ */
+__private_extern__
+enum byte_sex
+get_host_byte_sex(
+void)
+{
+    unsigned long s;
+
+	s = (BIG_ENDIAN_BYTE_SEX << 24) | LITTLE_ENDIAN_BYTE_SEX;
+	return((enum byte_sex)*((char *)&s));
+}
+
+__private_extern__
+void
+swap_fat_header(
+struct fat_header *fat_header,
+enum byte_sex target_byte_sex)
+{
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+
+	fat_header->magic     = SWAP_LONG(fat_header->magic);
+	fat_header->nfat_arch = SWAP_LONG(fat_header->nfat_arch);
+}
+
+__private_extern__
+void
+swap_fat_arch(
+struct fat_arch *fat_archs,
+unsigned long nfat_arch,
+enum byte_sex target_byte_sex)
+{
+    unsigned long i;
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+
+	for(i = 0; i < nfat_arch; i++){
+	    fat_archs[i].cputype    = SWAP_LONG(fat_archs[i].cputype);
+	    fat_archs[i].cpusubtype = SWAP_LONG(fat_archs[i].cpusubtype);
+	    fat_archs[i].offset     = SWAP_LONG(fat_archs[i].offset);
+	    fat_archs[i].size       = SWAP_LONG(fat_archs[i].size);
+	    fat_archs[i].align      = SWAP_LONG(fat_archs[i].align);
+	}
+}
+
+__private_extern__
+void
+swap_mach_header(
+struct mach_header *mh,
+enum byte_sex target_byte_sex)
+{
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+	mh->magic = SWAP_LONG(mh->magic);
+	mh->cputype = SWAP_LONG(mh->cputype);
+	mh->cpusubtype = SWAP_LONG(mh->cpusubtype);
+	mh->filetype = SWAP_LONG(mh->filetype);
+	mh->ncmds = SWAP_LONG(mh->ncmds);
+	mh->sizeofcmds = SWAP_LONG(mh->sizeofcmds);
+	mh->flags = SWAP_LONG(mh->flags);
+}
+
+__private_extern__
+void
+swap_load_command(
+struct load_command *lc,
+enum byte_sex target_byte_sex)
+{
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+	lc->cmd = SWAP_LONG(lc->cmd);
+	lc->cmdsize = SWAP_LONG(lc->cmdsize);
+}
+
+__private_extern__
+void
+swap_segment_command(
+struct segment_command *sg,
+enum byte_sex target_byte_sex)
+{
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+	/* segname[16] */
+	sg->cmd = SWAP_LONG(sg->cmd);
+	sg->cmdsize = SWAP_LONG(sg->cmdsize);
+	sg->vmaddr = SWAP_LONG(sg->vmaddr);
+	sg->vmsize = SWAP_LONG(sg->vmsize);
+	sg->fileoff = SWAP_LONG(sg->fileoff);
+	sg->filesize = SWAP_LONG(sg->filesize);
+	sg->maxprot = SWAP_LONG(sg->maxprot);
+	sg->initprot = SWAP_LONG(sg->initprot);
+	sg->nsects = SWAP_LONG(sg->nsects);
+	sg->flags = SWAP_LONG(sg->flags);
+}
+
+__private_extern__
+void
+swap_section(
+struct section *s,
+unsigned long nsects,
+enum byte_sex target_byte_sex)
+{
+    unsigned long i;
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+
+	for(i = 0; i < nsects; i++){
+	    /* sectname[16] */
+	    /* segname[16] */
+	    s[i].addr = SWAP_LONG(s[i].addr);
+	    s[i].size = SWAP_LONG(s[i].size);
+	    s[i].offset = SWAP_LONG(s[i].offset);
+	    s[i].align = SWAP_LONG(s[i].align);
+	    s[i].reloff = SWAP_LONG(s[i].reloff);
+	    s[i].nreloc = SWAP_LONG(s[i].nreloc);
+	    s[i].flags = SWAP_LONG(s[i].flags);
+	    s[i].reserved1 = SWAP_LONG(s[i].reserved1);
+	    s[i].reserved2 = SWAP_LONG(s[i].reserved2);
+	}
+}
+
+__private_extern__
+void
+swap_symtab_command(
+struct symtab_command *st,
+enum byte_sex target_byte_sex)
+{
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+	st->cmd = SWAP_LONG(st->cmd);
+	st->cmdsize = SWAP_LONG(st->cmdsize);
+	st->symoff = SWAP_LONG(st->symoff);
+	st->nsyms = SWAP_LONG(st->nsyms);
+	st->stroff = SWAP_LONG(st->stroff);
+	st->strsize = SWAP_LONG(st->strsize);
+}
+
+__private_extern__
+void
+swap_dysymtab_command(
+struct dysymtab_command *dyst,
+enum byte_sex target_byte_sex)
+{
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+	dyst->cmd = SWAP_LONG(dyst->cmd);
+	dyst->cmdsize = SWAP_LONG(dyst->cmdsize);
+	dyst->ilocalsym = SWAP_LONG(dyst->ilocalsym);
+	dyst->nlocalsym = SWAP_LONG(dyst->nlocalsym);
+	dyst->iextdefsym = SWAP_LONG(dyst->iextdefsym);
+	dyst->nextdefsym = SWAP_LONG(dyst->nextdefsym);
+	dyst->iundefsym = SWAP_LONG(dyst->iundefsym);
+	dyst->nundefsym = SWAP_LONG(dyst->nundefsym);
+	dyst->tocoff = SWAP_LONG(dyst->tocoff);
+	dyst->ntoc = SWAP_LONG(dyst->ntoc);
+	dyst->modtaboff = SWAP_LONG(dyst->modtaboff);
+	dyst->nmodtab = SWAP_LONG(dyst->nmodtab);
+	dyst->extrefsymoff = SWAP_LONG(dyst->extrefsymoff);
+	dyst->nextrefsyms = SWAP_LONG(dyst->nextrefsyms);
+	dyst->indirectsymoff = SWAP_LONG(dyst->indirectsymoff);
+	dyst->nindirectsyms = SWAP_LONG(dyst->nindirectsyms);
+	dyst->extreloff = SWAP_LONG(dyst->extreloff);
+	dyst->nextrel = SWAP_LONG(dyst->nextrel);
+	dyst->locreloff = SWAP_LONG(dyst->locreloff);
+	dyst->nlocrel = SWAP_LONG(dyst->nlocrel);
+}
+
+__private_extern__
+void
+swap_symseg_command(
+struct symseg_command *ss,
+enum byte_sex target_byte_sex)
+{
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+	ss->cmd = SWAP_LONG(ss->cmd);
+	ss->cmdsize = SWAP_LONG(ss->cmdsize);
+	ss->offset = SWAP_LONG(ss->offset);
+	ss->size = SWAP_LONG(ss->size);
+}
+
+__private_extern__
+void
+swap_fvmlib_command(
+struct fvmlib_command *fl,
+enum byte_sex target_byte_sex)
+{
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+	fl->cmd = SWAP_LONG(fl->cmd);
+	fl->cmdsize = SWAP_LONG(fl->cmdsize);
+	fl->fvmlib.name.offset = SWAP_LONG(fl->fvmlib.name.offset);
+	fl->fvmlib.minor_version = SWAP_LONG(fl->fvmlib.minor_version);
+	fl->fvmlib.header_addr = SWAP_LONG(fl->fvmlib.header_addr);
+}
+
+__private_extern__
+void
+swap_dylib_command(
+struct dylib_command *dl,
+enum byte_sex target_byte_sex)
+{
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+	dl->cmd = SWAP_LONG(dl->cmd);
+	dl->cmdsize = SWAP_LONG(dl->cmdsize);
+	dl->dylib.name.offset = SWAP_LONG(dl->dylib.name.offset);
+	dl->dylib.timestamp = SWAP_LONG(dl->dylib.timestamp);
+	dl->dylib.current_version = SWAP_LONG(dl->dylib.current_version);
+	dl->dylib.compatibility_version =
+				SWAP_LONG(dl->dylib.compatibility_version);
+}
+
+__private_extern__
+void
+swap_sub_framework_command(
+struct sub_framework_command *sub,
+enum byte_sex target_byte_sex)
+{
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+	sub->cmd = SWAP_LONG(sub->cmd);
+	sub->cmdsize = SWAP_LONG(sub->cmdsize);
+	sub->umbrella.offset = SWAP_LONG(sub->umbrella.offset);
+}
+
+__private_extern__
+void
+swap_sub_umbrella_command(
+struct sub_umbrella_command *usub,
+enum byte_sex target_byte_sex)
+{
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+	usub->cmd = SWAP_LONG(usub->cmd);
+	usub->cmdsize = SWAP_LONG(usub->cmdsize);
+	usub->sub_umbrella.offset = SWAP_LONG(usub->sub_umbrella.offset);
+}
+
+__private_extern__
+void
+swap_sub_library_command(
+struct sub_library_command *lsub,
+enum byte_sex target_byte_sex)
+{
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+	lsub->cmd = SWAP_LONG(lsub->cmd);
+	lsub->cmdsize = SWAP_LONG(lsub->cmdsize);
+	lsub->sub_library.offset = SWAP_LONG(lsub->sub_library.offset);
+}
+
+__private_extern__
+void
+swap_sub_client_command(
+struct sub_client_command *csub,
+enum byte_sex target_byte_sex)
+{
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+	csub->cmd = SWAP_LONG(csub->cmd);
+	csub->cmdsize = SWAP_LONG(csub->cmdsize);
+	csub->client.offset = SWAP_LONG(csub->client.offset);
+}
+
+__private_extern__
+void
+swap_prebound_dylib_command(
+struct prebound_dylib_command *pbdylib,
+enum byte_sex target_byte_sex)
+{
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+	pbdylib->cmd = SWAP_LONG(pbdylib->cmd);
+	pbdylib->cmdsize = SWAP_LONG(pbdylib->cmdsize);
+	pbdylib->name.offset = SWAP_LONG(pbdylib->name.offset);
+	pbdylib->nmodules = SWAP_LONG(pbdylib->nmodules);
+	pbdylib->linked_modules.offset =
+		SWAP_LONG(pbdylib->linked_modules.offset);
+}
+
+__private_extern__
+void
+swap_dylinker_command(
+struct dylinker_command *dyld,
+enum byte_sex target_byte_sex)
+{
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+	dyld->cmd = SWAP_LONG(dyld->cmd);
+	dyld->cmdsize = SWAP_LONG(dyld->cmdsize);
+	dyld->name.offset = SWAP_LONG(dyld->name.offset);
+}
+
+__private_extern__
+void
+swap_fvmfile_command(
+struct fvmfile_command *ff,
+enum byte_sex target_byte_sex)
+{
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+	ff->cmd = SWAP_LONG(ff->cmd);
+	ff->cmdsize = SWAP_LONG(ff->cmdsize);
+	ff->name.offset = SWAP_LONG(ff->name.offset);
+	ff->header_addr = SWAP_LONG(ff->header_addr);
+}
+
+
+__private_extern__
+void
+swap_thread_command(
+struct thread_command *ut,
+enum byte_sex target_byte_sex)
+{
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+	ut->cmd = SWAP_LONG(ut->cmd);
+	ut->cmdsize = SWAP_LONG(ut->cmdsize);
+}
+
+__private_extern__
+void
+swap_m68k_thread_state_regs(
+struct m68k_thread_state_regs *cpu,
+enum byte_sex target_byte_sex)
+{
+    unsigned long i;
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+
+	for(i = 0; i < 8; i++)
+	    cpu->dreg[i] = SWAP_LONG(cpu->dreg[i]);
+	for(i = 0; i < 8; i++)
+	    cpu->areg[i] = SWAP_LONG(cpu->areg[i]);
+	cpu->pad0 = SWAP_SHORT(cpu->pad0);
+	cpu->sr = SWAP_SHORT(cpu->sr);
+	cpu->pc = SWAP_LONG(cpu->pc);
+}
+
+__private_extern__
+void
+swap_m68k_thread_state_68882(
+struct m68k_thread_state_68882 *fpu,
+enum byte_sex target_byte_sex)
+{
+    unsigned long i, tmp;
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+
+	for(i = 0; i < 8; i++){
+	                   tmp = SWAP_LONG(fpu->regs[i].fp[0]);
+	    fpu->regs[i].fp[1] = SWAP_LONG(fpu->regs[i].fp[1]);
+	    fpu->regs[i].fp[0] = SWAP_LONG(fpu->regs[i].fp[2]);
+	    fpu->regs[i].fp[2] = tmp;
+	}
+	fpu->cr = SWAP_LONG(fpu->cr);
+	fpu->sr = SWAP_LONG(fpu->sr);
+	fpu->iar = SWAP_LONG(fpu->iar);
+	fpu->state = SWAP_LONG(fpu->state);
+}
+
+__private_extern__
+void
+swap_m68k_thread_state_user_reg(
+struct m68k_thread_state_user_reg *user_reg,
+enum byte_sex target_byte_sex)
+{
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+	user_reg->user_reg = SWAP_LONG(user_reg->user_reg);
+}
+
+__private_extern__
+void
+swap_ppc_thread_state_t(
+ppc_thread_state_t *cpu,
+enum byte_sex target_byte_sex)
+{
+	cpu->srr0 = SWAP_LONG(cpu->srr0);
+	cpu->srr1 = SWAP_LONG(cpu->srr1);
+	cpu->r0 = SWAP_LONG(cpu->r0);
+	cpu->r1 = SWAP_LONG(cpu->r1);
+	cpu->r2 = SWAP_LONG(cpu->r2);
+	cpu->r3 = SWAP_LONG(cpu->r3);
+	cpu->r4 = SWAP_LONG(cpu->r4);
+	cpu->r5 = SWAP_LONG(cpu->r5);
+	cpu->r6 = SWAP_LONG(cpu->r6);
+	cpu->r7 = SWAP_LONG(cpu->r7);
+	cpu->r8 = SWAP_LONG(cpu->r8);
+	cpu->r9 = SWAP_LONG(cpu->r9);
+	cpu->r10 = SWAP_LONG(cpu->r10);
+	cpu->r11 = SWAP_LONG(cpu->r11);
+	cpu->r12 = SWAP_LONG(cpu->r12);
+	cpu->r13 = SWAP_LONG(cpu->r13);
+	cpu->r14 = SWAP_LONG(cpu->r14);
+	cpu->r15 = SWAP_LONG(cpu->r15);
+	cpu->r16 = SWAP_LONG(cpu->r16);
+	cpu->r17 = SWAP_LONG(cpu->r17);
+	cpu->r18 = SWAP_LONG(cpu->r18);
+	cpu->r19 = SWAP_LONG(cpu->r19);
+	cpu->r20 = SWAP_LONG(cpu->r20);
+	cpu->r21 = SWAP_LONG(cpu->r21);
+	cpu->r22 = SWAP_LONG(cpu->r22);
+	cpu->r23 = SWAP_LONG(cpu->r23);
+	cpu->r24 = SWAP_LONG(cpu->r24);
+	cpu->r25 = SWAP_LONG(cpu->r25);
+	cpu->r26 = SWAP_LONG(cpu->r26);
+	cpu->r27 = SWAP_LONG(cpu->r27);
+	cpu->r28 = SWAP_LONG(cpu->r28);
+	cpu->r29 = SWAP_LONG(cpu->r29);
+	cpu->r30 = SWAP_LONG(cpu->r30);
+	cpu->r31 = SWAP_LONG(cpu->r31);
+	cpu->cr  = SWAP_LONG(cpu->cr);
+	cpu->xer = SWAP_LONG(cpu->xer);
+	cpu->lr  = SWAP_LONG(cpu->lr);
+	cpu->ctr = SWAP_LONG(cpu->ctr);
+	cpu->mq =  SWAP_LONG(cpu->mq);
+	cpu->pad = SWAP_LONG(cpu->pad);
+}
+
+__private_extern__
+void
+swap_ppc_float_state_t(
+ppc_float_state_t *fpu,
+enum byte_sex target_byte_sex)
+{
+    unsigned long i;
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+	
+	for(i = 0; i < 32; i++)
+	    fpu->fpregs[i] = SWAP_DOUBLE(fpu->fpregs[i]);
+
+	fpu->fpscr_pad = SWAP_LONG(fpu->fpscr_pad);
+	fpu->fpscr = SWAP_LONG(fpu->fpscr);
+}
+
+__private_extern__
+void
+swap_ppc_exception_state_t(
+ppc_exception_state_t *state,
+enum byte_sex target_byte_sex)
+{
+    unsigned long i;
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+	
+	state->dar = SWAP_LONG(state->dar);
+	state->dsisr = SWAP_LONG(state->dsisr);
+	state->exception = SWAP_LONG(state->exception);
+	state->pad0 = SWAP_LONG(state->pad0);
+
+	for(i = 0; i < 4; i++)
+	    state->pad1[i] = SWAP_LONG(state->pad1[i]);
+}
+
+__private_extern__
+void
+swap_m88k_thread_state_grf_t(
+m88k_thread_state_grf_t *cpu,
+enum byte_sex target_byte_sex)
+{
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+	cpu->r1 = SWAP_LONG(cpu->r1);
+	cpu->r2 = SWAP_LONG(cpu->r2);
+	cpu->r3 = SWAP_LONG(cpu->r3);
+	cpu->r4 = SWAP_LONG(cpu->r4);
+	cpu->r5 = SWAP_LONG(cpu->r5);
+	cpu->r6 = SWAP_LONG(cpu->r6);
+	cpu->r7 = SWAP_LONG(cpu->r7);
+	cpu->r8 = SWAP_LONG(cpu->r8);
+	cpu->r9 = SWAP_LONG(cpu->r9);
+	cpu->r10 = SWAP_LONG(cpu->r10);
+	cpu->r11 = SWAP_LONG(cpu->r11);
+	cpu->r12 = SWAP_LONG(cpu->r12);
+	cpu->r13 = SWAP_LONG(cpu->r13);
+	cpu->r14 = SWAP_LONG(cpu->r14);
+	cpu->r15 = SWAP_LONG(cpu->r15);
+	cpu->r16 = SWAP_LONG(cpu->r16);
+	cpu->r17 = SWAP_LONG(cpu->r17);
+	cpu->r18 = SWAP_LONG(cpu->r18);
+	cpu->r19 = SWAP_LONG(cpu->r19);
+	cpu->r20 = SWAP_LONG(cpu->r20);
+	cpu->r21 = SWAP_LONG(cpu->r21);
+	cpu->r22 = SWAP_LONG(cpu->r22);
+	cpu->r23 = SWAP_LONG(cpu->r23);
+	cpu->r24 = SWAP_LONG(cpu->r24);
+	cpu->r25 = SWAP_LONG(cpu->r25);
+	cpu->r26 = SWAP_LONG(cpu->r26);
+	cpu->r27 = SWAP_LONG(cpu->r27);
+	cpu->r28 = SWAP_LONG(cpu->r28);
+	cpu->r29 = SWAP_LONG(cpu->r29);
+	cpu->r30 = SWAP_LONG(cpu->r30);
+	cpu->r31 = SWAP_LONG(cpu->r31);
+	cpu->xip = SWAP_LONG(cpu->xip);
+	cpu->xip_in_bd = SWAP_LONG(cpu->xip_in_bd);
+	cpu->nip = SWAP_LONG(cpu->nip);
+}
+
+__private_extern__
+void
+swap_m88k_thread_state_xrf_t(
+m88k_thread_state_xrf_t *fpu,
+enum byte_sex target_byte_sex)
+{
+    enum byte_sex host_byte_sex;
+
+    struct swapped_m88k_fpsr {
+	union {
+	    struct {
+		unsigned	afinx:BIT_WIDTH(0);
+		unsigned	afovf:BIT_WIDTH(1);
+		unsigned	afunf:BIT_WIDTH(2);
+		unsigned	afdvz:BIT_WIDTH(3);
+		unsigned	afinv:BIT_WIDTH(4);
+		unsigned	:BITS_WIDTH(15,5);
+		unsigned	xmod:BIT_WIDTH(16);
+		unsigned	:BITS_WIDTH(31,17);
+	    } fields;
+	    unsigned long word;
+	} u;
+    } ssr;
+    struct swapped_m88k_fpcr {
+	union {
+	    struct {
+		unsigned	efinx:BIT_WIDTH(0);
+		unsigned	efovf:BIT_WIDTH(1);
+		unsigned	efunf:BIT_WIDTH(2);
+		unsigned	efdvz:BIT_WIDTH(3);
+		unsigned	efinv:BIT_WIDTH(4);
+		unsigned	:BITS_WIDTH(13,5);
+		m88k_fpcr_rm_t	rm:BITS_WIDTH(15,14);
+		unsigned	:BITS_WIDTH(31,16);
+	    } fields;
+	    unsigned long word;
+	} u;
+    } scr;
+
+	host_byte_sex = get_host_byte_sex();
+
+	fpu->x1.x[0] = SWAP_LONG(fpu->x1.x[0]);
+	fpu->x1.x[1] = SWAP_LONG(fpu->x1.x[1]);
+	fpu->x1.x[2] = SWAP_LONG(fpu->x1.x[2]);
+	fpu->x1.x[3] = SWAP_LONG(fpu->x1.x[3]);
+	fpu->x2.x[0] = SWAP_LONG(fpu->x2.x[0]);
+	fpu->x2.x[1] = SWAP_LONG(fpu->x2.x[1]);
+	fpu->x2.x[2] = SWAP_LONG(fpu->x2.x[2]);
+	fpu->x2.x[3] = SWAP_LONG(fpu->x2.x[3]);
+	fpu->x3.x[0] = SWAP_LONG(fpu->x3.x[0]);
+	fpu->x3.x[1] = SWAP_LONG(fpu->x3.x[1]);
+	fpu->x3.x[2] = SWAP_LONG(fpu->x3.x[2]);
+	fpu->x3.x[3] = SWAP_LONG(fpu->x3.x[3]);
+	fpu->x4.x[0] = SWAP_LONG(fpu->x4.x[0]);
+	fpu->x4.x[1] = SWAP_LONG(fpu->x4.x[1]);
+	fpu->x4.x[2] = SWAP_LONG(fpu->x4.x[2]);
+	fpu->x4.x[3] = SWAP_LONG(fpu->x4.x[3]);
+	fpu->x5.x[0] = SWAP_LONG(fpu->x5.x[0]);
+	fpu->x5.x[1] = SWAP_LONG(fpu->x5.x[1]);
+	fpu->x5.x[2] = SWAP_LONG(fpu->x5.x[2]);
+	fpu->x5.x[3] = SWAP_LONG(fpu->x5.x[3]);
+	fpu->x6.x[0] = SWAP_LONG(fpu->x6.x[0]);
+	fpu->x6.x[1] = SWAP_LONG(fpu->x6.x[1]);
+	fpu->x6.x[2] = SWAP_LONG(fpu->x6.x[2]);
+	fpu->x6.x[3] = SWAP_LONG(fpu->x6.x[3]);
+	fpu->x7.x[0] = SWAP_LONG(fpu->x7.x[0]);
+	fpu->x7.x[1] = SWAP_LONG(fpu->x7.x[1]);
+	fpu->x7.x[2] = SWAP_LONG(fpu->x7.x[2]);
+	fpu->x7.x[3] = SWAP_LONG(fpu->x7.x[3]);
+	fpu->x8.x[0] = SWAP_LONG(fpu->x8.x[0]);
+	fpu->x8.x[1] = SWAP_LONG(fpu->x8.x[1]);
+	fpu->x8.x[2] = SWAP_LONG(fpu->x8.x[2]);
+	fpu->x8.x[3] = SWAP_LONG(fpu->x8.x[3]);
+	fpu->x9.x[0] = SWAP_LONG(fpu->x9.x[0]);
+	fpu->x9.x[1] = SWAP_LONG(fpu->x9.x[1]);
+	fpu->x9.x[2] = SWAP_LONG(fpu->x9.x[2]);
+	fpu->x9.x[3] = SWAP_LONG(fpu->x9.x[3]);
+	fpu->x10.x[0] = SWAP_LONG(fpu->x10.x[0]);
+	fpu->x10.x[1] = SWAP_LONG(fpu->x10.x[1]);
+	fpu->x10.x[2] = SWAP_LONG(fpu->x10.x[2]);
+	fpu->x10.x[3] = SWAP_LONG(fpu->x10.x[3]);
+	fpu->x11.x[0] = SWAP_LONG(fpu->x11.x[0]);
+	fpu->x11.x[1] = SWAP_LONG(fpu->x11.x[1]);
+	fpu->x11.x[2] = SWAP_LONG(fpu->x11.x[2]);
+	fpu->x11.x[3] = SWAP_LONG(fpu->x11.x[3]);
+	fpu->x12.x[0] = SWAP_LONG(fpu->x12.x[0]);
+	fpu->x12.x[1] = SWAP_LONG(fpu->x12.x[1]);
+	fpu->x12.x[2] = SWAP_LONG(fpu->x12.x[2]);
+	fpu->x12.x[3] = SWAP_LONG(fpu->x12.x[3]);
+	fpu->x13.x[0] = SWAP_LONG(fpu->x13.x[0]);
+	fpu->x13.x[1] = SWAP_LONG(fpu->x13.x[1]);
+	fpu->x13.x[2] = SWAP_LONG(fpu->x13.x[2]);
+	fpu->x13.x[3] = SWAP_LONG(fpu->x13.x[3]);
+	fpu->x14.x[0] = SWAP_LONG(fpu->x14.x[0]);
+	fpu->x14.x[1] = SWAP_LONG(fpu->x14.x[1]);
+	fpu->x14.x[2] = SWAP_LONG(fpu->x14.x[2]);
+	fpu->x14.x[3] = SWAP_LONG(fpu->x14.x[3]);
+	fpu->x15.x[0] = SWAP_LONG(fpu->x15.x[0]);
+	fpu->x15.x[1] = SWAP_LONG(fpu->x15.x[1]);
+	fpu->x15.x[2] = SWAP_LONG(fpu->x15.x[2]);
+	fpu->x15.x[3] = SWAP_LONG(fpu->x15.x[3]);
+	fpu->x16.x[0] = SWAP_LONG(fpu->x16.x[0]);
+	fpu->x16.x[1] = SWAP_LONG(fpu->x16.x[1]);
+	fpu->x16.x[2] = SWAP_LONG(fpu->x16.x[2]);
+	fpu->x16.x[3] = SWAP_LONG(fpu->x16.x[3]);
+	fpu->x17.x[0] = SWAP_LONG(fpu->x17.x[0]);
+	fpu->x17.x[1] = SWAP_LONG(fpu->x17.x[1]);
+	fpu->x17.x[2] = SWAP_LONG(fpu->x17.x[2]);
+	fpu->x17.x[3] = SWAP_LONG(fpu->x17.x[3]);
+	fpu->x18.x[0] = SWAP_LONG(fpu->x18.x[0]);
+	fpu->x18.x[1] = SWAP_LONG(fpu->x18.x[1]);
+	fpu->x18.x[2] = SWAP_LONG(fpu->x18.x[2]);
+	fpu->x18.x[3] = SWAP_LONG(fpu->x18.x[3]);
+	fpu->x19.x[0] = SWAP_LONG(fpu->x19.x[0]);
+	fpu->x19.x[1] = SWAP_LONG(fpu->x19.x[1]);
+	fpu->x19.x[2] = SWAP_LONG(fpu->x19.x[2]);
+	fpu->x19.x[3] = SWAP_LONG(fpu->x19.x[3]);
+	fpu->x20.x[0] = SWAP_LONG(fpu->x20.x[0]);
+	fpu->x20.x[1] = SWAP_LONG(fpu->x20.x[1]);
+	fpu->x20.x[2] = SWAP_LONG(fpu->x20.x[2]);
+	fpu->x20.x[3] = SWAP_LONG(fpu->x20.x[3]);
+	fpu->x21.x[0] = SWAP_LONG(fpu->x21.x[0]);
+	fpu->x21.x[1] = SWAP_LONG(fpu->x21.x[1]);
+	fpu->x21.x[2] = SWAP_LONG(fpu->x21.x[2]);
+	fpu->x21.x[3] = SWAP_LONG(fpu->x21.x[3]);
+	fpu->x22.x[0] = SWAP_LONG(fpu->x22.x[0]);
+	fpu->x22.x[1] = SWAP_LONG(fpu->x22.x[1]);
+	fpu->x22.x[2] = SWAP_LONG(fpu->x22.x[2]);
+	fpu->x22.x[3] = SWAP_LONG(fpu->x22.x[3]);
+	fpu->x23.x[0] = SWAP_LONG(fpu->x23.x[0]);
+	fpu->x23.x[1] = SWAP_LONG(fpu->x23.x[1]);
+	fpu->x23.x[2] = SWAP_LONG(fpu->x23.x[2]);
+	fpu->x23.x[3] = SWAP_LONG(fpu->x23.x[3]);
+	fpu->x24.x[0] = SWAP_LONG(fpu->x24.x[0]);
+	fpu->x24.x[1] = SWAP_LONG(fpu->x24.x[1]);
+	fpu->x24.x[2] = SWAP_LONG(fpu->x24.x[2]);
+	fpu->x24.x[3] = SWAP_LONG(fpu->x24.x[3]);
+	fpu->x25.x[0] = SWAP_LONG(fpu->x25.x[0]);
+	fpu->x25.x[1] = SWAP_LONG(fpu->x25.x[1]);
+	fpu->x25.x[2] = SWAP_LONG(fpu->x25.x[2]);
+	fpu->x25.x[3] = SWAP_LONG(fpu->x25.x[3]);
+	fpu->x26.x[0] = SWAP_LONG(fpu->x26.x[0]);
+	fpu->x26.x[1] = SWAP_LONG(fpu->x26.x[1]);
+	fpu->x26.x[2] = SWAP_LONG(fpu->x26.x[2]);
+	fpu->x26.x[3] = SWAP_LONG(fpu->x26.x[3]);
+	fpu->x27.x[0] = SWAP_LONG(fpu->x27.x[0]);
+	fpu->x27.x[1] = SWAP_LONG(fpu->x27.x[1]);
+	fpu->x27.x[2] = SWAP_LONG(fpu->x27.x[2]);
+	fpu->x27.x[3] = SWAP_LONG(fpu->x27.x[3]);
+	fpu->x28.x[0] = SWAP_LONG(fpu->x28.x[0]);
+	fpu->x28.x[1] = SWAP_LONG(fpu->x28.x[1]);
+	fpu->x28.x[2] = SWAP_LONG(fpu->x28.x[2]);
+	fpu->x28.x[3] = SWAP_LONG(fpu->x28.x[3]);
+	fpu->x29.x[0] = SWAP_LONG(fpu->x29.x[0]);
+	fpu->x29.x[1] = SWAP_LONG(fpu->x29.x[1]);
+	fpu->x29.x[2] = SWAP_LONG(fpu->x29.x[2]);
+	fpu->x29.x[3] = SWAP_LONG(fpu->x29.x[3]);
+	fpu->x30.x[0] = SWAP_LONG(fpu->x30.x[0]);
+	fpu->x30.x[1] = SWAP_LONG(fpu->x30.x[1]);
+	fpu->x30.x[2] = SWAP_LONG(fpu->x30.x[2]);
+	fpu->x30.x[3] = SWAP_LONG(fpu->x30.x[3]);
+	fpu->x31.x[0] = SWAP_LONG(fpu->x31.x[0]);
+	fpu->x31.x[1] = SWAP_LONG(fpu->x31.x[1]);
+	fpu->x31.x[2] = SWAP_LONG(fpu->x31.x[2]);
+	fpu->x31.x[3] = SWAP_LONG(fpu->x31.x[3]);
+
+	if(target_byte_sex == host_byte_sex){
+	    memcpy(&ssr, &(fpu->fpsr), sizeof(struct swapped_m88k_fpsr));
+	    ssr.u.word = SWAP_LONG(ssr.u.word);
+	    fpu->fpsr.afinx = ssr.u.fields.afinx;
+	    fpu->fpsr.afovf = ssr.u.fields.afovf;
+	    fpu->fpsr.afunf = ssr.u.fields.afunf;
+	    fpu->fpsr.afdvz = ssr.u.fields.afdvz;
+	    fpu->fpsr.afinv = ssr.u.fields.afinv;
+	    fpu->fpsr.xmod = ssr.u.fields.xmod;
+
+	    memcpy(&scr, &(fpu->fpcr), sizeof(struct swapped_m88k_fpcr));
+	    scr.u.word = SWAP_LONG(scr.u.word);
+	    fpu->fpcr.efinx = scr.u.fields.efinx;
+	    fpu->fpcr.efovf = scr.u.fields.efovf;
+	    fpu->fpcr.efunf = scr.u.fields.efunf;
+	    fpu->fpcr.efdvz = scr.u.fields.efdvz;
+	    fpu->fpcr.efinv = scr.u.fields.efinv;
+	    fpu->fpcr.rm = scr.u.fields.rm;
+	}
+	else{
+	    ssr.u.fields.afinx = fpu->fpsr.afinx;
+	    ssr.u.fields.afovf = fpu->fpsr.afovf;
+	    ssr.u.fields.afunf = fpu->fpsr.afunf;
+	    ssr.u.fields.afdvz = fpu->fpsr.afdvz;
+	    ssr.u.fields.afinv = fpu->fpsr.afinv;
+	    ssr.u.fields.xmod = fpu->fpsr.xmod;
+	    ssr.u.word = SWAP_LONG(ssr.u.word);
+	    memcpy(&(fpu->fpsr), &ssr, sizeof(struct swapped_m88k_fpsr));
+
+	    scr.u.fields.efinx = fpu->fpcr.efinx;
+	    scr.u.fields.efovf = fpu->fpcr.efovf;
+	    scr.u.fields.efunf = fpu->fpcr.efunf;
+	    scr.u.fields.efdvz = fpu->fpcr.efdvz;
+	    scr.u.fields.efinv = fpu->fpcr.efinv;
+	    scr.u.fields.rm = fpu->fpcr.rm;
+	    scr.u.word = SWAP_LONG(scr.u.word);
+	    memcpy(&(fpu->fpcr), &scr, sizeof(struct swapped_m88k_fpcr));
+	}
+}
+
+__private_extern__
+void
+swap_m88k_thread_state_user_t(
+m88k_thread_state_user_t *user,
+enum byte_sex target_byte_sex)
+{
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+	user->user = SWAP_LONG(user->user);
+}
+
+__private_extern__
+void
+swap_m88110_thread_state_impl_t(
+m88110_thread_state_impl_t *spu,
+enum byte_sex target_byte_sex)
+{
+    unsigned long i;
+    enum byte_sex host_byte_sex;
+
+    struct swapped_m88110_bp_ctrl {
+	union {
+	    struct {
+		unsigned	v:BIT_WIDTH(0);
+		m88110_match_t	addr_match:BITS_WIDTH(12,1);
+		unsigned	:BITS_WIDTH(26,13);
+		unsigned	rwm:BIT_WIDTH(27);
+		unsigned	rw:BIT_WIDTH(28);
+		unsigned	:BITS_WIDTH(31,29);
+	    } fields;
+	    unsigned long word;
+	} u;
+    } sbpc;
+
+    struct swap_m88110_psr {
+	union {
+	    struct {
+		unsigned	:BITS_WIDTH(1,0);
+		unsigned	mxm_dis:BIT_WIDTH(2);
+		unsigned	sfu1dis:BIT_WIDTH(3);
+		unsigned	:BITS_WIDTH(22,4);
+		unsigned	trace:BIT_WIDTH(23);
+		unsigned	:BIT_WIDTH(24);
+		unsigned	sm:BIT_WIDTH(25);
+		unsigned	sgn_imd:BIT_WIDTH(26);
+		unsigned	:BIT_WIDTH(27);
+		unsigned	c:BIT_WIDTH(28);
+		unsigned	se:BIT_WIDTH(29);
+		unsigned	le:BIT_WIDTH(30);
+		unsigned	supr:BIT_WIDTH(31);
+	    } fields;
+	    unsigned long word;
+	} u;
+    } spsr;
+
+    struct swapped_m88110_fp_trap_status {
+	union {
+	    struct {
+		unsigned	efinx:BIT_WIDTH(0);
+		unsigned	efovf:BIT_WIDTH(1);
+		unsigned	efunf:BIT_WIDTH(2);
+		unsigned	efdvz:BIT_WIDTH(3);
+		unsigned	efinv:BIT_WIDTH(4);
+		unsigned	priv:BIT_WIDTH(5);
+		unsigned	unimp:BIT_WIDTH(6);
+		unsigned	int:BIT_WIDTH(7);
+		unsigned	sfu1_disabled:BIT_WIDTH(8);
+		unsigned	:BITS_WIDTH(13,9);
+		m88110_iresult_size_t	iresult_size:BITS_WIDTH(15,14);
+		unsigned	:BITS_WIDTH(31,16);
+	    } fields;
+	    unsigned long word;
+	} u;
+    } sfps;
+
+	host_byte_sex = get_host_byte_sex();
+
+	if(target_byte_sex == host_byte_sex){
+	    for(i = 0; i < M88110_N_DATA_BP; i++){
+		spu->data_bp[i].addr = SWAP_LONG(spu->data_bp[i].addr);
+		memcpy(&sbpc, &(spu->data_bp[i].ctrl),
+		       sizeof(struct swapped_m88110_bp_ctrl));
+		sbpc.u.word = SWAP_LONG(sbpc.u.word);
+		spu->data_bp[i].ctrl.v = sbpc.u.fields.v;
+		spu->data_bp[i].ctrl.addr_match = sbpc.u.fields.addr_match;
+		spu->data_bp[i].ctrl.rwm = sbpc.u.fields.rwm;
+		spu->data_bp[i].ctrl.rw = sbpc.u.fields.rw;
+	    }
+
+	    memcpy(&spsr, &(spu->psr), sizeof(struct swap_m88110_psr));
+	    spsr.u.word = SWAP_LONG(spsr.u.word);
+	    spu->psr.mxm_dis = spsr.u.fields.mxm_dis;
+	    spu->psr.sfu1dis = spsr.u.fields.sfu1dis;
+	    spu->psr.trace = spsr.u.fields.trace;
+	    spu->psr.sm = spsr.u.fields.sm;
+	    spu->psr.sgn_imd = spsr.u.fields.sgn_imd;
+	    spu->psr.c = spsr.u.fields.c;
+	    spu->psr.se = spsr.u.fields.se;
+	    spu->psr.le = spsr.u.fields.le;
+	    spu->psr.supr = spsr.u.fields.supr;
+
+	    memcpy(&sfps, &(spu->fp_trap_status),
+		   sizeof(struct swapped_m88110_fp_trap_status));
+	    sfps.u.word = SWAP_LONG(sfps.u.word);
+	    spu->fp_trap_status.efinx = sfps.u.fields.efinx;
+	    spu->fp_trap_status.efovf = sfps.u.fields.efovf;
+	    spu->fp_trap_status.efunf = sfps.u.fields.efunf;
+	    spu->fp_trap_status.efdvz = sfps.u.fields.efdvz;
+	    spu->fp_trap_status.efinv = sfps.u.fields.efinv;
+	    spu->fp_trap_status.priv = sfps.u.fields.priv;
+	    spu->fp_trap_status.unimp = sfps.u.fields.unimp;
+	    spu->fp_trap_status.sfu1_disabled = sfps.u.fields.sfu1_disabled;
+	    spu->fp_trap_status.iresult_size = sfps.u.fields.iresult_size;
+	}
+	else{
+	    for(i = 0; i < M88110_N_DATA_BP; i++){
+		spu->data_bp[i].addr = SWAP_LONG(spu->data_bp[i].addr);
+		sbpc.u.fields.v = spu->data_bp[i].ctrl.v;
+		sbpc.u.fields.addr_match = spu->data_bp[i].ctrl.addr_match;
+		sbpc.u.fields.rwm = spu->data_bp[i].ctrl.rwm;
+		sbpc.u.fields.rw = spu->data_bp[i].ctrl.rw;
+		sbpc.u.word = SWAP_LONG(sbpc.u.word);
+		memcpy(&(spu->data_bp[i].ctrl), &sbpc,
+		       sizeof(struct swapped_m88110_bp_ctrl));
+	    }
+
+	    spsr.u.fields.mxm_dis = spu->psr.mxm_dis;
+	    spsr.u.fields.sfu1dis = spu->psr.sfu1dis;
+	    spsr.u.fields.trace = spu->psr.trace;
+	    spsr.u.fields.sm = spu->psr.sm;
+	    spsr.u.fields.sgn_imd = spu->psr.sgn_imd;
+	    spsr.u.fields.c = spu->psr.c;
+	    spsr.u.fields.se = spu->psr.se;
+	    spsr.u.fields.le = spu->psr.le;
+	    spsr.u.fields.supr = spu->psr.supr;
+	    spsr.u.word = SWAP_LONG(spsr.u.word);
+	    memcpy(&(spu->psr), &spsr, sizeof(struct swap_m88110_psr));
+
+	    sfps.u.fields.efinx = spu->fp_trap_status.efinx;
+	    sfps.u.fields.efovf = spu->fp_trap_status.efovf;
+	    sfps.u.fields.efunf = spu->fp_trap_status.efunf;
+	    sfps.u.fields.efdvz = spu->fp_trap_status.efdvz;
+	    sfps.u.fields.efinv = spu->fp_trap_status.efinv;
+	    sfps.u.fields.priv = spu->fp_trap_status.priv;
+	    sfps.u.fields.unimp = spu->fp_trap_status.unimp;
+	    sfps.u.fields.sfu1_disabled = spu->fp_trap_status.sfu1_disabled;
+	    sfps.u.fields.iresult_size = spu->fp_trap_status.iresult_size;
+	    sfps.u.word = SWAP_LONG(sfps.u.word);
+	    memcpy(&(spu->fp_trap_status), &sfps,
+		   sizeof(struct swapped_m88110_fp_trap_status));
+	}
+	spu->intermediate_result.x[0] =
+	    SWAP_LONG(spu->intermediate_result.x[0]);
+	spu->intermediate_result.x[1] =
+	    SWAP_LONG(spu->intermediate_result.x[1]);
+	spu->intermediate_result.x[2] =
+	    SWAP_LONG(spu->intermediate_result.x[2]);
+	spu->intermediate_result.x[3] =
+	    SWAP_LONG(spu->intermediate_result.x[3]);
+}
+
+__private_extern__
+void
+swap_i860_thread_state_regs(
+struct i860_thread_state_regs *cpu,
+enum byte_sex target_byte_sex)
+{
+    unsigned long i;
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+
+	for(i = 0; i < 31; i++)
+	    cpu->ireg[i] = SWAP_LONG(cpu->ireg[i]);
+	for(i = 0; i < 30; i++)
+	    cpu->freg[i] = SWAP_LONG(cpu->freg[i]);
+	cpu->psr = SWAP_LONG(cpu->psr);
+	cpu->epsr = SWAP_LONG(cpu->epsr);
+	cpu->db = SWAP_LONG(cpu->db);
+	cpu->pc = SWAP_LONG(cpu->pc);
+	cpu->_padding_ = SWAP_LONG(cpu->_padding_);
+	cpu->Mres3 = SWAP_DOUBLE(cpu->Mres3);
+	cpu->Ares3 = SWAP_DOUBLE(cpu->Ares3);
+	cpu->Mres2 = SWAP_DOUBLE(cpu->Mres2);
+	cpu->Ares2 = SWAP_DOUBLE(cpu->Ares2);
+	cpu->Mres1 = SWAP_DOUBLE(cpu->Mres1);
+	cpu->Ares1 = SWAP_DOUBLE(cpu->Ares1);
+	cpu->Ires1 = SWAP_DOUBLE(cpu->Ires1);
+	cpu->Lres3m = SWAP_DOUBLE(cpu->Lres3m);
+	cpu->Lres2m = SWAP_DOUBLE(cpu->Lres2m);
+	cpu->Lres1m = SWAP_DOUBLE(cpu->Lres1m);
+	cpu->KR = SWAP_DOUBLE(cpu->KR);
+	cpu->KI = SWAP_DOUBLE(cpu->KI);
+	cpu->T = SWAP_DOUBLE(cpu->T);
+	cpu->Fsr3 = SWAP_LONG(cpu->Fsr3);
+	cpu->Fsr2 = SWAP_LONG(cpu->Fsr2);
+	cpu->Fsr1 = SWAP_LONG(cpu->Fsr1);
+	cpu->Mergelo32 = SWAP_LONG(cpu->Mergelo32);
+	cpu->Mergehi32 = SWAP_LONG(cpu->Mergehi32);
+}
+
+__private_extern__
+void
+swap_i386_thread_state(
+i386_thread_state_t *cpu,
+enum byte_sex target_byte_sex)
+{
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+	cpu->eax = SWAP_LONG(cpu->eax);
+	cpu->ebx = SWAP_LONG(cpu->ebx);
+	cpu->ecx = SWAP_LONG(cpu->ecx);
+	cpu->edx = SWAP_LONG(cpu->edx);
+	cpu->edi = SWAP_LONG(cpu->edi);
+	cpu->esi = SWAP_LONG(cpu->esi);
+	cpu->ebp = SWAP_LONG(cpu->ebp);
+	cpu->esp = SWAP_LONG(cpu->esp);
+	cpu->ss = SWAP_LONG(cpu->ss);
+	cpu->eflags = SWAP_LONG(cpu->eflags);
+	cpu->eip = SWAP_LONG(cpu->eip);
+	cpu->cs = SWAP_LONG(cpu->cs);
+	cpu->ds = SWAP_LONG(cpu->ds);
+	cpu->es = SWAP_LONG(cpu->es);
+	cpu->fs = SWAP_LONG(cpu->fs);
+	cpu->gs = SWAP_LONG(cpu->gs);
+}
+
+__private_extern__
+void
+swap_i386_thread_fpstate(
+i386_thread_fpstate_t *fpu,
+enum byte_sex target_byte_sex)
+{
+    struct swapped_fp_control {
+	union {
+	    struct {
+		unsigned short
+			    :3,
+		    /*inf*/ :1,
+		    rc	    :2,
+		    pc	    :2,
+			    :2,
+		    precis  :1,
+		    undfl   :1,
+		    ovrfl   :1,
+		    zdiv    :1,
+		    denorm  :1,
+		    invalid :1;
+	    } fields;
+	    unsigned short half;
+	} u;
+    } sfpc;
+
+    struct swapped_fp_status {
+	union {
+	    struct {
+		unsigned short
+		    busy    :1,
+		    c3	    :1,
+		    tos	    :3,
+		    c2	    :1,
+		    c1	    :1,
+		    c0	    :1,
+		    errsumm :1,
+		    stkflt  :1,
+		    precis  :1,
+		    undfl   :1,
+		    ovrfl   :1,
+		    zdiv    :1,
+		    denorm  :1,
+		    invalid :1;
+	    } fields;
+	    unsigned short half;
+	} u;
+    } sfps;
+
+    struct swapped_fp_tag {
+	union {
+	    struct {
+		unsigned short
+		    tag7 :2,
+		    tag6 :2,
+		    tag5 :2,
+		    tag4 :2,
+		    tag3 :2,
+		    tag2 :2,
+		    tag1 :2,
+		    tag0 :2;
+	    } fields;
+	    unsigned short half;
+	} u;
+    } sfpt;
+
+    struct swapped_fp_data_reg {
+	unsigned short mant;
+	unsigned short mant1 :16,
+		       mant2 :16,
+		       mant3 :16;
+	union {
+	    struct {
+		unsigned short sign :1,
+			       exp  :15;
+	    } fields;
+	    unsigned short half;
+	} u;
+    } sfpd;
+
+    struct swapped_sel {
+	union {
+	    struct {
+    		unsigned short
+		    index :13,
+		    ti    :1,
+		    rpl   :2;
+	    } fields;
+	    unsigned short half;
+	} u;
+    } ss;
+
+    enum byte_sex host_byte_sex;
+    unsigned long i;
+
+	host_byte_sex = get_host_byte_sex();
+
+	fpu->environ.ip = SWAP_LONG(fpu->environ.ip);
+	fpu->environ.opcode = SWAP_SHORT(fpu->environ.opcode);
+	fpu->environ.dp = SWAP_LONG(fpu->environ.dp);
+
+	if(target_byte_sex == host_byte_sex){
+	    memcpy(&sfpc, &(fpu->environ.control),
+		   sizeof(struct swapped_fp_control));
+	    sfpc.u.half = SWAP_SHORT(sfpc.u.half);
+	    fpu->environ.control.rc = sfpc.u.fields.rc;
+	    fpu->environ.control.pc = sfpc.u.fields.pc;
+	    fpu->environ.control.precis = sfpc.u.fields.precis;
+	    fpu->environ.control.undfl = sfpc.u.fields.undfl;
+	    fpu->environ.control.ovrfl = sfpc.u.fields.ovrfl;
+	    fpu->environ.control.zdiv = sfpc.u.fields.zdiv;
+	    fpu->environ.control.denorm = sfpc.u.fields.denorm;
+	    fpu->environ.control.invalid = sfpc.u.fields.invalid;
+
+	    memcpy(&sfps, &(fpu->environ.status),
+		   sizeof(struct swapped_fp_status));
+	    sfps.u.half = SWAP_SHORT(sfps.u.half);
+	    fpu->environ.status.busy = sfps.u.fields.busy;
+	    fpu->environ.status.c3 = sfps.u.fields.c3;
+	    fpu->environ.status.tos = sfps.u.fields.tos;
+	    fpu->environ.status.c2 = sfps.u.fields.c2;
+	    fpu->environ.status.c1 = sfps.u.fields.c1;
+	    fpu->environ.status.c0 = sfps.u.fields.c0;
+	    fpu->environ.status.errsumm = sfps.u.fields.errsumm;
+	    fpu->environ.status.stkflt = sfps.u.fields.stkflt;
+	    fpu->environ.status.precis = sfps.u.fields.precis;
+	    fpu->environ.status.undfl = sfps.u.fields.undfl;
+	    fpu->environ.status.ovrfl = sfps.u.fields.ovrfl;
+	    fpu->environ.status.zdiv = sfps.u.fields.zdiv;
+	    fpu->environ.status.denorm = sfps.u.fields.denorm;
+	    fpu->environ.status.invalid = sfps.u.fields.invalid;
+
+	    memcpy(&sfpt, &(fpu->environ.tag),
+		   sizeof(struct swapped_fp_tag));
+	    sfpt.u.half = SWAP_SHORT(sfpt.u.half);
+	    fpu->environ.tag.tag7 = sfpt.u.fields.tag7;
+	    fpu->environ.tag.tag6 = sfpt.u.fields.tag6;
+	    fpu->environ.tag.tag5 = sfpt.u.fields.tag5;
+	    fpu->environ.tag.tag4 = sfpt.u.fields.tag4;
+	    fpu->environ.tag.tag3 = sfpt.u.fields.tag3;
+	    fpu->environ.tag.tag2 = sfpt.u.fields.tag2;
+	    fpu->environ.tag.tag1 = sfpt.u.fields.tag1;
+	    fpu->environ.tag.tag0 = sfpt.u.fields.tag0;
+
+	    memcpy(&ss, &(fpu->environ.cs),
+		   sizeof(struct swapped_sel));
+	    ss.u.half = SWAP_SHORT(ss.u.half);
+	    fpu->environ.cs.index = ss.u.fields.index;
+	    fpu->environ.cs.ti = ss.u.fields.ti;
+	    fpu->environ.cs.rpl = ss.u.fields.rpl;
+
+	    memcpy(&ss, &(fpu->environ.ds),
+		   sizeof(struct swapped_sel));
+	    ss.u.half = SWAP_SHORT(ss.u.half);
+	    fpu->environ.ds.index = ss.u.fields.index;
+	    fpu->environ.ds.ti = ss.u.fields.ti;
+	    fpu->environ.ds.rpl = ss.u.fields.rpl;
+	
+	    for(i = 0; i < 8; i++){
+		memcpy(&sfpd, &(fpu->stack.ST[i]),
+		       sizeof(struct swapped_fp_data_reg));
+		fpu->stack.ST[i].mant = SWAP_SHORT(sfpd.mant);
+		fpu->stack.ST[i].mant1 = SWAP_SHORT(sfpd.mant1);
+		fpu->stack.ST[i].mant2 = SWAP_SHORT(sfpd.mant2);
+		fpu->stack.ST[i].mant3 = SWAP_SHORT(sfpd.mant3);
+		sfpd.u.half = SWAP_SHORT(sfpd.u.half);
+		fpu->stack.ST[i].exp = sfpd.u.fields.exp;
+		fpu->stack.ST[i].sign = sfpd.u.fields.sign;
+	    }
+	}
+	else{
+	    sfpc.u.fields.rc = fpu->environ.control.rc;
+	    sfpc.u.fields.pc = fpu->environ.control.pc;
+	    sfpc.u.fields.precis = fpu->environ.control.precis;
+	    sfpc.u.fields.undfl = fpu->environ.control.undfl;
+	    sfpc.u.fields.ovrfl = fpu->environ.control.ovrfl;
+	    sfpc.u.fields.zdiv = fpu->environ.control.zdiv;
+	    sfpc.u.fields.denorm = fpu->environ.control.denorm;
+	    sfpc.u.fields.invalid = fpu->environ.control.invalid;
+	    sfpc.u.half = SWAP_SHORT(sfpc.u.half);
+	    memcpy(&(fpu->environ.control), &sfpc,
+		   sizeof(struct swapped_fp_control));
+
+	    sfps.u.fields.busy = fpu->environ.status.busy;
+	    sfps.u.fields.c3 = fpu->environ.status.c3;
+	    sfps.u.fields.tos = fpu->environ.status.tos;
+	    sfps.u.fields.c2 = fpu->environ.status.c2;
+	    sfps.u.fields.c1 = fpu->environ.status.c1;
+	    sfps.u.fields.c0 = fpu->environ.status.c0;
+	    sfps.u.fields.errsumm = fpu->environ.status.errsumm;
+	    sfps.u.fields.stkflt = fpu->environ.status.stkflt;
+	    sfps.u.fields.precis = fpu->environ.status.precis;
+	    sfps.u.fields.undfl = fpu->environ.status.undfl;
+	    sfps.u.fields.ovrfl = fpu->environ.status.ovrfl;
+	    sfps.u.fields.zdiv = fpu->environ.status.zdiv;
+	    sfps.u.fields.denorm = fpu->environ.status.denorm;
+	    sfps.u.fields.invalid = fpu->environ.status.invalid;
+	    sfps.u.half = SWAP_SHORT(sfps.u.half);
+	    memcpy(&(fpu->environ.status), &sfps,
+		   sizeof(struct swapped_fp_status));
+
+	    sfpt.u.fields.tag7 = fpu->environ.tag.tag7;
+	    sfpt.u.fields.tag6 = fpu->environ.tag.tag6;
+	    sfpt.u.fields.tag5 = fpu->environ.tag.tag5;
+	    sfpt.u.fields.tag4 = fpu->environ.tag.tag4;
+	    sfpt.u.fields.tag3 = fpu->environ.tag.tag3;
+	    sfpt.u.fields.tag2 = fpu->environ.tag.tag2;
+	    sfpt.u.fields.tag1 = fpu->environ.tag.tag1;
+	    sfpt.u.fields.tag0 = fpu->environ.tag.tag0;
+	    sfpt.u.half = SWAP_SHORT(sfpt.u.half);
+	    memcpy(&(fpu->environ.tag), &sfpt,
+		   sizeof(struct swapped_fp_tag));
+
+	    ss.u.fields.index = fpu->environ.cs.index;
+	    ss.u.fields.ti = fpu->environ.cs.ti;
+	    ss.u.fields.rpl = fpu->environ.cs.rpl;
+	    ss.u.half = SWAP_SHORT(ss.u.half);
+	    memcpy(&(fpu->environ.cs), &ss,
+		   sizeof(struct swapped_sel));
+
+	    ss.u.fields.index = fpu->environ.ds.index;
+	    ss.u.fields.ti = fpu->environ.ds.ti;
+	    ss.u.fields.rpl = fpu->environ.ds.rpl;
+	    ss.u.half = SWAP_SHORT(ss.u.half);
+	    memcpy(&(fpu->environ.cs), &ss,
+		   sizeof(struct swapped_sel));
+
+	    for(i = 0; i < 8; i++){
+		sfpd.mant = SWAP_SHORT(fpu->stack.ST[i].mant);
+		sfpd.mant1 = SWAP_SHORT(fpu->stack.ST[i].mant1);
+		sfpd.mant2 = SWAP_SHORT(fpu->stack.ST[i].mant2);
+		sfpd.mant3 = SWAP_SHORT(fpu->stack.ST[i].mant3);
+		sfpd.u.fields.exp = fpu->stack.ST[i].exp;
+		sfpd.u.fields.sign = fpu->stack.ST[i].sign;
+		sfpd.u.half = SWAP_SHORT(sfpd.u.half);
+		memcpy(&(fpu->stack.ST[i]), &sfpd,
+		       sizeof(struct swapped_fp_data_reg));
+	    }
+	}
+}
+
+__private_extern__
+void
+swap_i386_thread_exceptstate(
+i386_thread_exceptstate_t *exc,
+enum byte_sex target_byte_sex)
+{
+    struct swapped_err_code {
+	union {
+	    struct err_code_normal {
+		unsigned int		:16,
+				index	:13,
+				tbl	:2,
+				ext	:1;
+	    } normal;
+	    struct err_code_pgfault {
+		unsigned int		:29,
+				user	:1,
+				wrtflt	:1,
+				prot	:1;
+	    } pgfault;
+	    unsigned long word;
+	} u;
+    } sec;
+    unsigned long word;
+    enum byte_sex host_byte_sex;
+
+	host_byte_sex = get_host_byte_sex();
+
+	exc->trapno = SWAP_LONG(exc->trapno);
+	if(exc->trapno == 14){
+	    if(target_byte_sex == host_byte_sex){
+		memcpy(&sec, &(exc->err), sizeof(struct swapped_err_code));
+		sec.u.word = SWAP_LONG(sec.u.word);
+		exc->err.pgfault.user   = sec.u.pgfault.user;
+		exc->err.pgfault.wrtflt = sec.u.pgfault.wrtflt;
+		exc->err.pgfault.prot   = sec.u.pgfault.prot;
+	    }
+	    else{
+		sec.u.pgfault.prot   = exc->err.pgfault.prot;
+		sec.u.pgfault.wrtflt = exc->err.pgfault.wrtflt;
+		sec.u.pgfault.user   = exc->err.pgfault.user;
+		sec.u.word = SWAP_LONG(sec.u.word);
+		memcpy(&(exc->err), &sec, sizeof(struct swapped_err_code));
+	    }
+	}
+	else{
+	    if(target_byte_sex == host_byte_sex){
+		memcpy(&sec, &(exc->err), sizeof(struct swapped_err_code));
+		sec.u.word = SWAP_LONG(sec.u.word);
+		word = sec.u.normal.index;
+		exc->err.normal.index = SWAP_LONG(word);
+		exc->err.normal.tbl   = sec.u.normal.tbl;
+		exc->err.normal.ext   = sec.u.normal.ext;
+	    }
+	    else{
+		sec.u.normal.ext   = exc->err.normal.ext;
+		sec.u.normal.tbl   = exc->err.normal.tbl;
+		word = exc->err.normal.index;
+		sec.u.normal.index = SWAP_LONG(word);
+		sec.u.word = SWAP_LONG(sec.u.word);
+		memcpy(&(exc->err), &sec, sizeof(struct swapped_err_code));
+	    }
+	}
+}
+
+__private_extern__
+void
+swap_i386_thread_cthreadstate(
+i386_thread_cthreadstate_t *user,
+enum byte_sex target_byte_sex)
+{
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+	user->self = SWAP_LONG(user->self);
+}
+
+__private_extern__
+void
+swap_hppa_integer_thread_state(
+struct hp_pa_integer_thread_state *regs,
+enum byte_sex target_byte_sex)
+{
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+	regs->ts_gr1 = SWAP_LONG(regs->ts_gr1);
+	regs->ts_gr2 = SWAP_LONG(regs->ts_gr2);
+	regs->ts_gr3 = SWAP_LONG(regs->ts_gr3);
+	regs->ts_gr4 = SWAP_LONG(regs->ts_gr4);
+	regs->ts_gr5 = SWAP_LONG(regs->ts_gr5);
+	regs->ts_gr6 = SWAP_LONG(regs->ts_gr6);
+	regs->ts_gr7 = SWAP_LONG(regs->ts_gr7);
+	regs->ts_gr8 = SWAP_LONG(regs->ts_gr8);
+	regs->ts_gr9 = SWAP_LONG(regs->ts_gr9);
+	regs->ts_gr10 = SWAP_LONG(regs->ts_gr10);
+	regs->ts_gr11 = SWAP_LONG(regs->ts_gr11);
+	regs->ts_gr12 = SWAP_LONG(regs->ts_gr12);
+	regs->ts_gr13 = SWAP_LONG(regs->ts_gr13);
+	regs->ts_gr14 = SWAP_LONG(regs->ts_gr14);
+	regs->ts_gr15 = SWAP_LONG(regs->ts_gr15);
+	regs->ts_gr16 = SWAP_LONG(regs->ts_gr16);
+	regs->ts_gr17 = SWAP_LONG(regs->ts_gr17);
+	regs->ts_gr18 = SWAP_LONG(regs->ts_gr18);
+	regs->ts_gr19 = SWAP_LONG(regs->ts_gr19);
+	regs->ts_gr20 = SWAP_LONG(regs->ts_gr20);
+	regs->ts_gr21 = SWAP_LONG(regs->ts_gr21);
+	regs->ts_gr22 = SWAP_LONG(regs->ts_gr22);
+	regs->ts_gr23 = SWAP_LONG(regs->ts_gr23);
+	regs->ts_gr24 = SWAP_LONG(regs->ts_gr24);
+	regs->ts_gr25 = SWAP_LONG(regs->ts_gr25);
+	regs->ts_gr26 = SWAP_LONG(regs->ts_gr26);
+	regs->ts_gr27 = SWAP_LONG(regs->ts_gr27);
+	regs->ts_gr28 = SWAP_LONG(regs->ts_gr28);
+	regs->ts_gr29 = SWAP_LONG(regs->ts_gr29);
+	regs->ts_gr30 = SWAP_LONG(regs->ts_gr30);
+	regs->ts_gr31 = SWAP_LONG(regs->ts_gr31);
+	regs->ts_sr0 = SWAP_LONG(regs->ts_sr0);
+	regs->ts_sr1 = SWAP_LONG(regs->ts_sr1);
+	regs->ts_sr2 = SWAP_LONG(regs->ts_sr2);
+	regs->ts_sr3 = SWAP_LONG(regs->ts_sr3);
+	regs->ts_sar = SWAP_LONG(regs->ts_sar);
+}
+
+__private_extern__
+void swap_hppa_frame_thread_state(
+struct hp_pa_frame_thread_state *frame,
+enum byte_sex target_byte_sex)
+{
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+	frame->ts_pcsq_front = SWAP_LONG(frame->ts_pcsq_front);
+	frame->ts_pcsq_back = SWAP_LONG(frame->ts_pcsq_back);
+	frame->ts_pcoq_front = SWAP_LONG(frame->ts_pcoq_front);
+	frame->ts_pcoq_back = SWAP_LONG(frame->ts_pcoq_back);
+	frame->ts_psw = SWAP_LONG(frame->ts_psw);
+	frame->ts_unaligned_faults = SWAP_LONG(frame->ts_unaligned_faults);
+	frame->ts_fault_address = SWAP_LONG(frame->ts_fault_address);
+	frame->ts_step_range_start = SWAP_LONG(frame->ts_step_range_start);
+	frame->ts_step_range_stop = SWAP_LONG(frame->ts_step_range_stop);
+}
+
+__private_extern__
+void swap_hppa_fp_thread_state(
+struct hp_pa_fp_thread_state *fp,
+enum byte_sex target_byte_sex)
+{
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+	fp->ts_fp0 = SWAP_DOUBLE(fp->ts_fp0);
+	fp->ts_fp1 = SWAP_DOUBLE(fp->ts_fp1);
+	fp->ts_fp2 = SWAP_DOUBLE(fp->ts_fp2);
+	fp->ts_fp3 = SWAP_DOUBLE(fp->ts_fp3);
+	fp->ts_fp4 = SWAP_DOUBLE(fp->ts_fp4);
+	fp->ts_fp5 = SWAP_DOUBLE(fp->ts_fp5);
+	fp->ts_fp6 = SWAP_DOUBLE(fp->ts_fp6);
+	fp->ts_fp7 = SWAP_DOUBLE(fp->ts_fp7);
+	fp->ts_fp8 = SWAP_DOUBLE(fp->ts_fp8);
+	fp->ts_fp9 = SWAP_DOUBLE(fp->ts_fp9);
+	fp->ts_fp10 = SWAP_DOUBLE(fp->ts_fp10);
+	fp->ts_fp11 = SWAP_DOUBLE(fp->ts_fp11);
+	fp->ts_fp12 = SWAP_DOUBLE(fp->ts_fp12);
+	fp->ts_fp13 = SWAP_DOUBLE(fp->ts_fp13);
+	fp->ts_fp14 = SWAP_DOUBLE(fp->ts_fp14);
+	fp->ts_fp15 = SWAP_DOUBLE(fp->ts_fp15);
+	fp->ts_fp16 = SWAP_DOUBLE(fp->ts_fp16);
+	fp->ts_fp17 = SWAP_DOUBLE(fp->ts_fp17);
+	fp->ts_fp18 = SWAP_DOUBLE(fp->ts_fp18);
+	fp->ts_fp19 = SWAP_DOUBLE(fp->ts_fp19);
+	fp->ts_fp20 = SWAP_DOUBLE(fp->ts_fp20);
+	fp->ts_fp21 = SWAP_DOUBLE(fp->ts_fp21);
+	fp->ts_fp22 = SWAP_DOUBLE(fp->ts_fp22);
+	fp->ts_fp23 = SWAP_DOUBLE(fp->ts_fp23);
+	fp->ts_fp24 = SWAP_DOUBLE(fp->ts_fp24);
+	fp->ts_fp25 = SWAP_DOUBLE(fp->ts_fp25);
+	fp->ts_fp26 = SWAP_DOUBLE(fp->ts_fp26);
+	fp->ts_fp27 = SWAP_DOUBLE(fp->ts_fp27);
+	fp->ts_fp28 = SWAP_DOUBLE(fp->ts_fp28);
+	fp->ts_fp29 = SWAP_DOUBLE(fp->ts_fp29);
+	fp->ts_fp30 = SWAP_DOUBLE(fp->ts_fp30);
+	fp->ts_fp31 = SWAP_DOUBLE(fp->ts_fp31);
+}
+
+__private_extern__
+void
+swap_sparc_thread_state_regs(
+struct sparc_thread_state_regs *cpu,
+enum byte_sex target_byte_sex)
+{
+    struct swapped_psr {
+	union {
+	    struct {
+		unsigned int 
+		cwp:BITS_WIDTH(4,0),
+		et:BIT_WIDTH(5),
+		ps:BIT_WIDTH(6),
+		s:BIT_WIDTH(7),
+		pil:BITS_WIDTH(11,8),
+		ef:BIT_WIDTH(12),
+		ec:BIT_WIDTH(13),
+		reserved:BITS_WIDTH(19,14),
+		icc:BITS_WIDTH(23,20),
+		ver:BITS_WIDTH(27,24),
+		impl:BITS_WIDTH(31,28);
+	    } fields;
+	    unsigned int word;
+	} u;
+    } spsr;
+    struct p_status *pr_status;
+    enum byte_sex host_byte_sex;
+
+	host_byte_sex = get_host_byte_sex();
+
+	cpu->regs.r_pc = SWAP_LONG(cpu->regs.r_pc);
+	cpu->regs.r_npc = SWAP_LONG(cpu->regs.r_npc);
+	cpu->regs.r_y = SWAP_LONG(cpu->regs.r_y);
+	cpu->regs.r_g1 = SWAP_LONG(cpu->regs.r_g1);
+	cpu->regs.r_g2 = SWAP_LONG(cpu->regs.r_g2);
+	cpu->regs.r_g3 = SWAP_LONG(cpu->regs.r_g3);
+	cpu->regs.r_g4 = SWAP_LONG(cpu->regs.r_g4);
+	cpu->regs.r_g5 = SWAP_LONG(cpu->regs.r_g5);
+	cpu->regs.r_g6 = SWAP_LONG(cpu->regs.r_g6);
+	cpu->regs.r_g7 = SWAP_LONG(cpu->regs.r_g7);
+	cpu->regs.r_o0 = SWAP_LONG(cpu->regs.r_o0);
+	cpu->regs.r_o1 = SWAP_LONG(cpu->regs.r_o1);
+	cpu->regs.r_o2 = SWAP_LONG(cpu->regs.r_o2);
+	cpu->regs.r_o3 = SWAP_LONG(cpu->regs.r_o3);
+	cpu->regs.r_o4 = SWAP_LONG(cpu->regs.r_o4);
+	cpu->regs.r_o5 = SWAP_LONG(cpu->regs.r_o5);
+	cpu->regs.r_o6 = SWAP_LONG(cpu->regs.r_o6);
+	cpu->regs.r_o7 = SWAP_LONG(cpu->regs.r_o7);
+
+    	pr_status = (struct p_status *) &(cpu->regs.r_psr);
+	if(target_byte_sex == host_byte_sex){
+	    memcpy(&spsr, &(cpu->regs.r_psr), sizeof(struct swapped_psr));
+	    spsr.u.word = SWAP_LONG(spsr.u.word);
+	    pr_status->PSRREG.psr_bits.cwp = spsr.u.fields.cwp;
+	    pr_status->PSRREG.psr_bits.ps = spsr.u.fields.ps;
+	    pr_status->PSRREG.psr_bits.s = spsr.u.fields.s;
+	    pr_status->PSRREG.psr_bits.pil = spsr.u.fields.pil;
+	    pr_status->PSRREG.psr_bits.ef = spsr.u.fields.ef;
+	    pr_status->PSRREG.psr_bits.ec = spsr.u.fields.ec;
+	    pr_status->PSRREG.psr_bits.reserved = spsr.u.fields.reserved;
+	    pr_status->PSRREG.psr_bits.icc = spsr.u.fields.icc;
+	    pr_status->PSRREG.psr_bits.et = spsr.u.fields.ver;
+	    pr_status->PSRREG.psr_bits.impl = spsr.u.fields.impl;
+	}
+	else{
+	    spsr.u.fields.cwp = pr_status->PSRREG.psr_bits.cwp;
+	    spsr.u.fields.ps = pr_status->PSRREG.psr_bits.ps;
+	    spsr.u.fields.s = pr_status->PSRREG.psr_bits.s;
+	    spsr.u.fields.pil = pr_status->PSRREG.psr_bits.pil;
+	    spsr.u.fields.ef = pr_status->PSRREG.psr_bits.ef;
+	    spsr.u.fields.ec = pr_status->PSRREG.psr_bits.ec;
+	    spsr.u.fields.reserved = pr_status->PSRREG.psr_bits.reserved;
+	    spsr.u.fields.icc = pr_status->PSRREG.psr_bits.icc;
+	    spsr.u.fields.ver = pr_status->PSRREG.psr_bits.et;
+	    spsr.u.fields.impl = pr_status->PSRREG.psr_bits.impl;
+	    spsr.u.word = SWAP_LONG(spsr.u.word);
+	    memcpy(&(cpu->regs.r_psr), &spsr, sizeof(struct swapped_psr));
+	}
+}
+
+__private_extern__
+void
+swap_sparc_thread_state_fpu(
+struct sparc_thread_state_fpu *fpu,
+enum byte_sex target_byte_sex)
+{
+    struct swapped_fsr {
+	union {
+	    struct {
+		unsigned int
+		cexc:BITS_WIDTH(4,0),
+		aexc:BITS_WIDTH(9,5),
+		fcc:BITS_WIDTH(11,10),
+		pr:BIT_WIDTH(12),
+		qne:BIT_WIDTH(13),
+		ftt:BITS_WIDTH(16,14),
+		res:BITS_WIDTH(22,17),
+		tem:BITS_WIDTH(27,23),
+		rp:BITS_WIDTH(29,28),
+		rd:BITS_WIDTH(31,30);
+	    } fields;
+	    unsigned int word;
+	} u;
+    } sfsr;
+    unsigned long i;
+    struct f_status *fpu_status;
+    enum byte_sex host_byte_sex;
+
+	host_byte_sex = get_host_byte_sex();
+
+	
+	/* floating point registers */
+	for(i = 0; i < 16; i++)		/* 16 doubles */
+	    fpu->fpu.fpu_fr.Fpu_dregs[i] =
+		SWAP_DOUBLE(fpu->fpu.fpu_fr.Fpu_dregs[i]);
+
+	fpu->fpu.Fpu_q[0].FQu.whole = SWAP_DOUBLE(fpu->fpu.Fpu_q[0].FQu.whole);
+	fpu->fpu.Fpu_q[1].FQu.whole = SWAP_DOUBLE(fpu->fpu.Fpu_q[1].FQu.whole);
+	fpu->fpu.Fpu_flags = SWAP_LONG(fpu->fpu.Fpu_flags);
+	fpu->fpu.Fpu_extra = SWAP_LONG(fpu->fpu.Fpu_extra);
+	fpu->fpu.Fpu_qcnt = SWAP_LONG(fpu->fpu.Fpu_qcnt);
+
+	fpu_status = (struct f_status *) &(fpu->fpu.Fpu_fsr);
+	if(target_byte_sex == host_byte_sex){
+	    memcpy(&sfsr, &(fpu->fpu.Fpu_fsr), sizeof(unsigned int));
+	    sfsr.u.word = SWAP_LONG(sfsr.u.word);
+	    fpu_status->FPUREG.Fpu_fsr_bits.rd = sfsr.u.fields.rd;
+	    fpu_status->FPUREG.Fpu_fsr_bits.rp = sfsr.u.fields.rp;
+	    fpu_status->FPUREG.Fpu_fsr_bits.tem = sfsr.u.fields.tem;
+	    fpu_status->FPUREG.Fpu_fsr_bits.res = sfsr.u.fields.res;
+	    fpu_status->FPUREG.Fpu_fsr_bits.ftt = sfsr.u.fields.ftt;
+	    fpu_status->FPUREG.Fpu_fsr_bits.qne = sfsr.u.fields.qne;
+	    fpu_status->FPUREG.Fpu_fsr_bits.pr = sfsr.u.fields.pr;
+	    fpu_status->FPUREG.Fpu_fsr_bits.fcc = sfsr.u.fields.fcc;
+	    fpu_status->FPUREG.Fpu_fsr_bits.aexc = sfsr.u.fields.aexc;
+	    fpu_status->FPUREG.Fpu_fsr_bits.cexc = sfsr.u.fields.cexc;
+	}
+	else{
+	    sfsr.u.fields.rd = fpu_status->FPUREG.Fpu_fsr_bits.rd;
+	    sfsr.u.fields.rp = fpu_status->FPUREG.Fpu_fsr_bits.rp;
+	    sfsr.u.fields.tem = fpu_status->FPUREG.Fpu_fsr_bits.tem;
+	    sfsr.u.fields.res = fpu_status->FPUREG.Fpu_fsr_bits.res;
+	    sfsr.u.fields.ftt = fpu_status->FPUREG.Fpu_fsr_bits.ftt;
+	    sfsr.u.fields.qne = fpu_status->FPUREG.Fpu_fsr_bits.qne;
+	    sfsr.u.fields.pr = fpu_status->FPUREG.Fpu_fsr_bits.pr;
+	    sfsr.u.fields.fcc = fpu_status->FPUREG.Fpu_fsr_bits.fcc;
+	    sfsr.u.fields.aexc = fpu_status->FPUREG.Fpu_fsr_bits.aexc;
+	    sfsr.u.fields.cexc = fpu_status->FPUREG.Fpu_fsr_bits.cexc;
+	    sfsr.u.word = SWAP_LONG(sfsr.u.word);
+	    memcpy(&(fpu->fpu.Fpu_fsr), &sfsr, sizeof(struct swapped_fsr));
+	}
+}
+
+__private_extern__
+void
+swap_ident_command(
+struct ident_command *id_cmd,
+enum byte_sex target_byte_sex)
+{
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+	id_cmd->cmd = SWAP_LONG(id_cmd->cmd);
+	id_cmd->cmdsize = SWAP_LONG(id_cmd->cmdsize);
+}
+
+__private_extern__
+void
+swap_routines_command(
+struct routines_command *r_cmd,
+enum byte_sex target_byte_sex)
+{
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+	r_cmd->cmd = SWAP_LONG(r_cmd->cmd);
+	r_cmd->cmdsize = SWAP_LONG(r_cmd->cmdsize);
+	r_cmd->init_address = SWAP_LONG(r_cmd->init_address);
+	r_cmd->init_module = SWAP_LONG(r_cmd->init_module);
+	r_cmd->reserved1 = SWAP_LONG(r_cmd->reserved1);
+	r_cmd->reserved2 = SWAP_LONG(r_cmd->reserved2);
+	r_cmd->reserved3 = SWAP_LONG(r_cmd->reserved3);
+	r_cmd->reserved4 = SWAP_LONG(r_cmd->reserved4);
+	r_cmd->reserved5 = SWAP_LONG(r_cmd->reserved5);
+	r_cmd->reserved6 = SWAP_LONG(r_cmd->reserved6);
+}
+
+__private_extern__
+void
+swap_twolevel_hints_command(
+struct twolevel_hints_command *hints_cmd,
+enum byte_sex target_byte_sex)
+{
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+	hints_cmd->cmd = SWAP_LONG(hints_cmd->cmd);
+	hints_cmd->cmdsize = SWAP_LONG(hints_cmd->cmdsize);
+	hints_cmd->offset = SWAP_LONG(hints_cmd->offset);
+	hints_cmd->nhints = SWAP_LONG(hints_cmd->nhints);
+}
+
+__private_extern__
+void
+swap_twolevel_hint(
+struct twolevel_hint *hints,
+unsigned long nhints,
+enum byte_sex target_byte_sex)
+{
+    struct swapped_twolevel_hint {
+	union {
+	    struct {
+		unsigned long
+		    itoc:24,
+		    isub_image:8;
+	    } fields;
+	    unsigned long word;
+	} u;
+    } shint;
+
+    unsigned long i;
+    enum byte_sex host_byte_sex;
+
+	host_byte_sex = get_host_byte_sex();
+
+	for(i = 0; i < nhints; i++){
+	    if(target_byte_sex == host_byte_sex){
+		memcpy(&shint, hints + i, sizeof(struct swapped_twolevel_hint));
+		shint.u.word = SWAP_LONG(shint.u.word);
+		hints[i].itoc = shint.u.fields.itoc;
+		hints[i].isub_image = shint.u.fields.isub_image;
+	    }
+	    else{
+		shint.u.fields.isub_image = hints[i].isub_image;
+		shint.u.fields.itoc = hints[i].itoc;
+		shint.u.word = SWAP_LONG(shint.u.word);
+		memcpy(hints + i, &shint, sizeof(struct swapped_twolevel_hint));
+	    }
+	}
+}
+
+__private_extern__
+void
+swap_prebind_cksum_command(
+struct prebind_cksum_command *cksum_cmd,
+enum byte_sex target_byte_sex)
+{
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+	cksum_cmd->cmd = SWAP_LONG(cksum_cmd->cmd);
+	cksum_cmd->cmdsize = SWAP_LONG(cksum_cmd->cmdsize);
+	cksum_cmd->cksum = SWAP_LONG(cksum_cmd->cksum);
+}
+
+__private_extern__
+void
+swap_nlist(
+struct nlist *symbols,
+unsigned long nsymbols,
+enum byte_sex target_byte_sex)
+{
+    unsigned long i;
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+
+	for(i = 0; i < nsymbols; i++){
+	    symbols[i].n_un.n_strx = SWAP_LONG(symbols[i].n_un.n_strx);
+	    /* n_type */
+	    /* n_sect */
+	    symbols[i].n_desc = SWAP_SHORT(symbols[i].n_desc);
+	    symbols[i].n_value = SWAP_LONG(symbols[i].n_value);
+	}
+}
+
+__private_extern__
+void
+swap_ranlib(
+struct ranlib *ranlibs,
+unsigned long nranlibs,
+enum byte_sex target_byte_sex)
+{
+    unsigned long i;
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+
+	for(i = 0; i < nranlibs; i++){
+	    ranlibs[i].ran_un.ran_strx = SWAP_LONG(ranlibs[i].ran_un.ran_strx);
+	    ranlibs[i].ran_off = SWAP_LONG(ranlibs[i].ran_off);
+	}
+}
+
+__private_extern__
+void
+swap_relocation_info(
+struct relocation_info *relocs,
+unsigned long nrelocs,
+enum byte_sex target_byte_sex)
+{
+    unsigned long i;
+    enum byte_sex host_byte_sex;
+    enum bool to_host_byte_sex, scattered;
+
+    struct swapped_relocation_info {
+	long	r_address;
+	union {
+	    struct {
+		unsigned int
+		    r_type:4,
+		    r_extern:1,
+		    r_length:2,
+		    r_pcrel:1,
+		    r_symbolnum:24;
+	    } fields;
+	    unsigned long word;
+	} u;
+    } sr;
+
+    struct swapped_scattered_relocation_info {
+	unsigned long word;
+	long	r_value;
+    } *ssr;
+
+	host_byte_sex = get_host_byte_sex();
+	to_host_byte_sex = (enum bool)(target_byte_sex == host_byte_sex);
+
+	for(i = 0; i < nrelocs; i++){
+	    if(to_host_byte_sex)
+		scattered = (enum bool)(
+			(SWAP_LONG(relocs[i].r_address) & R_SCATTERED) != 0);
+	    else
+		scattered = (enum bool)
+			(((relocs[i].r_address) & R_SCATTERED) != 0);
+	    if(scattered == FALSE){
+		if(to_host_byte_sex){
+		    memcpy(&sr, relocs + i, sizeof(struct relocation_info));
+		    sr.r_address = SWAP_LONG(sr.r_address);
+		    sr.u.word = SWAP_LONG(sr.u.word);
+		    relocs[i].r_address = sr.r_address;
+		    relocs[i].r_symbolnum = sr.u.fields.r_symbolnum;
+		    relocs[i].r_pcrel = sr.u.fields.r_pcrel;
+		    relocs[i].r_length = sr.u.fields.r_length;
+		    relocs[i].r_extern = sr.u.fields.r_extern;
+		    relocs[i].r_type = sr.u.fields.r_type;
+		}
+		else{
+		    sr.r_address = relocs[i].r_address;
+		    sr.u.fields.r_symbolnum = relocs[i].r_symbolnum;
+		    sr.u.fields.r_length = relocs[i].r_length;
+		    sr.u.fields.r_pcrel = relocs[i].r_pcrel;
+		    sr.u.fields.r_extern = relocs[i].r_extern;
+		    sr.u.fields.r_type = relocs[i].r_type;
+		    sr.r_address = SWAP_LONG(sr.r_address);
+		    sr.u.word = SWAP_LONG(sr.u.word);
+		    memcpy(relocs + i, &sr, sizeof(struct relocation_info));
+		}
+	    }
+	    else{
+		ssr = (struct swapped_scattered_relocation_info *)(relocs + i);
+		ssr->word = SWAP_LONG(ssr->word);
+		ssr->r_value = SWAP_LONG(ssr->r_value);
+	    }
+	}
+}
+
+__private_extern__
+void
+swap_indirect_symbols(
+unsigned long *indirect_symbols,
+unsigned long nindirect_symbols,
+enum byte_sex target_byte_sex)
+{
+    unsigned long i;
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+
+	for(i = 0; i < nindirect_symbols; i++)
+	    indirect_symbols[i] = SWAP_LONG(indirect_symbols[i]);
+}
+
+__private_extern__
+void
+swap_dylib_reference(
+struct dylib_reference *refs,
+unsigned long nrefs,
+enum byte_sex target_byte_sex)
+{
+    struct swapped_dylib_reference {
+	union {
+	    struct {
+		unsigned long
+		    flags:8,
+		    isym:24;
+	    } fields;
+	    unsigned long word;
+	} u;
+    } sref;
+
+    unsigned long i;
+    enum byte_sex host_byte_sex;
+
+	host_byte_sex = get_host_byte_sex();
+
+	for(i = 0; i < nrefs; i++){
+	    if(target_byte_sex == host_byte_sex){
+		memcpy(&sref, refs + i, sizeof(struct swapped_dylib_reference));
+		sref.u.word = SWAP_LONG(sref.u.word);
+		refs[i].flags = sref.u.fields.flags;
+		refs[i].isym = sref.u.fields.isym;
+	    }
+	    else{
+		sref.u.fields.isym = refs[i].isym;
+		sref.u.fields.flags = refs[i].flags;
+		sref.u.word = SWAP_LONG(sref.u.word);
+		memcpy(refs + i, &sref, sizeof(struct swapped_dylib_reference));
+	    }
+	}
+
+}
+
+__private_extern__
+void
+swap_dylib_module(
+struct dylib_module *mods,
+unsigned long nmods,
+enum byte_sex target_byte_sex)
+{
+    unsigned long i;
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+
+	for(i = 0; i < nmods; i++){
+	    mods[i].module_name = SWAP_LONG(mods[i].module_name);
+	    mods[i].iextdefsym  = SWAP_LONG(mods[i].iextdefsym);
+	    mods[i].nextdefsym  = SWAP_LONG(mods[i].nextdefsym);
+	    mods[i].irefsym     = SWAP_LONG(mods[i].irefsym);
+	    mods[i].nrefsym     = SWAP_LONG(mods[i].nrefsym);
+	    mods[i].ilocalsym   = SWAP_LONG(mods[i].ilocalsym);
+	    mods[i].nlocalsym   = SWAP_LONG(mods[i].nlocalsym);
+	    mods[i].iextrel     = SWAP_LONG(mods[i].iextrel);
+	    mods[i].nextrel     = SWAP_LONG(mods[i].nextrel);
+	    mods[i].iinit_iterm = SWAP_LONG(mods[i].iinit_iterm);
+	    mods[i].ninit_nterm = SWAP_LONG(mods[i].ninit_nterm);
+	    mods[i].objc_module_info_addr =
+				  SWAP_LONG(mods[i].objc_module_info_addr);
+	    mods[i].objc_module_info_size =
+				  SWAP_LONG(mods[i].objc_module_info_size);
+	}
+}
+
+__private_extern__
+void
+swap_dylib_table_of_contents(
+struct dylib_table_of_contents *tocs,
+unsigned long ntocs,
+enum byte_sex target_byte_sex)
+{
+    unsigned long i;
+#ifdef __MWERKS__
+    enum byte_sex dummy;
+        dummy = target_byte_sex;
+#endif
+
+	for(i = 0; i < ntocs; i++){
+	    tocs[i].symbol_index = SWAP_LONG(tocs[i].symbol_index);
+	    tocs[i].module_index = SWAP_LONG(tocs[i].module_index);
+	}
+}
Index: releases/F-Script Anywhere/1.1.5/Source/libMatch.c
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/libMatch.c	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/libMatch.c	(revision 18)
@@ -0,0 +1,846 @@
+/*
+ *  libMatch.c
+ *  F-Script Anywhere
+ *
+ *  Created by Nicholas Riley on Fri Feb 01 2002.
+ *  Copyright (c) 2001 Nicholas Riley. All rights reserved.
+ *
+ */
+
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  This file contains Original Code and/or Modifications of
+ * Original Code as defined in and that are subject to the Apple Public
+ * Source License Version 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource and read it before using
+ * this file.
+ * 
+ * The Original Code and all software distributed under the License are
+ * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+
+// Yes, this file is a gigantic hack of otool code.  It still took me several hours
+// of work to get to this point, though, and all to get around one of Apple's bugs.
+// Cleanup very much appreciated.
+
+#include "libMatch.h"
+#include <stdlib.h>
+#include <string.h>
+#include <mach-o/loader.h>
+#include "stuff/bytesex.h"
+#include "stuff/ofile.h"
+
+typedef char			BOOL;
+
+#define YES             (BOOL)1
+#define NO              (BOOL)0
+
+
+char *progname = "libMatch"; // used by libstuff for errors
+
+#define error printf
+#define printf NOOP
+
+void NOOP(char *fmt, ...) {
+
+}
+
+BOOL ofile_matches_lib(struct mach_header *mh,
+                       struct load_command *load_commands,
+                       enum byte_sex load_commands_byte_sex,
+                       enum bool just_id,
+                       const char **libList);
+
+
+// derived from main.c processor() in otool
+
+static
+BOOL
+processor(
+          struct ofile *ofile,
+          char *arch_name,
+          const char *libs[])
+          {
+    char *addr;
+    unsigned long size, magic;
+    struct mach_header mh;
+    struct load_command *load_commands;
+    unsigned long nsorted_symbols;
+    struct nlist *allocated_symbols, *sorted_symbols;
+    unsigned long *indirect_symbols, *allocated_indirect_symbols,
+        nindirect_symbols;
+    struct dylib_module *allocated_mods;
+    struct dylib_table_of_contents *allocated_tocs;
+    struct dylib_reference *allocated_refs;
+    struct twolevel_hint *hints, *allocated_hints;
+    unsigned long nhints;
+    BOOL result;
+    sorted_symbols = NULL;
+    nsorted_symbols = 0;
+    indirect_symbols = NULL;
+    nindirect_symbols = 0;
+    hints = NULL;
+    nhints = 0;
+    /*
+     * These may or may not be allocated.  If allocated they will not be
+     * NULL and then free'ed before returning.
+     */
+    load_commands = NULL;
+    allocated_symbols = NULL;
+    sorted_symbols = NULL;
+    allocated_indirect_symbols = NULL;
+    allocated_tocs = NULL;
+    allocated_mods = NULL;
+    allocated_refs = NULL;
+    allocated_hints = NULL;
+    /*
+     * Print header for the object name if in an archive or an architecture
+     * name is passed in.
+     */
+    if(TRUE){ // XXX needed?
+        printf("%s", ofile->file_name);
+        if(ofile->member_ar_hdr != NULL){
+            printf("(%.*s)", (int)ofile->member_name_size,
+                   ofile->member_name);
+        }
+        if(arch_name != NULL)
+            printf(" (architecture %s):", arch_name);
+        else
+            printf(":");
+        /*
+         * If the mach_header pointer is NULL the file is not an object
+         * file.  Truncated object file (where the file size is less
+                                         * than sizeof(struct mach_header)) also does not have it's
+         * mach_header set.  So deal with both cases here and then
+         * return as the rest of this routine deals only with things
+         * in object files.
+         */
+        if(ofile->mh == NULL){
+            if(ofile->file_type == OFILE_FAT){
+                /*
+                 * This routine is not called on fat files where the
+                 * offset is past end of file.  An error message is
+                 * printed in ofile_specific_arch() in ofile.c.
+                 */
+                if(ofile->arch_type == OFILE_ARCHIVE){
+                    addr = ofile->member_addr;
+                    size = ofile->member_size;
+                }
+                else{
+                    addr = ofile->file_addr +
+                    ofile->fat_archs[ofile->narch].offset;
+                    size = ofile->fat_archs[ofile->narch].size;
+                }
+                if(addr + size > ofile->file_addr + ofile->file_size)
+                    size = (ofile->file_addr + ofile->file_size) - addr;
+            }
+            else if(ofile->file_type == OFILE_ARCHIVE){
+                addr = ofile->member_addr;
+                size = ofile->member_size;
+            }
+            else{ /* ofile->file_type == OFILE_UNKNOWN */
+                addr = ofile->file_addr;
+                size = ofile->file_size;
+            }
+            if(size > sizeof(long)){
+                memcpy(&magic, addr, sizeof(unsigned long));
+                if(magic == MH_MAGIC || magic == SWAP_LONG(MH_MAGIC)){
+                    printf(" is a truncated object file\n");
+                    memset(&mh, '\0', sizeof(struct mach_header));
+                    if(size > sizeof(struct mach_header))
+                        size = sizeof(struct mach_header);
+                    memcpy(&mh, addr, size);
+                    if(magic == SWAP_LONG(MH_MAGIC))
+                        swap_mach_header(&mh, get_host_byte_sex());
+                    return FALSE;
+                }
+            }
+            printf(" is not an object file\n");
+            return FALSE;
+        }
+    }
+    if(ofile->mh != NULL){
+        if((int)(ofile->mh) % sizeof(unsigned long)){
+            if(TRUE) // XXX remove?
+                printf("(object file offset is not a multiple of sizeof("
+                       "unsigned long))");
+            memcpy(&mh, ofile->mh, sizeof(struct mach_header));
+            if(mh.magic == SWAP_LONG(MH_MAGIC))
+                swap_mach_header(&mh, get_host_byte_sex());
+            ofile->mh = &mh;
+        }
+        else if(ofile->mh->magic == SWAP_LONG(MH_MAGIC)){
+            mh = *(ofile->mh);
+            swap_mach_header(&mh, get_host_byte_sex());
+            ofile->mh = &mh;
+        }
+    }
+    printf("\n");
+    /*
+     * If this is not an object file then just return.
+     */
+    if(ofile->mh == NULL)
+        return NO;
+    /*
+     * Calculate the true number of bytes of the of the object file that
+     * is in memory (in case this file is truncated).
+     */
+    addr = ofile->object_addr;
+    size = ofile->object_size;
+    if(addr + size > ofile->file_addr + ofile->file_size)
+        size = (ofile->file_addr + ofile->file_size) - addr;
+    /*
+     * Load commands.
+     */
+    if(ofile->mh->sizeofcmds + sizeof(struct mach_header) > size){
+        load_commands = malloc(ofile->mh->sizeofcmds);
+        memset(load_commands, '\0', ofile->mh->sizeofcmds);
+        memcpy(load_commands, ofile->load_commands,
+               size - sizeof(struct mach_header));
+        ofile->load_commands = load_commands;
+    }
+    result = ofile_matches_lib(ofile->mh, ofile->load_commands,
+                               ofile->object_byte_sex, FALSE, libs);
+    if(load_commands != NULL)
+        free(load_commands);
+    if(allocated_symbols != NULL)
+        free(allocated_symbols);
+    if(sorted_symbols != NULL)
+        free(sorted_symbols);
+    if(allocated_indirect_symbols != NULL)
+        free(allocated_indirect_symbols);
+    if(allocated_hints != NULL)
+        free(allocated_hints);
+    if(allocated_tocs != NULL)
+        free(allocated_tocs);
+    if(allocated_mods != NULL)
+        free(allocated_mods);
+    if(allocated_refs != NULL)
+        free(allocated_refs);
+    return result;
+}
+
+// derived from ofile.c ofile_process() in otool
+
+BOOL appContainsLibMatching(const char *appPath, const char *libs[])
+{
+    const char *name = appPath;
+    struct arch_flag *arch_flags = NULL;
+    unsigned long narch_flags = 0;
+    enum bool all_archs = FALSE;
+    enum bool process_non_objects = FALSE; // TRUE?
+    enum bool dylib_flat = TRUE;
+    char *member_name, *arch_name;
+    unsigned long i;
+    struct ofile ofile;
+    enum bool flag, hostflag, arch_found, family;
+    struct arch_flag host_arch_flag;
+    const struct arch_flag *family_arch_flag;
+    /*
+     * If use_member_syntax is TRUE look for a name of the form
+     * "archive(member)" which is to mean a member in that archive (the
+                                                                    * member name must be at least one character long to be recognized as
+                                                                    * this form).
+     */
+    member_name = NULL;
+    /*
+    if(use_member_syntax == TRUE){
+        len = strlen(name);
+        if(len >= 4 && name[len-1] == ')'){
+            p = strrchr(name, '(');
+            if(p != NULL && p != name){
+                member_name = p+1;
+                *p = '\0';
+                name[len-1] = '\0';
+            }
+        }
+    }
+     */
+#ifdef OTOOL
+    otool_first_ofile_map = TRUE;
+#endif /* OTOOL */
+    if(ofile_map(name, NULL, NULL, &ofile, FALSE) == FALSE)
+        return NO;
+#ifdef OTOOL
+    otool_first_ofile_map = FALSE;
+#endif /* OTOOL */
+    if(ofile.file_type == OFILE_FAT){
+        /*
+         * This is a fat file so see if a list of architecture is
+         * specified and process only those.
+         */
+        if(all_archs == FALSE && narch_flags != 0){
+            family = FALSE;
+            if(narch_flags == 1){
+                family_arch_flag =
+                get_arch_family_from_cputype(arch_flags[0].cputype);
+                if(family_arch_flag != NULL)
+                    family = (enum bool)(family_arch_flag->cpusubtype ==
+                                         arch_flags[0].cpusubtype);
+            }
+            for(i = 0; i < narch_flags; i++){
+                (void)ofile_first_arch(&ofile);
+                arch_found = FALSE;
+                if(narch_flags != 1)
+                    arch_name = ofile.arch_flag.name;
+                else
+                    arch_name = NULL;
+                do{
+                    if(ofile.arch_flag.cputype ==
+                       arch_flags[i].cputype &&
+                       (ofile.arch_flag.cpusubtype ==
+                        arch_flags[i].cpusubtype || family == TRUE)){
+                        arch_found = TRUE;
+                        if(ofile.arch_type == OFILE_ARCHIVE){
+                            if(member_name != NULL){
+                                if(ofile_specific_member(member_name,
+                                                         &ofile) == TRUE)
+                                    processor(&ofile, arch_name, libs);
+                            }
+                            else{
+                                /* loop through archive */
+#ifdef OTOOL
+                                printf("Archive : %s", ofile.file_name);
+                                if(arch_name != NULL)
+                                    printf(" (architecture %s)",
+                                           arch_name);
+                                printf("\n");
+#endif /* OTOOL */
+                                if(ofile_first_member(&ofile) == TRUE){
+                                    flag = FALSE;
+                                    do{
+                                        if(process_non_objects == TRUE ||
+                                           ofile.member_type ==
+                                           OFILE_Mach_O){
+                                            processor(&ofile, arch_name,
+                                                      libs);
+                                            flag = TRUE;
+                                        }
+                                    }while(ofile_next_member(&ofile) ==
+                                           TRUE);
+                                    if(flag == FALSE){
+                                        error("for architecture: %s "
+                                              "archive: %s contains no "
+                                              "members that are object "
+                                              "files", ofile.arch_flag.name,
+                                              ofile.file_name);
+                                    }
+                                }
+                                else{
+                                    error("for architecture: %s archive: "
+                                          "%s contains no members",
+                                          ofile.arch_flag.name,
+                                          ofile.file_name);
+                                }
+                            }
+                        }
+                        else if(process_non_objects == TRUE ||
+                                ofile.arch_type == OFILE_Mach_O){
+                            if(ofile.arch_type == OFILE_Mach_O &&
+                               ofile.mh->filetype == MH_DYLIB){
+                                if(dylib_flat == TRUE){
+                                    processor(&ofile, arch_name, libs);
+                                }
+                                else{
+                                    if(member_name != NULL){
+                                        if(ofile_specific_module(
+                                                                 member_name, &ofile) == TRUE)
+                                            processor(&ofile, arch_name,
+                                                      libs);
+                                    }
+                                    else{
+                                        /*loop through the dynamic library*/
+                                        if(ofile_first_module(&ofile)){
+                                            do{
+                                                processor(&ofile, arch_name,
+                                                          libs);
+                                            }while(ofile_next_module(
+                                                                     &ofile));
+                                        }
+                                        else{
+                                            error("for architecture: %s "
+                                                  "dynamic library: %s "
+                                                  "contains no modules",
+                                                  ofile.arch_flag.name,
+                                                  ofile.file_name);
+                                        }
+                                    }
+                                }
+                            }
+                            else{
+                                if(member_name != NULL)
+                                    error("for architecture: %s file: %s "
+                                          "is not an archive and thus does "
+                                          "not contain member: %s",
+                                          ofile.arch_flag.name,
+                                          ofile.file_name,
+                                          member_name);
+                                else
+                                    processor(&ofile, arch_name, libs);
+                            }
+                        }
+                        else if(ofile.arch_type == OFILE_UNKNOWN){
+                            error("for architecture: %s file: %s is "
+                                  "not an object file",
+                                  ofile.arch_flag.name,ofile.file_name);
+                        }
+                        break;
+                    }
+                }while(ofile_next_arch(&ofile) == TRUE);
+                if(arch_found == FALSE)
+                    error("file: %s does not contain architecture: %s",
+                          ofile.file_name, arch_flags[i].name);
+            }
+            return NO;
+        }
+        /*
+         * This is a fat file and no architectures has been specified
+         * so if it contains the host architecture process only that
+         * architecture but if not process all architectures
+         * specified.
+         */
+        if(all_archs == FALSE){
+            (void)get_arch_from_host(&host_arch_flag, NULL);
+            hostflag = FALSE;
+            family = FALSE;
+            family_arch_flag =
+                get_arch_family_from_cputype(host_arch_flag.cputype);
+            if(family_arch_flag != NULL)
+                family = (enum bool)(family_arch_flag->cpusubtype ==
+                                     host_arch_flag.cpusubtype);
+            ofile_unmap(&ofile);
+            if(ofile_map(name, NULL, NULL, &ofile, FALSE) == FALSE)
+                return NO;
+            (void)ofile_first_arch(&ofile);
+            do{
+                if(ofile.arch_flag.cputype ==
+                   host_arch_flag.cputype &&
+                   (ofile.arch_flag.cpusubtype ==
+                    host_arch_flag.cpusubtype || family == TRUE)){
+                    hostflag = TRUE;
+                    if(ofile.arch_type == OFILE_ARCHIVE){
+                        if(member_name != NULL){
+                            if(ofile_specific_member(member_name,
+                                                     &ofile) == TRUE)
+                                processor(&ofile, NULL, libs);
+                        }
+                        else{
+                            /* loop through archive */
+#ifdef OTOOL
+                            printf("Archive : %s\n", ofile.file_name);
+#endif /* OTOOL */
+                            if(ofile_first_member(&ofile) == TRUE){
+                                flag = FALSE;
+                                do{
+                                    if(process_non_objects == TRUE ||
+                                       ofile.member_type == OFILE_Mach_O){
+                                        processor(&ofile, NULL, libs);
+                                        flag = TRUE;
+                                    }
+                                }while(ofile_next_member(&ofile) ==
+                                       TRUE);
+                                if(flag == FALSE){
+                                    error("archive: %s contains no "
+                                          "members that are object "
+                                          "files", ofile.file_name);
+                                }
+                            }
+                            else{
+                                error("archive: %s contains no "
+                                      "members", ofile.file_name);
+                            }
+                        }
+                    }
+                    else if(process_non_objects == TRUE ||
+                            ofile.arch_type == OFILE_Mach_O){
+                        if(ofile.arch_type == OFILE_Mach_O &&
+                           ofile.mh->filetype == MH_DYLIB){
+                            if(dylib_flat == TRUE){
+                                processor(&ofile, NULL, libs);
+                            }
+                            else{
+                                if(member_name != NULL){
+                                    if(ofile_specific_module(member_name,
+                                                             &ofile) == TRUE)
+                                        processor(&ofile, NULL, libs);
+                                }
+                                else{
+                                    /* loop through the dynamic library */
+                                    if(ofile_first_module(&ofile) == TRUE){
+                                        do{
+                                            processor(&ofile, NULL, libs);
+                                        }while(ofile_next_module(&ofile));
+                                    }
+                                    else{
+                                        error("for architecture: %s dynamic"
+                                              " library: %s contains no "
+                                              "modules",
+                                              ofile.arch_flag.name,
+                                              ofile.file_name);
+                                    }
+                                }
+                            }
+                        }
+                        else{
+                            if(member_name != NULL)
+                                error("for architecture: %s file: %s is "
+                                      "not an archive and thus does not "
+                                      "contain member: %s",
+                                      ofile.arch_flag.name, ofile.file_name,
+                                      member_name);
+                            else
+                                processor(&ofile, NULL, libs);
+                        }
+                    }
+                    else if(ofile.arch_type == OFILE_UNKNOWN){
+                        error("file: %s is not an object file",
+                              ofile.file_name);
+                    }
+                }
+            }while(hostflag == FALSE && ofile_next_arch(&ofile) == TRUE);
+            if(hostflag == TRUE)
+                return NO;
+        }
+        /*
+         * Either all architectures have been specified or none have
+         * been specified and it does not contain the host architecture
+         * so do all the architectures in the fat file
+         */
+        ofile_unmap(&ofile);
+        if(ofile_map(name, NULL, NULL, &ofile, FALSE) == FALSE)
+            return NO;
+        (void)ofile_first_arch(&ofile);
+        do{
+            if(ofile.arch_type == OFILE_ARCHIVE){
+                if(member_name != NULL){
+                    if(ofile_specific_member(member_name, &ofile) == TRUE)
+                        processor(&ofile, ofile.arch_flag.name, libs);
+                }
+                else{
+                    /* loop through archive */
+#ifdef OTOOL
+                    printf("Archive : %s (architecture %s)\n",
+                           ofile.file_name, ofile.arch_flag.name);
+#endif /* OTOOL */
+                    if(ofile_first_member(&ofile) == TRUE){
+                        flag = FALSE;
+                        do{
+                            if(process_non_objects == TRUE ||
+                               ofile.member_type == OFILE_Mach_O){
+                                processor(&ofile, ofile.arch_flag.name,
+                                          libs);
+                                flag = TRUE;
+                            }
+                        }while(ofile_next_member(&ofile) == TRUE);
+                        if(flag == FALSE){
+                            error("for architecture: %s archive: %s "
+                                  "contains no members that are object "
+                                  "files", ofile.arch_flag.name,
+                                  ofile.file_name);
+                        }
+                    }
+                    else{
+                        error("for architecture: %s archive: %s "
+                              "contains no members",
+                              ofile.arch_flag.name, ofile.file_name);
+                    }
+                }
+            }
+            else if(process_non_objects == TRUE ||
+                    ofile.arch_type == OFILE_Mach_O){
+                if(ofile.arch_type == OFILE_Mach_O &&
+                   ofile.mh->filetype == MH_DYLIB){
+                    if(dylib_flat == TRUE){
+                        processor(&ofile, ofile.arch_flag.name, libs);
+                    }
+                    else{
+                        if(member_name != NULL){
+                            if(ofile_specific_module(member_name, &ofile)
+                               == TRUE)
+                                processor(&ofile, ofile.arch_flag.name,
+                                          libs);
+                        }
+                        else{
+                            /* loop through the dynamic library */
+                            if(ofile_first_module(&ofile) == TRUE){
+                                do{
+                                    processor(&ofile, ofile.arch_flag.name,
+                                              libs);
+                                }while(ofile_next_module(&ofile) == TRUE);
+                            }
+                            else{
+                                error("for architecture: %s dynamic library"
+                                      ": %s contains no modules",
+                                      ofile.arch_flag.name,ofile.file_name);
+                            }
+                        }
+                    }
+                }
+                else{
+                    if(member_name != NULL)
+                        error("for architecture: %s file: %s is not an "
+                              "archive and thus does not contain member: "
+                              "%s", ofile.arch_flag.name, ofile.file_name,
+                              member_name);
+                    else
+                        processor(&ofile, ofile.arch_flag.name, libs);
+                }
+            }
+            else if(ofile.arch_type == OFILE_UNKNOWN){
+                error("for architecture: %s file: %s is not an "
+                      "object file", ofile.arch_flag.name,
+                      ofile.file_name);
+            }
+        }while(ofile_next_arch(&ofile) == TRUE);
+    }
+    else if(ofile.file_type == OFILE_ARCHIVE){
+        if(narch_flags != 0){
+            arch_found = FALSE;
+            for(i = 0; i < narch_flags; i++){
+                family = FALSE;
+                if(narch_flags == 1){
+                    family_arch_flag =
+                    get_arch_family_from_cputype(arch_flags[0].cputype);
+                    if(family_arch_flag != NULL)
+                        family = (enum bool)(family_arch_flag->cpusubtype ==
+                                             arch_flags[0].cpusubtype);
+                }
+                if(ofile.archive_cputype == arch_flags[i].cputype &&
+                   (ofile.archive_cpusubtype == arch_flags[i].cpusubtype ||
+                    family == TRUE)){
+                    arch_found = TRUE;
+                }
+                else{
+                    error("file: %s does not contain architecture: %s",
+                          ofile.file_name, arch_flags[i].name);
+                }
+            }
+            if(arch_found == FALSE)
+                return NO;
+        }
+        if(member_name != NULL){
+            if(ofile_specific_member(member_name, &ofile) == TRUE)
+                processor(&ofile, NULL, libs);
+        }
+        else{
+            /* loop through archive */
+#ifdef OTOOL
+            printf("Archive : %s\n", ofile.file_name);
+#endif /* OTOOL */
+            if(ofile_first_member(&ofile) == TRUE){
+                flag = FALSE;
+                do{
+                    if(process_non_objects == TRUE ||
+                       ofile.member_type == OFILE_Mach_O){
+                        processor(&ofile, NULL, libs);
+                        flag = TRUE;
+                    }
+                }while(ofile_next_member(&ofile) == TRUE);
+                if(flag == FALSE){
+                    error("archive: %s contains no members that are "
+                          "object files", ofile.file_name);
+                }
+            }
+            else{
+                error("archive: %s contains no members",
+                      ofile.file_name);
+            }
+        }
+    }
+    else if(ofile.file_type == OFILE_Mach_O){
+        if(narch_flags != 0){
+            arch_found = FALSE;
+            for(i = 0; i < narch_flags; i++){
+                family = FALSE;
+                if(narch_flags == 1){
+                    family_arch_flag =
+                    get_arch_family_from_cputype(arch_flags[0].cputype);
+                    if(family_arch_flag != NULL)
+                        family = (enum bool)(family_arch_flag->cpusubtype ==
+                                             arch_flags[0].cpusubtype);
+                }
+#ifdef OTOOL
+                if(ofile.mh->magic == SWAP_LONG(MH_MAGIC)){
+                    if(SWAP_LONG(ofile.mh->cputype) ==
+                       arch_flags[i].cputype &&
+                       (SWAP_LONG(ofile.mh->cpusubtype) ==
+                        arch_flags[i].cpusubtype ||
+                        family == TRUE)){
+                        arch_found = TRUE;
+                    }
+                }
+                else
+#endif /* OTOOL */
+                    if(ofile.mh->cputype == arch_flags[i].cputype &&
+                       (ofile.mh->cpusubtype == arch_flags[i].cpusubtype ||
+                        family == TRUE)){
+                        arch_found = TRUE;
+                    }
+                else{
+                    error("file: %s does not contain architecture: %s",
+                          ofile.file_name, arch_flags[i].name);
+                }
+            }
+            if(arch_found == FALSE)
+                return NO;
+        }
+        if(ofile.mh->filetype == MH_DYLIB){
+            if(dylib_flat == TRUE){
+                processor(&ofile, NULL, libs);
+            }
+            else{
+                if(member_name != NULL){
+                    if(ofile_specific_module(member_name, &ofile) == TRUE)
+                        processor(&ofile, NULL, libs);
+                }
+                else{
+                    /* loop through the dynamic library */
+                    if(ofile_first_module(&ofile) == TRUE){
+                        do{
+                            processor(&ofile, NULL, libs);
+                        }while(ofile_next_module(&ofile) == TRUE);
+                    }
+                    else{
+                        error("dynamic library: %s contains no modules",
+                              ofile.file_name);
+                    }
+                }
+            }
+        }
+        else{
+            if(member_name != NULL)
+                error("file: %s is not an archive and thus does not contain"
+                      " member: %s", ofile.file_name, member_name);
+            else
+                return processor(&ofile, NULL, libs);
+        }
+    }
+    else{
+        if(process_non_objects == TRUE)
+            processor(&ofile, NULL, libs);
+        else if(member_name != NULL)
+            error("file: %s(%s) is not an object file", name,
+                  member_name);
+        else
+            error("file: %s is not an object file", name);
+    }
+    return NO;
+}
+
+// derived from ofile_print.c print_libraries() in otool
+
+BOOL ofile_matches_lib(struct mach_header *mh,
+                       struct load_command *load_commands,
+                       enum byte_sex load_commands_byte_sex,
+                       enum bool just_id,
+                       const char **libs)
+{
+    enum byte_sex host_byte_sex;
+    enum bool swapped;
+    unsigned long i, left, size;
+    struct load_command *lc, l;
+    struct fvmlib_command fl;
+    struct dylib_command dl;
+    char *p;
+    
+    host_byte_sex = get_host_byte_sex();
+    swapped = host_byte_sex != load_commands_byte_sex;
+    lc = load_commands;
+    for(i = 0 ; i < mh->ncmds; i++){
+        memcpy((char *)&l, (char *)lc, sizeof(struct load_command));
+        if(swapped)
+            swap_load_command(&l, host_byte_sex);
+        if(l.cmdsize % sizeof(long) != 0)
+            printf("load command %lu size not a multiple of sizeof(long)\n",
+                   i);
+        if((char *)lc + l.cmdsize > (char *)load_commands + mh->sizeofcmds)
+            printf("load command %lu extends past end of load commands\n",
+                   i);
+        left = mh->sizeofcmds - ((char *)lc - (char *)load_commands);
+        switch(l.cmd){
+            case LC_IDFVMLIB:
+            case LC_LOADFVMLIB:
+                if(just_id == TRUE)
+                    break;
+                memset((char *)&fl, '\0', sizeof(struct fvmlib_command));
+                size = left < sizeof(struct fvmlib_command) ?
+                    left : sizeof(struct fvmlib_command);
+                memcpy((char *)&fl, (char *)lc, size);
+                if(swapped)
+                    swap_fvmlib_command(&fl, host_byte_sex);
+                    if(fl.fvmlib.name.offset < fl.cmdsize){
+                        p = (char *)lc + fl.fvmlib.name.offset;
+                        printf("\t%s (minor version %lu)\n", p,
+                               fl.fvmlib.minor_version);
+                    }
+                        else{
+                            printf("\tBad offset (%lu) for name of %s command %lu\n",
+                                   fl.fvmlib.name.offset, l.cmd == LC_IDFVMLIB ?
+                                   "LC_IDFVMLIB" : "LC_LOADFVMLIB" , i);
+                        }
+                        break;
+            case LC_LOAD_DYLIB:
+            case LC_LOAD_WEAK_DYLIB:
+                if(just_id == TRUE)
+                    break;
+            case LC_ID_DYLIB:
+                memset((char *)&dl, '\0', sizeof(struct dylib_command));
+                size = left < sizeof(struct dylib_command) ?
+                    left : sizeof(struct dylib_command);
+                memcpy((char *)&dl, (char *)lc, size);
+                if(swapped)
+                    swap_dylib_command(&dl, host_byte_sex);
+                    if(dl.dylib.name.offset < dl.cmdsize) {
+                        p = (char *)lc + dl.dylib.name.offset;
+                        if(just_id == TRUE)
+                            printf("%s\n", p);
+                        else
+                            printf("\t%s (compatibility version %lu.%lu.%lu, "
+                                   "current version %lu.%lu.%lu)\n", p,
+                                   dl.dylib.compatibility_version >> 16,
+                                   (dl.dylib.compatibility_version >> 8) & 0xff,
+                                   dl.dylib.compatibility_version & 0xff,
+                                   dl.dylib.current_version >> 16,
+                                   (dl.dylib.current_version >> 8) & 0xff,
+                                   dl.dylib.current_version & 0xff);
+                        {
+                            const char **libName;
+                            for (libName = libs ; *libName != NULL ; libName++) {
+                                if (strstr(p, *libName) != NULL) return YES;
+                            }
+                        }
+                    }
+                        else{
+                            printf("\tBad offset (%lu) for name of %s command %lu\n",
+                                   dl.dylib.name.offset, l.cmd == LC_ID_DYLIB ?
+                                   "LC_ID_DYLIB" :
+                                   (l.cmd == LC_LOAD_DYLIB ? "LC_LOAD_DYLIB" :
+                                    "LC_LOAD_WEAK_DYLIB") , i);
+                        }
+                        break;
+        }
+        if(l.cmdsize == 0){
+            printf("load command %lu size zero (can't advance to other "
+                   "load commands)\n", i);
+            return NO;
+        }
+        lc = (struct load_command *)((char *)lc + l.cmdsize);
+        if((char *)lc > (char *)load_commands + mh->sizeofcmds)
+            return NO;
+    }
+    if((char *)load_commands + mh->sizeofcmds != (char *)lc)
+        printf("Inconsistent mh_sizeofcmds\n");
+    return NO;
+}
Index: releases/F-Script Anywhere/1.1.5/Source/libMatch.h
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/libMatch.h	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/libMatch.h	(revision 18)
@@ -0,0 +1,10 @@
+/*
+ *  libMatch.h
+ *  F-Script Anywhere
+ *
+ *  Created by Nicholas Riley on Fri Feb 01 2002.
+ *  Copyright (c) 2001 Nicholas Riley. All rights reserved.
+ *
+ */
+
+char appContainsLibMatching(const char *appPath, const char *libs[]);
Index: releases/F-Script Anywhere/1.1.5/Source/main.m
===================================================================
--- releases/F-Script Anywhere/1.1.5/Source/main.m	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/Source/main.m	(revision 18)
@@ -0,0 +1,6 @@
+#import <Cocoa/Cocoa.h>
+
+int main(int argc, const char *argv[])
+{
+    return NSApplicationMain(argc, argv);
+}
Index: releases/F-Script Anywhere/1.1.5/package-FSA.sh
===================================================================
--- releases/F-Script Anywhere/1.1.5/package-FSA.sh	(revision 18)
+++ releases/F-Script Anywhere/1.1.5/package-FSA.sh	(revision 18)
@@ -0,0 +1,42 @@
+#!/bin/zsh
+
+# stuff to do:
+# hdiutil create DiskImage.dmg -megabytes <size> -layout NONE
+# hdid -nomount DiskImage.dmg
+# sudo /sbin/newfs_hfs -w -v VolumeName -b 4096 /dev/disk2
+# hdiutil eject /dev/disk2
+
+# also check out 'build' on mosxland.sf.net
+
+set -x -v
+
+PACKAGEDIR="$PWD"
+PRODUCT="F-Script Anywhere"
+
+cd "$PACKAGEDIR"/Source && \
+find . -name \*~\* -exec rm -r '{}' \; && \
+VERSION=`cat VERSION` && \
+DMG="$PRODUCT-$VERSION.dmg" VOL="$PRODUCT $VERSION" MOUNTPOINT="/Volumes/$VOL" && \
+DSTROOT="$PACKAGEDIR/$VOL" && \
+sudo rm -fr "$DSTROOT" && \
+rm -rf build/ && \
+pbxbuild install "DSTROOT=$DSTROOT" && \
+ditto -rsrc "$PACKAGEDIR"/Source "$DSTROOT"/Source && \
+rm -rf "$DSTROOT"/Source/build && \
+find "$DSTROOT" -name ".svn" -exec sudo /bin/rm -rf "{}" \; ; \
+cd "$PACKAGEDIR" && \
+rm -f "$DMG" && \
+hdiutil create "$DMG" -megabytes 5 -ov -type UDIF && \
+DISK=`hdid -nomount "$DMG" | sed -ne ' /Apple_partition_scheme/ s|^/dev/\([^ ]*\).*$|\1|p'` && \
+newfs_hfs -v "$VOL" "/dev/r${DISK}s2" && \
+hdiutil eject "$DISK" && \
+hdid "$DMG" && \
+ditto -rsrc "$DSTROOT" "$MOUNTPOINT" && \
+chmod -R a+rX,u+w "$MOUNTPOINT" && \
+openUp "$MOUNTPOINT" && \
+# sleep 2 && \
+hdiutil eject $DISK && \
+# osascript -e "tell application \"Finder\" to eject disk \"$VOL\"" && \
+hdiutil convert "$DMG" -format UDZO -imagekey zlib-level=9 -o "z$DMG" && \
+mv "z$DMG" "$DMG" && \
+scp "$DMG" ainaz:web/nriley/software/
