Index: /releases/appswitch/1.0.1/appswitch/CPS.h
===================================================================
--- /releases/appswitch/1.0.1/appswitch/CPS.h	(revision 162)
+++ /releases/appswitch/1.0.1/appswitch/CPS.h	(revision 162)
@@ -0,0 +1,299 @@
+// CPS.h
+
+#pragma once
+
+#include <ApplicationServices/ApplicationServices.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;
+	SInt32			UnixPID; // njr changed from UInt32
+};
+
+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/appswitch/1.0.1/appswitch/README
===================================================================
--- /releases/appswitch/1.0.1/appswitch/README	(revision 162)
+++ /releases/appswitch/1.0.1/appswitch/README	(revision 162)
@@ -0,0 +1,97 @@
+appswitch 1.0.1 [16 May 2004]
+===============
+
+A command-line interface to the Mac OS X process manager.
+
+Written by Nicholas Riley <mailto:appswitch@sabi.net>.
+Obtain updates from <http://web.sabi.net/nriley/software/>.
+
+WHAT IS IT?
+-----------
+
+If you use shell scripts to automate Mac OS X applications, you may
+need to switch between applications.  You could use AppleScript via
+osascript(1), but that would take several seconds for the script to
+compile and execute - or you could use appswitch, which works almost
+instantly.
+
+Say you're launching an X11 application from Terminal but the X server
+isn't in front when you need it.  Use appswitch to fix the problem.
+
+Or, if you'd like a version of the ps(1) utility which understands the
+concept of OS X applications, appswitch can help.
+
+INSTALLATION
+------------
+
+The commands below install the 'appswitch' tool in /usr/local/bin,
+which is in the default path.  You should subsequently be able to use
+'appswitch' by typing its name.  If you wish to install it somewhere
+else, modify the install line as appropriate.
+
+% sudo /usr/bin/install -d /usr/local/bin /usr/local/man/man1
+% sudo /usr/bin/install -c build/appswitch /usr/local/bin
+% sudo /usr/bin/install -c appswitch.1 /usr/local/man/man1
+% rehash
+
+Uninstallation:
+
+% sudo rm -f /usr/local/bin/appswitch /usr/local/man/man1/appswitch.1
+
+COMPILATION
+-----------
+
+An Xcode project, 'appswitch.xcode', is included.  A precompiled
+binary is also provided.  'appswitch' was developed and tested under
+Mac OS 10.3.3 with the April 2004 Developer Tools, and does not
+require any additional software to build.
+
+USAGE
+-----
+
+Just type 'appswitch' by itself to receive usage information.  See the
+manual page (man appswitch) for more information.
+
+If you're curious about the speed difference between appswitch and
+other methods, this should give you some indication.
+
+appswitch -a Emacs          0.00s user 0.02s system 55% cpu 0.054 total
+appswitch -i com.gnu.Emacs  0.00s user 0.04s system 63% cpu 0.063 total
+open -a Emacs               0.32s user 0.12s system 50% cpu 0.876 total
+launch -a Emacs	            0.00s user 0.03s system 35% cpu 0.085 total
+osascript -e 'tell application "Emacs" to activate'
+                            0.41s user 0.23s system 67% cpu 0.949 total
+
+The above tests were performed on a PowerBook G4/800; slower systems
+should show more dramatic differences.
+
+COMMENTS, SUGGESTIONS, BUG REPORTS, ETC.
+----------------------------------------
+
+Please send to the author, Nicholas Riley, at <appswitch@sabi.net>.
+
+VERSION HISTORY
+---------------
+
+1.0.1 - 16 May 2004
+ - fixed crash matching applications with no bundle identifier
+ - fixed process listing PSN column width
+1.0   - 19 February 2003
+ - added description of -q delay bug (no workaround)
+1.0b3 - 13 February 2003
+ - display spaces instead of ? characters when unprintable
+ - properly handle very narrow window width with -l
+ - further revised and clarified man page
+ - added -q, -K, -L options
+1.0b2 - 11 February 2003
+ - display ? characters for unprintable creator code characters
+   (e.g. java)
+ - fixed -P/-p error in man page
+ - revised and clarified man page
+1.0b1 - 10 February 2003
+ - added -S, -S, -h, -H, -k, -P, -l, -F options
+ - fixed reference to bogus -u option
+ - fixed bug where unknown match type was silently discarded
+ - added man page and this README
+1.0d1 - 4 February 2003
+ - initial release
Index: /releases/appswitch/1.0.1/appswitch/VERSION
===================================================================
--- /releases/appswitch/1.0.1/appswitch/VERSION	(revision 162)
+++ /releases/appswitch/1.0.1/appswitch/VERSION	(revision 162)
@@ -0,0 +1,1 @@
+1.0.1
Index: /releases/appswitch/1.0.1/appswitch/appswitch.1
===================================================================
--- /releases/appswitch/1.0.1/appswitch/appswitch.1	(revision 162)
+++ /releases/appswitch/1.0.1/appswitch/appswitch.1	(revision 162)
@@ -0,0 +1,168 @@
+.Dd Sun May 16 2004      \" DATE 
+.Dt APPSWITCH 1 LOCAL    \" Program name and manual section number 
+.Os appswitch 1.0.1
+.Sh NAME
+.Nm appswitch
+.Nd switch, hide, show, quit, kill or list Mac OS X applications
+.Sh SYNOPSIS
+.Nm appswitch
+.Op Fl sShHqkKFlLP       \" [-sShHqkKFlLP]
+.Op Fl c Ar creator      \" [-c creator]
+.Op Fl i Ar bundleID     \" [-i bundleID]
+.Op Fl a Ar name         \" [-a name]
+.Op Fl p Ar pid          \" [-p pid]
+.Op Ar path              \" [path]
+.Sh DESCRIPTION
+.Nm
+controls the ordering and visibility of Mac OS X application windows.
+.Nm
+can also list or kill running applications.
+.Ss Matching options
+Matching identifies one or more applications to manipulate.
+.Bl -tag -width -indent
+.It Fl c Ar creator
+Match by creator (a four-character code, also known as a signature).
+.It Fl i Ar bundle ID
+Match by bundle identifier, usually consisting of the reversed dot
+(.)-separated components of the application developer's Internet domain
+name, followed by the application name.  For example, the Finder's
+bundle identifier is
+.Ar com.apple.Finder .
+Bundle identifiers are not case-sensitive.
+.Pp
+If you're extremely concerned about the speed of matching, any other
+match method is faster than a match by bundle identifier.
+.It Fl p Ar pid
+Match by process identifier, a positive integer.
+.It Ar path
+Match by bundle path.  For packaged applications, this is the package
+directory whose name typically has the .app extension, for example
+.Ar /Applications/TextEdit.app
+for the default installation location of TextEdit.  For non-packaged
+applications, this is the path to the executable itself.
+.El
+.Ss Application actions
+These actions apply to the matched application. If multiple
+applications match the supplied criteria, only the first matching
+application is acted upon.  The list option
+.Fl l
+displays all matching applications.
+.Bl -tag -width -indent
+.It Fl s
+Show the application, making the application's windows frontmost.  Do
+not switch to the application.
+.It Fl h
+Hide the application's windows.
+.It Fl q
+Quit the application.
+.It Fl k
+Kill (force quit) the application.  Sends the
+.Dv SIGINT
+signal to the application, which the application may
+ignore.  Equivalent to selecting 
+.Dq Force Quit
+from an application's menu in the Dock for the first time.
+.It Fl K
+Kill (force quit) the application.  Sends the
+.Dv SIGKILL
+signal to the application, which the application may not ignore.
+Equivalent to selecting
+.Dq Force Quit
+from an application's menu in the Dock for the second time.
+.It Fl l
+List applications in a format similar to that of
+.Xr ps 1 .
+The columns of the listing are as follows:
+.Bl -tag -width indent
+.It PSN
+The process serial number of the application.  Process serial numbers
+are unique identifiers among both native Mac OS X and Classic
+applications.
+.It PID
+The process identifier, a positive integer which uniquely identifies
+native Mac OS X processes, usable with the
+.Fl p
+matching option.  Because all Classic applications run inside
+TruBlueEnvironment, a single Mac OS X process, their process
+identifiers appear as -1.
+.It TYPE
+The four-character code identifying the application's type,
+usually 
+.Ql APPL
+for most applications or
+.Ql FNDR
+for the Finder.
+Classic applications include additional types such as
+.Ql appe
+and
+.Ql APPC
+for applications which perform the functions of extensions
+and control panels, respectively.
+.It CREA
+The four-character code identifying the application's creator, usable with the
+.Fl c
+matching option. Some Mac OS X applications have no creator, appearing
+as 
+.Ql ???? ;
+for these applications you must use the bundle identifier,
+name or path as match criteria.
+.It NAME
+The user-visible application name, usable with the
+.Fl a
+matching option. This field is truncated to 20 characters; the
+remainder of longer application names is not displayed.
+.It PATH
+The path to the application bundle, usable with the
+.Ar path
+matching option. This field is truncated to the window width, or to 80
+characters if the window width cannot be determined.
+.El
+.It Fl L
+List applications in a format similar to that of
+.Xr ps 1 .
+The columns of the listing are as above, but the path field is not
+truncated to the window width, and a bundle identifier is added in
+parentheses after the path, usable with the
+.Fl i
+matching option.
+.It Fl P
+Print the application's process identifier (PID), a positive integer
+and unique identifier for all applications except Classic
+applications.
+.El
+.Ss Actions
+These actions affect all applications currently running.
+.Bl -tag -width -indent
+.It Fl S
+Show all applications, layering the windows of initially hidden
+applications on top.
+.It Fl H
+Hide windows of all applications other than the matched application,
+or the frontmost application if no application has been matched.
+.It Fl F
+Order the current application's windows to the front.
+.El
+.Sh SEE ALSO 
+.\" List links in ascending order by section, alphabetically within a section.
+.\" Please do not reference files that do not exist without filing a bug report
+.Xr open 1 ,
+.Xr launch 1 ,
+.Xr ps 1 ,
+.Xr kill 1 ,
+.Xr GetFileInfo 1
+.Sh BUGS              \" Document known, unremedied bugs
+The
+.Fl F
+option may be unreliable if issued immediately after another show or
+hide command; try inserting a
+.Xr sleep 1
+command before it.
+.Pp
+The
+.Fl q
+option is very slow on Mac OS X 10.2.8 and earlier; this is an
+acknowledged bug in AECreateAppleEvent with no known workaround.
+The bug is fixed in Mac OS X 10.3.
+.Sh AUTHOR
+.An "Nicholas Riley" Aq appswitch@sabi.net
+.\" .Sh HISTORY           \" Document history if command behaves in a unique manner
Index: /releases/appswitch/1.0.1/appswitch/appswitch.xcode/nicholas.pbxuser
===================================================================
--- /releases/appswitch/1.0.1/appswitch/appswitch.xcode/nicholas.pbxuser	(revision 162)
+++ /releases/appswitch/1.0.1/appswitch/appswitch.xcode/nicholas.pbxuser	(revision 162)
@@ -0,0 +1,699 @@
+// !$*UTF8*$!
+{
+	08FB7793FE84155DC02AAC07 = {
+		activeBuildStyle = 014CEA4A0018CE3211CA2923;
+		activeExecutable = E1A0BD2C03EFAD1C00050001;
+		activeTarget = 08FB779FFE84155DC02AAC07;
+		addToTargets = (
+			08FB779FFE84155DC02AAC07,
+		);
+		breakpoints = (
+			E18A0A3006336368008DC67C,
+			E18A0A39063363B8008DC67C,
+		);
+		codeSenseManager = E18A0A2A063362FF008DC67C;
+		executables = (
+			E1A0BD2C03EFAD1C00050001,
+		);
+		perUserDictionary = {
+			PBXConfiguration.PBXFileTableDataSource3.PBXExecutablesDataSource = {
+				PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
+				PBXFileTableDataSourceColumnSortingKey = PBXExecutablesDataSource_NameID;
+				PBXFileTableDataSourceColumnWidthsKey = (
+					22,
+					525.7974,
+				);
+				PBXFileTableDataSourceColumnsKey = (
+					PBXExecutablesDataSource_ActiveFlagID,
+					PBXExecutablesDataSource_NameID,
+				);
+			};
+			PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = {
+				PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
+				PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
+				PBXFileTableDataSourceColumnWidthsKey = (
+					20,
+					321,
+					20,
+					61,
+					43,
+					43,
+					20,
+				);
+				PBXFileTableDataSourceColumnsKey = (
+					PBXFileDataSource_FiletypeID,
+					PBXFileDataSource_Filename_ColumnID,
+					PBXFileDataSource_Built_ColumnID,
+					PBXFileDataSource_ObjectSize_ColumnID,
+					PBXFileDataSource_Errors_ColumnID,
+					PBXFileDataSource_Warnings_ColumnID,
+					PBXFileDataSource_Target_ColumnID,
+				);
+			};
+			PBXPerProjectTemplateStateSaveDate = 106378266;
+			PBXPrepackagedSmartGroups_v2 = (
+				{
+					PBXTransientLocationAtTop = bottom;
+					absolutePathToBundle = "";
+					activationKey = OldTargetSmartGroup;
+					clz = PBXTargetSmartGroup;
+					description = "Displays all targets of the project.";
+					globalID = 1C37FABC04509CD000000102;
+					name = Targets;
+					preferences = {
+						image = Targets;
+					};
+				},
+				{
+					PBXTransientLocationAtTop = bottom;
+					absolutePathToBundle = "";
+					clz = PBXTargetSmartGroup2;
+					description = "Displays all targets of the project as well as nested build phases.";
+					globalID = 1C37FBAC04509CD000000102;
+					name = Targets;
+					preferences = {
+						image = Targets;
+					};
+				},
+				{
+					PBXTransientLocationAtTop = bottom;
+					absolutePathToBundle = "";
+					clz = PBXExecutablesSmartGroup;
+					description = "Displays all executables of the project.";
+					globalID = 1C37FAAC04509CD000000102;
+					name = Executables;
+					preferences = {
+						image = Executable;
+					};
+				},
+				{
+					" PBXTransientLocationAtTop " = bottom;
+					absolutePathToBundle = "";
+					clz = PBXErrorsWarningsSmartGroup;
+					description = "Displays files with errors or warnings.";
+					globalID = 1C08E77C0454961000C914BD;
+					name = "Errors and Warnings";
+					preferences = {
+						fnmatch = "";
+						image = WarningsErrors;
+						recursive = 1;
+						regex = "";
+						root = "<PROJECT>";
+					};
+				},
+				{
+					PBXTransientLocationAtTop = bottom;
+					absolutePathToBundle = "";
+					clz = PBXFilenameSmartGroup;
+					description = "Filters items in a given group (potentially recursively) based on matching the name with the regular expression of the filter.";
+					globalID = 1CC0EA4004350EF90044410B;
+					name = "Implementation Files";
+					preferences = {
+						canSave = 1;
+						fnmatch = "";
+						image = SmartFolder;
+						isLeaf = 0;
+						recursive = 1;
+						regex = "?*\\.[mcMC]";
+						root = "<PROJECT>";
+					};
+				},
+				{
+					PBXTransientLocationAtTop = bottom;
+					absolutePathToBundle = "";
+					clz = PBXFilenameSmartGroup;
+					description = "This group displays Interface Builder NIB Files.";
+					globalID = 1CC0EA4004350EF90041110B;
+					name = "NIB Files";
+					preferences = {
+						canSave = 1;
+						fnmatch = "*.nib";
+						image = SmartFolder;
+						isLeaf = 0;
+						recursive = 1;
+						regex = "";
+						root = "<PROJECT>";
+					};
+				},
+				{
+					PBXTransientLocationAtTop = no;
+					absolutePathToBundle = "";
+					clz = PBXFindSmartGroup;
+					description = "Displays Find Results.";
+					globalID = 1C37FABC05509CD000000102;
+					name = "Find Results";
+					preferences = {
+						image = spyglass;
+					};
+				},
+				{
+					PBXTransientLocationAtTop = no;
+					absolutePathToBundle = "";
+					clz = PBXBookmarksSmartGroup;
+					description = "Displays Project Bookmarks.";
+					globalID = 1C37FABC05539CD112110102;
+					name = Bookmarks;
+					preferences = {
+						image = Bookmarks;
+					};
+				},
+				{
+					PBXTransientLocationAtTop = bottom;
+					absolutePathToBundle = "";
+					clz = XCSCMSmartGroup;
+					description = "Displays files with interesting SCM status.";
+					globalID = E2644B35053B69B200211256;
+					name = SCM;
+					preferences = {
+						image = PBXRepository;
+						isLeaf = 0;
+					};
+				},
+				{
+					PBXTransientLocationAtTop = bottom;
+					absolutePathToBundle = "";
+					clz = PBXSymbolsSmartGroup;
+					description = "Displays all symbols for the project.";
+					globalID = 1C37FABC04509CD000100104;
+					name = "Project Symbols";
+					preferences = {
+						image = ProjectSymbols;
+						isLeaf = 1;
+					};
+				},
+				{
+					PBXTransientLocationAtTop = bottom;
+					absolutePathToBundle = "";
+					clz = PBXFilenameSmartGroup;
+					description = "Filters items in a given group (potentially recursively) based on matching the name with the regular expression of the filter.";
+					globalID = PBXTemplateMarker;
+					name = "Simple Filter SmartGroup";
+					preferences = {
+						canSave = 1;
+						fnmatch = "*.nib";
+						image = SmartFolder;
+						isLeaf = 0;
+						recursive = 1;
+						regex = "";
+						root = "<PROJECT>";
+					};
+				},
+				{
+					PBXTransientLocationAtTop = bottom;
+					absolutePathToBundle = "";
+					clz = PBXFilenameSmartGroup;
+					description = "Filters items in a given group (potentially recursively) based on matching the name with the regular expression of the filter.";
+					globalID = PBXTemplateMarker;
+					name = "Simple Regular Expression SmartGroup";
+					preferences = {
+						canSave = 1;
+						fnmatch = "";
+						image = SmartFolder;
+						isLeaf = 0;
+						recursive = 1;
+						regex = "?*\\.[mcMC]";
+						root = "<PROJECT>";
+					};
+				},
+			);
+			PBXWorkspaceContents = (
+				{
+					PBXProjectWorkspaceModule_StateKey_Rev39 = {
+						PBXProjectWorkspaceModule_DEGV_Geometry = {
+							_collapsingFrameDimension = 0;
+							_indexOfCollapsedView = 0;
+							_percentageOfCollapsedView = 0;
+							isCollapsed = yes;
+							sizes = (
+								"{{0, 0}, {571, 121}}",
+								"{{0, 121}, {571, 544}}",
+							);
+						};
+						PBXProjectWorkspaceModule_DataSourceSelectionKey_Rev6 = {
+							BoundsStr = "{{0, 0}, {556, 104}}";
+							Rows = (
+								0,
+							);
+							VisibleRectStr = "{{0, 0}, {556, 104}}";
+						};
+						PBXProjectWorkspaceModule_EditorOpen = true;
+						PBXProjectWorkspaceModule_EmbeddedNavigatorGroup = {
+							PBXSplitModuleInNavigatorKey = {
+								Split0 = {
+									bookmark = E1CC5D69065735A3001A87C9;
+									history = (
+										E18A0A5B0633660A008DC67C,
+										E18A0A6B06336B3F008DC67C,
+										E173740F063370F0002A81F1,
+										E18A0A3A06336491008DC67C,
+										E1CC5D67065735A3001A87C9,
+										E18A0A500633657C008DC67C,
+									);
+									prevStack = (
+										E18A0A3C06336491008DC67C,
+										E18A0A6306336B3C008DC67C,
+										E18A0A6806336B3E008DC67C,
+										E18A0A6C06336B3F008DC67C,
+										E1CC5D68065735A3001A87C9,
+									);
+								};
+								SplitCount = 1;
+							};
+						};
+						PBXProjectWorkspaceModule_GeometryKey_Rev15 = {
+							PBXProjectWorkspaceModule_SGTM_Geometry = {
+								_collapsingFrameDimension = 0;
+								_indexOfCollapsedView = 0;
+								_percentageOfCollapsedView = 0;
+								sizes = (
+									"{{0, 0}, {182, 665}}",
+									"{{182, 0}, {571, 665}}",
+								);
+							};
+						};
+						PBXProjectWorkspaceModule_OldDetailFrame = "{{0, 0}, {571, 121}}";
+						PBXProjectWorkspaceModule_OldEditorFrame = "{{0, 121}, {571, 544}}";
+						PBXProjectWorkspaceModule_OldSuperviewFrame = "{{182, 0}, {571, 665}}";
+						PBXProjectWorkspaceModule_SGTM = {
+							PBXBottomSmartGroupGIDs = (
+								1C37FBAC04509CD000000102,
+								1C37FAAC04509CD000000102,
+								1C08E77C0454961000C914BD,
+								1CC0EA4004350EF90044410B,
+								1CC0EA4004350EF90041110B,
+								1C37FABC05509CD000000102,
+								1C37FABC05539CD112110102,
+								E2644B35053B69B200211256,
+								1C37FABC04509CD000100104,
+							);
+							PBXSmartGroupTreeModuleColumnData = {
+								PBXSmartGroupTreeModuleColumnWidthsKey = (
+									165,
+								);
+								PBXSmartGroupTreeModuleColumnsKey_v4 = (
+									MainColumn,
+								);
+							};
+							PBXSmartGroupTreeModuleOutlineStateKey_v7 = {
+								PBXSmartGroupTreeModuleOutlineStateExpansionKey = (
+									08FB7794FE84155DC02AAC07,
+									08FB7795FE84155DC02AAC07,
+									C6859E96029091FE04C91782,
+									1C37FAAC04509CD000000102,
+								);
+								PBXSmartGroupTreeModuleOutlineStateSelectionKey = (
+									(
+										6,
+										4,
+										0,
+									),
+								);
+								PBXSmartGroupTreeModuleOutlineStateVisibleRectKey = "{{0, 0}, {165, 647}}";
+							};
+							PBXTopSmartGroupGIDs = (
+							);
+						};
+					};
+				},
+			);
+			"PBXWorkspaceContents:PBXConfiguration.PBXModule.PBXBuildResultsModule" = {
+			};
+			"PBXWorkspaceContents:PBXConfiguration.PBXModule.PBXDebugCLIModule" = {
+			};
+			"PBXWorkspaceContents:PBXConfiguration.PBXModule.PBXDebugSessionModule" = {
+				Debugger = {
+					HorizontalSplitView = {
+						_collapsingFrameDimension = 0;
+						_indexOfCollapsedView = 0;
+						_percentageOfCollapsedView = 0;
+						isCollapsed = yes;
+						sizes = (
+							"{{0, 0}, {180, 195}}",
+							"{{180, 0}, {565, 195}}",
+						);
+					};
+					VerticalSplitView = {
+						_collapsingFrameDimension = 0;
+						_indexOfCollapsedView = 0;
+						_percentageOfCollapsedView = 0;
+						isCollapsed = yes;
+						sizes = (
+							"{{0, 0}, {745, 195}}",
+							"{{0, 195}, {745, 227}}",
+						);
+					};
+				};
+				LauncherConfigVersion = 8;
+			};
+			"PBXWorkspaceContents:PBXConfiguration.PBXModule.PBXNavigatorGroup" = {
+				PBXSplitModuleInNavigatorKey = {
+					SplitCount = 1;
+				};
+			};
+			"PBXWorkspaceContents:PBXConfiguration.PBXModule.PBXProjectWorkspaceModule" = {
+				PBXProjectWorkspaceModule_StateKey_Rev39 = {
+					PBXProjectWorkspaceModule_DEGV_Geometry = {
+						_collapsingFrameDimension = 0;
+						_indexOfCollapsedView = 0;
+						_percentageOfCollapsedView = 0;
+						isCollapsed = yes;
+						sizes = (
+							"{{0, 0}, {571, 115}}",
+							"{{0, 115}, {571, 550}}",
+						);
+					};
+					PBXProjectWorkspaceModule_DataSourceSelectionKey_Rev6 = {
+						BoundsStr = "{{0, 0}, {556, 98}}";
+						Rows = (
+							0,
+						);
+						VisibleRectStr = "{{0, 0}, {556, 98}}";
+					};
+					PBXProjectWorkspaceModule_EditorOpen = true;
+					PBXProjectWorkspaceModule_EmbeddedNavigatorGroup = {
+						PBXSplitModuleInNavigatorKey = {
+							Split0 = {
+								bookmark = E18A0A28063362F9008DC67C;
+								history = (
+									E18A0A22063362F5008DC67C,
+								);
+							};
+							SplitCount = 1;
+						};
+					};
+					PBXProjectWorkspaceModule_GeometryKey_Rev15 = {
+						PBXProjectWorkspaceModule_SGTM_Geometry = {
+							_collapsingFrameDimension = 0;
+							_indexOfCollapsedView = 0;
+							_percentageOfCollapsedView = 0;
+							sizes = (
+								"{{0, 0}, {182, 665}}",
+								"{{182, 0}, {571, 665}}",
+							);
+						};
+					};
+					PBXProjectWorkspaceModule_OldDetailFrame = "{{0, 0}, {571, 115}}";
+					PBXProjectWorkspaceModule_OldEditorFrame = "{{0, 115}, {571, 550}}";
+					PBXProjectWorkspaceModule_OldSuperviewFrame = "{{182, 0}, {571, 665}}";
+					PBXProjectWorkspaceModule_SGTM = {
+						PBXBottomSmartGroupGIDs = (
+							1C37FBAC04509CD000000102,
+							1C37FAAC04509CD000000102,
+							1C08E77C0454961000C914BD,
+							1CC0EA4004350EF90044410B,
+							1CC0EA4004350EF90041110B,
+							1C37FABC05509CD000000102,
+							1C37FABC05539CD112110102,
+							E2644B35053B69B200211256,
+							1C37FABC04509CD000100104,
+						);
+						PBXSmartGroupTreeModuleColumnData = {
+							PBXSmartGroupTreeModuleColumnWidthsKey = (
+								165,
+							);
+							PBXSmartGroupTreeModuleColumnsKey_v4 = (
+								MainColumn,
+							);
+						};
+						PBXSmartGroupTreeModuleOutlineStateKey_v7 = {
+							PBXSmartGroupTreeModuleOutlineStateExpansionKey = (
+								08FB7794FE84155DC02AAC07,
+								08FB7795FE84155DC02AAC07,
+							);
+							PBXSmartGroupTreeModuleOutlineStateSelectionKey = (
+								(
+									2,
+									1,
+									0,
+								),
+							);
+							PBXSmartGroupTreeModuleOutlineStateVisibleRectKey = "{{0, 0}, {165, 647}}";
+						};
+						PBXTopSmartGroupGIDs = (
+						);
+					};
+				};
+			};
+			PBXWorkspaceGeometries = (
+				{
+					Frame = "{{0, 0}, {753, 665}}";
+					PBXProjectWorkspaceModule_GeometryKey_Rev15 = {
+					};
+					RubberWindowFrame = "46 125 753 707 0 0 1280 832 ";
+				},
+			);
+			"PBXWorkspaceGeometries:PBXConfiguration.PBXModule.PBXBuildResultsModule" = {
+				Frame = "{{0, 0}, {480, 217}}";
+				PBXModuleWindowStatusBarHidden = YES;
+				RubberWindowFrame = "400 466 480 238 0 0 1280 832 ";
+			};
+			"PBXWorkspaceGeometries:PBXConfiguration.PBXModule.PBXDebugCLIModule" = {
+				Frame = "{{0, 0}, {400, 201}}";
+				PBXModuleWindowStatusBarHidden = YES;
+				RubberWindowFrame = "50 804 400 222 0 0 1280 832 ";
+			};
+			"PBXWorkspaceGeometries:PBXConfiguration.PBXModule.PBXDebugSessionModule" = {
+				DebugConsoleDrawerSize = "{100, 120}";
+				DebugConsoleVisible = Drawer;
+				DebugConsoleWindowFrame = "{{200, 200}, {500, 300}}";
+				DebugSTDIOWindowFrame = "{{200, 200}, {500, 300}}";
+				Frame = "{{0, 0}, {745, 422}}";
+				RubberWindowFrame = "398 164 745 464 0 0 1280 832 ";
+			};
+			"PBXWorkspaceGeometries:PBXConfiguration.PBXModule.PBXNavigatorGroup" = {
+				Frame = "{{0, 0}, {750, 481}}";
+				PBXModuleWindowStatusBarHidden = YES;
+				RubberWindowFrame = "15 325 750 502 0 0 1280 832 ";
+			};
+			"PBXWorkspaceGeometries:PBXConfiguration.PBXModule.PBXProjectWorkspaceModule" = {
+				Frame = "{{0, 0}, {753, 665}}";
+				PBXProjectWorkspaceModule_GeometryKey_Rev15 = {
+				};
+				RubberWindowFrame = "46 125 753 707 0 0 1280 832 ";
+			};
+			PBXWorkspaceStateSaveDate = 106378266;
+		};
+		perUserProjectItems = {
+			E173740F063370F0002A81F1 = E173740F063370F0002A81F1;
+			E18A0A3A06336491008DC67C = E18A0A3A06336491008DC67C;
+			E18A0A3C06336491008DC67C = E18A0A3C06336491008DC67C;
+			E18A0A500633657C008DC67C = E18A0A500633657C008DC67C;
+			E18A0A5B0633660A008DC67C = E18A0A5B0633660A008DC67C;
+			E18A0A6306336B3C008DC67C = E18A0A6306336B3C008DC67C;
+			E18A0A6806336B3E008DC67C = E18A0A6806336B3E008DC67C;
+			E18A0A6B06336B3F008DC67C = E18A0A6B06336B3F008DC67C;
+			E18A0A6C06336B3F008DC67C = E18A0A6C06336B3F008DC67C;
+			E1CC5D67065735A3001A87C9 = E1CC5D67065735A3001A87C9;
+			E1CC5D68065735A3001A87C9 = E1CC5D68065735A3001A87C9;
+			E1CC5D69065735A3001A87C9 = E1CC5D69065735A3001A87C9;
+		};
+		sourceControlManager = E18A0A29063362FF008DC67C;
+		userBuildSettings = {
+		};
+	};
+	08FB7796FE84155DC02AAC07 = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {530, 6287}}";
+			sepNavSelRange = "{16945, 0}";
+			sepNavVisRect = "{{0, 5419}, {530, 527}}";
+			sepNavWindowFrame = "{{15, 325}, {750, 502}}";
+		};
+	};
+	08FB779FFE84155DC02AAC07 = {
+		activeExec = 0;
+		executables = (
+			E1A0BD2C03EFAD1C00050001,
+		);
+	};
+	C6859E970290921104C91782 = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {530, 2027}}";
+			sepNavSelRange = "{122, 0}";
+			sepNavVisRect = "{{0, 1494}, {530, 533}}";
+		};
+	};
+	E16C83CC03F7AF7B00050002 = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {530, 1163}}";
+			sepNavSelRange = "{3337, 0}";
+			sepNavVisRect = "{{0, 456}, {530, 527}}";
+		};
+	};
+	E16C842F03FB74A500050002 = {
+		isa = PBXFileReference;
+		lastKnownFileType = sourcecode.c.h;
+		name = CFString.h;
+		path = /System/Library/Frameworks/CoreFoundation.framework/Versions/A/Headers/CFString.h;
+		refType = 0;
+		sourceTree = "<absolute>";
+	};
+	E173740F063370F0002A81F1 = {
+		fRef = C6859E970290921104C91782;
+		isa = PBXTextBookmark;
+		name = "appswitch.1: 4";
+		rLen = 0;
+		rLoc = 122;
+		rType = 0;
+		vrLen = 1440;
+		vrLoc = 4186;
+	};
+	E18A0A29063362FF008DC67C = {
+		isa = PBXSourceControlManager;
+		scmConfiguration = {
+		};
+		scmType = scm.cvs;
+	};
+	E18A0A2A063362FF008DC67C = {
+		indexTemplatePath = "";
+		isa = PBXCodeSenseManager;
+		usesDefaults = 1;
+		wantsCodeCompletion = 1;
+		wantsCodeCompletionAutoPopup = 1;
+		wantsCodeCompletionAutoSuggestions = 1;
+		wantsCodeCompletionCaseSensitivity = 1;
+		wantsCodeCompletionOnlyMatchingItems = 1;
+		wantsCodeCompletionParametersIncluded = 1;
+		wantsCodeCompletionPlaceholdersInserted = 1;
+		wantsCodeCompletionTabCompletes = 1;
+		wantsIndex = 1;
+	};
+	E18A0A3006336368008DC67C = {
+		fileReference = 08FB7796FE84155DC02AAC07;
+		functionName = "matchApplication()";
+		isa = PBXFileBreakpoint;
+		lineNumber = 355;
+		state = 1;
+	};
+	E18A0A39063363B8008DC67C = {
+		fileReference = 08FB7796FE84155DC02AAC07;
+		functionName = "matchApplication()";
+		isa = PBXFileBreakpoint;
+		lineNumber = 353;
+		state = 1;
+	};
+	E18A0A3A06336491008DC67C = {
+		exec = E1A0BD2C03EFAD1C00050001;
+		isa = PBXExecutableBookmark;
+	};
+	E18A0A3C06336491008DC67C = {
+		exec = E1A0BD2C03EFAD1C00050001;
+		isa = PBXExecutableBookmark;
+	};
+	E18A0A500633657C008DC67C = {
+		fRef = E16C83CC03F7AF7B00050002;
+		isa = PBXTextBookmark;
+		name = "README: 76";
+		rLen = 0;
+		rLoc = 2574;
+		rType = 0;
+		vrLen = 1666;
+		vrLoc = 1642;
+	};
+	E18A0A5B0633660A008DC67C = {
+		fRef = E16C842F03FB74A500050002;
+		isa = PBXTextBookmark;
+		name = CFComparisonResult;
+		rLen = 18;
+		rLoc = 17127;
+		rType = 0;
+		vrLen = 2160;
+		vrLoc = 16209;
+	};
+	E18A0A6306336B3C008DC67C = {
+		fRef = 08FB7796FE84155DC02AAC07;
+		isa = PBXTextBookmark;
+		name = "main.c: 249";
+		rLen = 0;
+		rLoc = 10218;
+		rType = 0;
+		vrLen = 1331;
+		vrLoc = 9714;
+	};
+	E18A0A6806336B3E008DC67C = {
+		fRef = C6859E970290921104C91782;
+		isa = PBXTextBookmark;
+		name = "appswitch.1: 1";
+		rLen = 0;
+		rLoc = 0;
+		rType = 0;
+		vrLen = 1708;
+		vrLoc = 0;
+	};
+	E18A0A6B06336B3F008DC67C = {
+		fRef = E1A0BD3203EFAD9E00050001;
+		isa = PBXTextBookmark;
+		name = "CPS.h: 1";
+		rLen = 0;
+		rLoc = 0;
+		rType = 0;
+		vrLen = 570;
+		vrLoc = 0;
+	};
+	E18A0A6C06336B3F008DC67C = {
+		fRef = E1A0BD3203EFAD9E00050001;
+		isa = PBXTextBookmark;
+		name = "CPS.h: 1";
+		rLen = 0;
+		rLoc = 0;
+		rType = 0;
+		vrLen = 570;
+		vrLoc = 0;
+	};
+	E1A0BD2C03EFAD1C00050001 = {
+		activeArgIndex = 2147483647;
+		activeArgIndices = (
+		);
+		argumentStrings = (
+		);
+		configStateDict = {
+		};
+		debuggerPlugin = GDBDebugging;
+		dylibVariantSuffix = "";
+		enableDebugStr = 1;
+		environmentEntries = (
+		);
+		isa = PBXExecutable;
+		name = appswitch;
+		shlibInfoDictList = (
+		);
+		sourceDirectories = (
+		);
+	};
+	E1A0BD3203EFAD9E00050001 = {
+		uiCtxt = {
+			sepNavIntBoundsRect = "{{0, 0}, {530, 3532}}";
+			sepNavSelRange = "{0, 0}";
+			sepNavVisRect = "{{0, 0}, {530, 533}}";
+		};
+	};
+	E1CC5D67065735A3001A87C9 = {
+		fRef = 08FB7796FE84155DC02AAC07;
+		isa = PBXTextBookmark;
+		name = "main.c: 420";
+		rLen = 0;
+		rLoc = 17006;
+		rType = 0;
+		vrLen = 1569;
+		vrLoc = 16415;
+	};
+	E1CC5D68065735A3001A87C9 = {
+		fRef = 08FB7796FE84155DC02AAC07;
+		isa = PBXTextBookmark;
+		name = "main.c: 420";
+		rLen = 0;
+		rLoc = 17006;
+		rType = 0;
+		vrLen = 1569;
+		vrLoc = 16415;
+	};
+	E1CC5D69065735A3001A87C9 = {
+		fRef = E16C83CC03F7AF7B00050002;
+		isa = PBXTextBookmark;
+		name = "README: 97";
+		rLen = 0;
+		rLoc = 3337;
+		rType = 0;
+		vrLen = 1567;
+		vrLoc = 1280;
+	};
+}
Index: /releases/appswitch/1.0.1/appswitch/appswitch.xcode/project.pbxproj
===================================================================
--- /releases/appswitch/1.0.1/appswitch/appswitch.xcode/project.pbxproj	(revision 162)
+++ /releases/appswitch/1.0.1/appswitch/appswitch.xcode/project.pbxproj	(revision 162)
@@ -0,0 +1,305 @@
+// !$*UTF8*$!
+{
+	archiveVersion = 1;
+	classes = {
+	};
+	objectVersion = 39;
+	objects = {
+		014CEA490018CE3211CA2923 = {
+			buildRules = (
+			);
+			buildSettings = {
+				COPY_PHASE_STRIP = NO;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_ENABLE_FIX_AND_CONTINUE = YES;
+				GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				OPTIMIZATION_CFLAGS = "-O0";
+				ZERO_LINK = YES;
+			};
+			isa = PBXBuildStyle;
+			name = Development;
+		};
+		014CEA4A0018CE3211CA2923 = {
+			buildRules = (
+			);
+			buildSettings = {
+				COPY_PHASE_STRIP = YES;
+				GCC_ENABLE_FIX_AND_CONTINUE = NO;
+				ZERO_LINK = NO;
+			};
+			isa = PBXBuildStyle;
+			name = Deployment;
+		};
+//010
+//011
+//012
+//013
+//014
+//030
+//031
+//032
+//033
+//034
+		034768E2FF38A6DC11DB9C8B = {
+			explicitFileType = "compiled.mach-o.executable";
+			fallbackIsa = PBXFileReference;
+			isa = PBXExecutableFileReference;
+			path = appswitch;
+			refType = 3;
+			sourceTree = BUILT_PRODUCTS_DIR;
+		};
+//030
+//031
+//032
+//033
+//034
+//080
+//081
+//082
+//083
+//084
+		08FB7793FE84155DC02AAC07 = {
+			buildSettings = {
+			};
+			buildStyles = (
+				014CEA490018CE3211CA2923,
+				014CEA4A0018CE3211CA2923,
+			);
+			hasScannedForEncodings = 1;
+			isa = PBXProject;
+			mainGroup = 08FB7794FE84155DC02AAC07;
+			projectDirPath = "";
+			targets = (
+				08FB779FFE84155DC02AAC07,
+			);
+		};
+		08FB7794FE84155DC02AAC07 = {
+			children = (
+				08FB7795FE84155DC02AAC07,
+				C6859E96029091FE04C91782,
+				08FB779DFE84155DC02AAC07,
+				19C28FBDFE9D53C911CA2CBB,
+			);
+			isa = PBXGroup;
+			name = appswitch;
+			refType = 4;
+			sourceTree = "<group>";
+		};
+		08FB7795FE84155DC02AAC07 = {
+			children = (
+				08FB7796FE84155DC02AAC07,
+				E1A0BD3203EFAD9E00050001,
+			);
+			isa = PBXGroup;
+			name = Source;
+			refType = 4;
+			sourceTree = "<group>";
+		};
+		08FB7796FE84155DC02AAC07 = {
+			fileEncoding = 4;
+			indentWidth = 4;
+			isa = PBXFileReference;
+			lastKnownFileType = sourcecode.c.c;
+			path = main.c;
+			refType = 4;
+			sourceTree = "<group>";
+			tabWidth = 8;
+			usesTabs = 0;
+		};
+		08FB779DFE84155DC02AAC07 = {
+			children = (
+				E1A0BD4C03EFB64400050001,
+			);
+			isa = PBXGroup;
+			name = "External Frameworks and Libraries";
+			refType = 4;
+			sourceTree = "<group>";
+		};
+		08FB779FFE84155DC02AAC07 = {
+			buildPhases = (
+				08FB77A0FE84155DC02AAC07,
+				08FB77A1FE84155DC02AAC07,
+				08FB77A3FE84155DC02AAC07,
+				08FB77A5FE84155DC02AAC07,
+				C6859E980290922304C91782,
+			);
+			buildSettings = {
+				FRAMEWORK_SEARCH_PATHS = "";
+				HEADER_SEARCH_PATHS = "";
+				INSTALL_PATH = "$(HOME)/bin";
+				LIBRARY_SEARCH_PATHS = "";
+				OTHER_CFLAGS = "";
+				OTHER_LDFLAGS = "";
+				OTHER_REZFLAGS = "";
+				PRODUCT_NAME = appswitch;
+				REZ_EXECUTABLE = YES;
+				SECTORDER_FLAGS = "";
+				WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+			};
+			dependencies = (
+			);
+			isa = PBXToolTarget;
+			name = appswitch;
+			productInstallPath = "$(HOME)/bin";
+			productName = appswitch;
+			productReference = 034768E2FF38A6DC11DB9C8B;
+		};
+		08FB77A0FE84155DC02AAC07 = {
+			buildActionMask = 2147483647;
+			files = (
+				E1A0BD3303EFAD9E00050001,
+			);
+			isa = PBXHeadersBuildPhase;
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		08FB77A1FE84155DC02AAC07 = {
+			buildActionMask = 2147483647;
+			files = (
+				08FB77A2FE84155DC02AAC07,
+			);
+			isa = PBXSourcesBuildPhase;
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		08FB77A2FE84155DC02AAC07 = {
+			fileRef = 08FB7796FE84155DC02AAC07;
+			isa = PBXBuildFile;
+			settings = {
+				ATTRIBUTES = (
+				);
+			};
+		};
+		08FB77A3FE84155DC02AAC07 = {
+			buildActionMask = 2147483647;
+			files = (
+				E1A0BD4D03EFB64400050001,
+			);
+			isa = PBXFrameworksBuildPhase;
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		08FB77A5FE84155DC02AAC07 = {
+			buildActionMask = 2147483647;
+			files = (
+			);
+			isa = PBXRezBuildPhase;
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+//080
+//081
+//082
+//083
+//084
+//190
+//191
+//192
+//193
+//194
+		19C28FBDFE9D53C911CA2CBB = {
+			children = (
+				034768E2FF38A6DC11DB9C8B,
+			);
+			isa = PBXGroup;
+			name = Products;
+			refType = 4;
+			sourceTree = "<group>";
+		};
+//190
+//191
+//192
+//193
+//194
+//C60
+//C61
+//C62
+//C63
+//C64
+		C6859E96029091FE04C91782 = {
+			children = (
+				C6859E970290921104C91782,
+				E16C83CC03F7AF7B00050002,
+			);
+			isa = PBXGroup;
+			name = Documentation;
+			refType = 4;
+			sourceTree = "<group>";
+		};
+		C6859E970290921104C91782 = {
+			isa = PBXFileReference;
+			lastKnownFileType = text.man;
+			path = appswitch.1;
+			refType = 4;
+			sourceTree = "<group>";
+		};
+		C6859E980290922304C91782 = {
+			buildActionMask = 8;
+			dstPath = /usr/share/man/man1/;
+			dstSubfolderSpec = 0;
+			files = (
+				C6859E990290922B04C91782,
+				E16C83CD03F7AF7B00050002,
+			);
+			isa = PBXCopyFilesBuildPhase;
+			runOnlyForDeploymentPostprocessing = 1;
+		};
+		C6859E990290922B04C91782 = {
+			fileRef = C6859E970290921104C91782;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+//C60
+//C61
+//C62
+//C63
+//C64
+//E10
+//E11
+//E12
+//E13
+//E14
+		E16C83CC03F7AF7B00050002 = {
+			fileEncoding = 4;
+			isa = PBXFileReference;
+			lastKnownFileType = text;
+			path = README;
+			refType = 4;
+			sourceTree = "<group>";
+		};
+		E16C83CD03F7AF7B00050002 = {
+			fileRef = E16C83CC03F7AF7B00050002;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		E1A0BD3203EFAD9E00050001 = {
+			fileEncoding = 30;
+			isa = PBXFileReference;
+			lastKnownFileType = sourcecode.c.h;
+			path = CPS.h;
+			refType = 4;
+			sourceTree = "<group>";
+		};
+		E1A0BD3303EFAD9E00050001 = {
+			fileRef = E1A0BD3203EFAD9E00050001;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		E1A0BD4C03EFB64400050001 = {
+			fallbackIsa = PBXFileReference;
+			isa = PBXFrameworkReference;
+			lastKnownFileType = wrapper.framework;
+			name = ApplicationServices.framework;
+			path = /System/Library/Frameworks/ApplicationServices.framework;
+			refType = 0;
+			sourceTree = "<absolute>";
+		};
+		E1A0BD4D03EFB64400050001 = {
+			fileRef = E1A0BD4C03EFB64400050001;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+	};
+	rootObject = 08FB7793FE84155DC02AAC07;
+}
Index: /releases/appswitch/1.0.1/appswitch/main.c
===================================================================
--- /releases/appswitch/1.0.1/appswitch/main.c	(revision 162)
+++ /releases/appswitch/1.0.1/appswitch/main.c	(revision 162)
@@ -0,0 +1,463 @@
+/*
+ appswitch - a command-line application switcher
+ Nicholas Riley <appswitch@sabi.net>
+
+ Copyright (c) 2003-04, Nicholas Riley
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+ * Neither the name of this software nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+*/
+
+#define DEBUG 0
+
+#include <unistd.h>
+#include <sys/ioctl.h>
+#include "CPS.h"
+
+const char *APP_NAME;
+
+#define VERSION "1.0.1"
+
+struct {
+    OSType creator;
+    CFStringRef bundleID;
+    char *name;
+    pid_t pid;
+    char *path;
+    enum {
+        MATCH_UNKNOWN, MATCH_FRONT, MATCH_CREATOR, MATCH_BUNDLE_ID, MATCH_NAME, MATCH_PID, MATCH_PATH, MATCH_ALL
+    } matchType;
+    enum {
+        APP_NONE, APP_SWITCH, APP_SHOW, APP_HIDE, APP_QUIT, APP_KILL, APP_KILL_HARD, APP_LIST, APP_PRINT_PID
+    } appAction;
+    Boolean longList;
+    enum {
+        ACTION_NONE, ACTION_SHOW_ALL, ACTION_HIDE_OTHERS
+    } action;
+    enum {
+        FINAL_NONE, FINAL_SWITCH
+    } finalAction;
+} OPTS =
+{
+    kLSUnknownCreator, NULL, NULL, -1, NULL, MATCH_UNKNOWN, APP_NONE, ACTION_NONE, FINAL_NONE, false
+};
+
+typedef struct {
+    OSStatus status;
+    const char *desc;
+} errRec, errList[];
+
+static errList ERRS = {
+    // Process Manager errors
+    { appIsDaemon, "application is background-only\n", },
+    { procNotFound, "unable to connect to system service.\nAre you logged in?" },
+    // CoreGraphics errors
+    { kCGErrorIllegalArgument, "window server error.\nAre you logged in?" },
+    { fnfErr, "file not found" },
+    { 0, NULL }
+};
+
+void usage() {
+    fprintf(stderr, "usage: %s [-sShHqkFlLP] [-c creator] [-i bundleID] [-a name] [-p pid] [path]\n"
+            "  -s            show application, bring windows to front (do not switch)\n"
+            "  -S            show all applications\n"
+            "  -h            hide application\n"
+            "  -H            hide other applications\n"
+            "  -q            quit application\n"
+            "  -k            kill application (SIGINT)\n"
+            "  -K            kill application hard (SIGKILL)\n"
+            "  -l            list applications\n"
+            "  -L            list applications including full paths and bundle identifiers\n"
+            "  -P            print application process ID\n"
+            "  -F            bring current application's windows to front\n"
+            "  -c creator    match application by four-character creator code ('ToyS')\n"
+            "  -i bundle ID  match application by bundle identifier (com.apple.scripteditor)\n"
+            "  -p pid        match application by process identifier [slower]\n"
+            "  -a name       match application by name\n"
+            , APP_NAME);
+    fprintf(stderr, "appswitch "VERSION" (c) 2003 Nicholas Riley <http://web.sabi.net/nriley/software/>.\n"
+            "Please send bugs, suggestions, etc. to <appswitch@sabi.net>.\n");
+
+    exit(1);
+}
+
+char *osstatusstr(OSStatus err) {
+    errRec *rec;
+    const char *errDesc = "unknown error";
+    char * const failedStr = "(unable to retrieve error message)";
+    static char *str = NULL;
+    size_t len;
+    if (str != NULL && str != failedStr) free(str);
+    for (rec = &(ERRS[0]) ; rec->status != 0 ; rec++)
+        if (rec->status == err) {
+            errDesc = rec->desc;
+            break;
+        }
+            len = strlen(errDesc) + 10 * sizeof(char);
+    str = (char *)malloc(len);
+    if (str != NULL)
+        snprintf(str, len, "%s (%ld)", errDesc, err);
+    else
+        str = failedStr;
+    return str;
+}
+
+void osstatusexit(OSStatus err, const char *fmt, ...) {
+    va_list ap;
+    const char *errDesc = osstatusstr(err);
+    va_start(ap, fmt);
+    fprintf(stderr, "%s: ", APP_NAME);
+    vfprintf(stderr, fmt, ap);
+    fprintf(stderr, ": %s\n", errDesc);
+    exit(1);
+}
+
+void errexit(const char *fmt, ...) {
+    va_list ap;
+    va_start(ap, fmt);
+    fprintf(stderr, "%s: ", APP_NAME);
+    vfprintf(stderr, fmt, ap);
+    fprintf(stderr, "\n");
+    exit(1);
+}
+
+void getargs(int argc, char * const argv[]) {
+    extern char *optarg;
+    extern int optind;
+    int ch;
+
+    if (argc == 1) usage();
+
+    const char *opts = "c:i:p:a:sShHqkKlLPF";
+
+    while ( (ch = getopt(argc, argv, opts)) != -1) {
+        switch (ch) {
+            case 'p':
+                if (OPTS.matchType != MATCH_UNKNOWN) errexit("choose only one of -c, -i, -p, -a options");
+                if (sscanf(optarg, "%d", &OPTS.pid) != 1 || OPTS.pid < 0)
+                    errexit("invalid process identifier (argument of -p)");
+                OPTS.matchType = MATCH_PID;
+                break;
+            case 'c':
+                if (OPTS.matchType != MATCH_UNKNOWN) errexit("choose only one of -c, -i, -p, -a options");
+                if (strlen(optarg) != 4) errexit("creator (argument of -c) must be four characters long");
+                OPTS.creator = *(OSTypePtr)optarg;
+                OPTS.matchType = MATCH_CREATOR;
+                break;
+            case 'i':
+                if (OPTS.matchType != MATCH_UNKNOWN) errexit("choose only one of -c, -i, -p, -a options");
+                OPTS.bundleID = CFStringCreateWithCString(NULL, optarg, CFStringGetSystemEncoding());
+                OPTS.matchType = MATCH_BUNDLE_ID;
+                break;
+            case 'a':
+                if (OPTS.matchType != MATCH_UNKNOWN) errexit("choose only one of -c, -i, -p, -a options");
+                OPTS.name = strdup(optarg);
+                OPTS.matchType = MATCH_NAME;
+                break;
+            case 's':
+                if (OPTS.appAction != APP_NONE) errexit("choose only one of -s, -h, -q, -k, -K, -l, -L, -P options");
+                OPTS.appAction = APP_SHOW;
+                break;
+            case 'h':
+                if (OPTS.appAction != APP_NONE) errexit("choose only one of -s, -h, -q, -k, -K, -l, -L, -P options");
+                OPTS.appAction = APP_HIDE;
+                break;
+            case 'q':
+                if (OPTS.appAction != APP_NONE) errexit("choose only one of -s, -h, -q, -k, -K, -l, -L, -P options");
+                OPTS.appAction = APP_QUIT;
+                break;
+            case 'k':
+                if (OPTS.appAction != APP_NONE) errexit("choose only one of -s, -h, -q, -k, -K, -l, -L, -P options");
+                OPTS.appAction = APP_KILL;
+                break;
+            case 'K':
+                if (OPTS.appAction != APP_NONE) errexit("choose only one of -s, -h, -q, -k, -K, -l, -L, -P options");
+                OPTS.appAction = APP_KILL_HARD;
+                break;
+            case 'l':
+                if (OPTS.appAction != APP_NONE) errexit("choose only one of -s, -h, -q, -k, -K, -l, -L, -P options");
+                OPTS.appAction = APP_LIST;
+                break;
+            case 'L':
+                if (OPTS.appAction != APP_NONE) errexit("choose only one of -s, -h, -q, -k, -K, -l, -L, -P options");
+                OPTS.appAction = APP_LIST;
+                OPTS.longList = true;
+                break;
+            case 'P':
+                if (OPTS.appAction != APP_NONE) errexit("choose only one of -s, -h, -q, -k, -K, -l, -P options");
+                OPTS.appAction = APP_PRINT_PID;
+                break;
+            case 'S':
+                if (OPTS.action != ACTION_NONE) errexit("choose -S, -H or neither option");
+                OPTS.action = ACTION_SHOW_ALL;
+                break;
+            case 'H':
+                if (OPTS.action != ACTION_NONE) errexit("choose -S, -H or neither option");
+                OPTS.action = ACTION_HIDE_OTHERS;
+                break;
+            case 'F':
+                if (OPTS.finalAction != FINAL_NONE) errexit("choose only one -F option");
+                OPTS.finalAction = FINAL_SWITCH;
+                break;
+            default: usage();
+        }
+    }
+
+    argc -= optind;
+    argv += optind;
+
+    if (OPTS.matchType != MATCH_UNKNOWN && argc != 0) usage();
+
+    if (OPTS.matchType == MATCH_UNKNOWN) {
+        if (argc == 0) {
+            if (OPTS.appAction == APP_LIST) {
+                OPTS.matchType = MATCH_ALL;
+            } else if (OPTS.action != ACTION_NONE || OPTS.finalAction != FINAL_NONE) {
+                OPTS.matchType = MATCH_FRONT;
+            } else usage();
+        } else if (argc == 1) {
+            OPTS.path = argv[0];
+            OPTS.matchType = MATCH_PATH;
+        } else usage();
+    }
+
+    if (OPTS.matchType != MATCH_FRONT && OPTS.appAction == APP_NONE)
+        OPTS.appAction = APP_SWITCH;
+
+}
+
+CPSProcessSerNum frontApplication() {
+    CPSProcessSerNum psn;
+    OSStatus err = CPSGetFrontProcess(&psn);
+    if (err != noErr) osstatusexit(err, "can't get frontmost process");
+#if DEBUG
+    fprintf(stderr, "front application PSN %ld.%ld\n", psn.hi, psn.lo);
+#endif
+    return psn;
+}
+
+Boolean bundleIdentifierForApplication(CFStringRef *bundleID, char *path) {
+    CFURLRef url = CFURLCreateFromFileSystemRepresentation(NULL, path, strlen(path), false);
+    if (url == NULL) return false;
+    CFBundleRef bundle = CFBundleCreate(NULL, url);
+    if (bundle != NULL) {
+        *bundleID = CFBundleGetIdentifier(bundle);
+        if (*bundleID != NULL) {
+            CFRetain(*bundleID);
+#if DEBUG
+            CFShow(*bundleID);
+#endif
+        }
+        CFRelease(bundle);
+    } else {
+        *bundleID = NULL;
+    }
+    CFRelease(url);
+    return true;
+}
+
+OSStatus quitApplication(CPSProcessSerNum *psn) {
+    AppleEvent event;
+    AEAddressDesc appDesc;
+    OSStatus err;
+
+    AEInitializeDesc(&appDesc);
+    err = AECreateDesc(typeProcessSerialNumber, psn, sizeof(*psn), &appDesc);
+    if (err != noErr) return err;
+
+    // XXX AECreateAppleEvent is very slow in Mac OS X 10.2.4 and earlier.
+    // XXX This is Apple's bug: <http://lists.apple.com/archives/applescript-implementors/2003/Feb/19/aecreateappleeventfromco.txt>
+    err = AECreateAppleEvent(kCoreEventClass, kAEQuitApplication, &appDesc, kAutoGenerateReturnID, kAnyTransactionID, &event);
+    if (err != noErr) return err;
+
+    AppleEvent nullReply = {typeNull, nil};
+    err = AESendMessage(&event, &nullReply, kAENoReply, kNoTimeOut);
+    (void)AEDisposeDesc(&event);
+    if (err != noErr) return err;
+
+    (void)AEDisposeDesc(&nullReply); // according to docs, don't call unless AESend returned successfully
+
+    return noErr;
+}
+
+CPSProcessSerNum matchApplication(CPSProcessInfoRec *info) {
+    long pathMaxLength = pathconf("/", _PC_PATH_MAX);
+    long nameMaxLength = pathconf("/", _PC_NAME_MAX);
+
+    char *path = (char *)malloc(pathMaxLength);
+    char *name = (char *)malloc(nameMaxLength);;
+
+    if (path == NULL || name == NULL) errexit("can't allocate memory for path or filename buffer");
+
+    if (OPTS.matchType == MATCH_FRONT) return frontApplication();
+
+    OSStatus err;
+    CPSProcessSerNum psn = {
+        kNoProcess, kNoProcess
+    };
+    int len;
+    char *format = NULL;
+    if (OPTS.appAction == APP_LIST) {
+        int termwidth = 80;
+        struct winsize ws;
+        char *banner = "        PSN   PID TYPE CREA NAME               ";
+                     // 123456789.0 12345 1234 1234 1234567890123456789
+        if ((ioctl(STDOUT_FILENO, TIOCGWINSZ, (char *)&ws) != -1 ||
+             ioctl(STDERR_FILENO, TIOCGWINSZ, (char *)&ws) != -1 ||
+             ioctl(STDIN_FILENO,  TIOCGWINSZ, (char *)&ws) != -1) ||
+            ws.ws_col != 0) termwidth = ws.ws_col;
+        char *formatButPath = "%9ld.%ld %5ld %c%c%c%c %c%c%c%c %-19.19s";
+        int pathlen = termwidth - strlen(banner) - 1;
+        // XXX don't ever free 'format', should fix if we get called repeatedly
+        if (OPTS.longList) {
+            printf("%s PATH (bundle identifier)\n", banner);
+            asprintf(&format, "%s %%s", formatButPath);
+        } else if (pathlen >= 4) {
+            printf("%s PATH\n", banner);
+            asprintf(&format, "%s %%-%d.%ds", formatButPath, pathlen, pathlen);
+        } else {
+            format = formatButPath;
+        }
+    }
+    
+    while ( (err = CPSGetNextProcess(&psn)) == noErr) {
+        err = CPSGetProcessInfo(&psn, info, path, pathMaxLength, &len, name, nameMaxLength);
+        if (err != noErr) osstatusexit(err, "can't get information for process PSN %ld.%ld", psn.hi, psn.lo);
+
+#if DEBUG
+        fprintf(stderr, "%ld.%ld: %s : %s\n", psn.hi, psn.lo, name, path);
+#endif
+
+        switch (OPTS.matchType) {
+            case MATCH_ALL:
+                break;
+            case MATCH_CREATOR: if (OPTS.creator != info->ExecFileCreator) continue;
+                break;
+            case MATCH_NAME: if (strcmp(name, OPTS.name) != 0) continue;
+                break;
+            case MATCH_PID: if (OPTS.pid != info->UnixPID) continue;
+                break;
+            case MATCH_PATH: if (strcmp(path, OPTS.path) != 0) continue;
+                break;
+            case MATCH_BUNDLE_ID:
+               {
+                   CFStringRef bundleID;
+                   if (!bundleIdentifierForApplication(&bundleID, path))
+                       errexit("can't get bundle location for process '%s' (PSN %ld.%ld, pid %ld)", name, psn.hi, psn.lo, info->UnixPID);
+                   if (bundleID != NULL) {
+                       CFComparisonResult result = CFStringCompare(OPTS.bundleID, bundleID, kCFCompareCaseInsensitive);
+                       if (result == kCFCompareEqualTo)
+                           break;
+		       CFRelease(bundleID);
+                   }
+                   continue;
+               }
+            default:
+                errexit("internal error: invalid match type");
+        }
+        if (OPTS.appAction == APP_LIST) {
+            char *type = (char *)&(info->ExecFileType), *crea = (char *)&(info->ExecFileCreator);
+#define CXX(c) ( (c) < ' ' ? ' ' : (c) )
+#define OSTYPE_CHAR_ARGS(t) CXX(t[0]), CXX(t[1]), CXX(t[2]), CXX(t[3])
+            printf(format, psn.hi, psn.lo, info->UnixPID,
+		   OSTYPE_CHAR_ARGS(type), OSTYPE_CHAR_ARGS(crea),
+                   name, path);
+            if (OPTS.longList) {
+                CFStringRef bundleID = NULL;
+                if (!bundleIdentifierForApplication(&bundleID, path))
+                    errexit("can't get bundle location for process '%s' (PSN %ld.%ld, pid %ld)", name, psn.hi, psn.lo, info->UnixPID);
+                if (bundleID != NULL) {
+                    char *bundleIDStr = (char *)CFStringGetCStringPtr(bundleID, CFStringGetSystemEncoding());
+                    if (bundleIDStr == NULL) {
+                        CFIndex bundleIDLength = CFStringGetLength(bundleID) + 1;
+                        bundleIDStr = (char *)malloc(bundleIDLength * sizeof(char));
+                        if (!CFStringGetCString(bundleID, bundleIDStr, bundleIDLength, CFStringGetSystemEncoding())) {
+                            CFShow(bundleIDStr);
+                            errexit("internal error: string encoding conversion failed for bundle identifier");
+                        }
+                        printf(" (%s)", bundleIDStr);
+                        free(bundleIDStr);
+                    } else {
+                        printf(" (%s)", bundleIDStr);
+                    }
+                    CFRelease(bundleID);
+                }
+            }
+            putchar('\n');
+            continue;
+        }
+        return psn;
+    }
+    if (err != procNotFound) osstatusexit(err, "can't get next process");
+
+    if (OPTS.appAction == APP_LIST) return frontApplication();
+
+    errexit("can't find matching process");
+    return psn;
+}
+
+int main(int argc, char * const argv[]) {
+    OSStatus err = noErr;
+
+    APP_NAME = argv[0];
+    getargs(argc, argv);
+
+    // need to establish connection with window server
+    InitCursor();
+
+    CPSProcessInfoRec info;
+    CPSProcessSerNum psn = matchApplication(&info);
+
+    const char *verb = NULL;
+    switch (OPTS.appAction) {
+        case APP_NONE: break;
+        case APP_LIST: break; // already handled in matchApplication
+        case APP_SWITCH: err = CPSSetFrontProcess(&psn); verb = "set front"; break;
+        case APP_SHOW: err = CPSPostShowReq(&psn); verb = "show"; break;
+        case APP_HIDE: err = CPSPostHideReq(&psn); verb = "hide"; break;
+        case APP_QUIT: err = quitApplication(&psn); verb = "quit"; break;
+        case APP_KILL: err = CPSPostKillRequest(&psn, kNilOptions); verb = "kill"; break;
+        case APP_KILL_HARD: err = CPSPostKillRequest(&psn, bfCPSKillHard); verb = "kill"; break;
+        case APP_PRINT_PID:
+            if (info.UnixPID <= 0) errexit("can't get process ID");
+            printf("%lu\n", info.UnixPID); // pid_t is signed, but this field isn't
+            break;
+        default:
+            errexit("internal error: invalid application action");
+    }
+    if (err != noErr) osstatusexit(err, "can't %s process", verb);
+
+    switch (OPTS.action) {
+        case ACTION_NONE: break;
+        case ACTION_SHOW_ALL: err = CPSPostShowAllReq(&psn); verb = "show all"; break;
+        case ACTION_HIDE_OTHERS: err = CPSPostHideMostReq(&psn); verb = "hide other"; break;
+        default:
+            errexit("internal error: invalid action");
+    }
+    if (err != noErr) osstatusexit(err, "can't %s processes", verb);
+
+    switch (OPTS.finalAction) {
+        case FINAL_NONE: break;
+        case FINAL_SWITCH:
+            psn = frontApplication();
+#if DEBUG
+            fprintf(stderr, "posting show request for %ld.%ld\n", psn.hi, psn.lo);
+#endif
+            if (OPTS.action != ACTION_NONE) usleep(750000); // XXX
+            err = CPSPostShowReq(&psn) || CPSSetFrontProcess(&psn);
+            verb = "bring current application's windows to the front";
+            break;
+        default:
+            errexit("internal error: invalid final action");    
+    }
+    if (err != noErr) osstatusexit(err, "can't %s", verb);
+
+    exit(0);
+}
Index: /releases/appswitch/1.0.1/package-appswitch.sh
===================================================================
--- /releases/appswitch/1.0.1/package-appswitch.sh	(revision 162)
+++ /releases/appswitch/1.0.1/package-appswitch.sh	(revision 162)
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+set -x -v
+
+cd appswitch && \
+find . -name \*~ -exec rm '{}' \; && \
+xcodebuild && \
+SetFile -c 'R*ch' -t 'TEXT' README VERSION && \
+strip build/appswitch && \
+sudo /usr/bin/install -c build/appswitch /usr/local/bin && \
+sudo /usr/bin/install -c appswitch.1 /usr/local/man/man1 && \
+chmod 755 build/appswitch && \
+chmod 644 appswitch.1 && \
+rm -rf build/appswitch.build build/intermediates build/.gdb_history && \
+VERSION=`cat VERSION` TARBALL="appswitch-$VERSION.tar.gz" && \
+DMG="appswitch-$VERSION.dmg" VOL="appswitch $VERSION" MOUNTPOINT="/Volumes/$VOL" && \
+cd .. && \
+rm -f appswitch-$VERSION $TARBALL $DMG && \
+ln -s appswitch appswitch-$VERSION && \
+tar --owner=root --group=wheel --exclude=.DS_Store --exclude=.svn --exclude=.gdb_history -zchf appswitch-$VERSION.tar.gz appswitch-$VERSION && \
+#hdiutil create $DMG -megabytes 5 -ov -type UDIF && \
+#DISK=`hdid $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 launch "$MOUNTPOINT" && \
+#ditto -rsrc "InstallAnywhere/launch_Web_Installers/InstData/MacOSX/Install launch $VERSION.sit" "/Volumes/launch $VERSION" && \
+#launch "$MOUNTPOINT/Install launch $VERSION.sit" && \
+#./openUp "$MOUNTPOINT" && \
+#sleep 2 && \
+## hdiutil eject $DISK && \ # this doesn't work
+#osascript -e "tell application \"Finder\" to eject disk \"$VOL\"" && \
+#hdiutil convert $DMG -format UDZO -o z$DMG && \
+#mv z$DMG $DMG && \
+scp $TARBALL ainaz:web/nriley/software/ #$DMG 
+:
