/* $Header: /cvsroot/macperl/perl/macos/ext/MacPerl/OSA.xs,v 1.4 2002/11/13 02:04:53 pudge Exp $ * * Copyright (c) 1995 Matthias Neeracher * * You may distribute under the terms of the Perl Artistic License, * as specified in the README file. * * $Log: OSA.xs,v $ * Revision 1.4 2002/11/13 02:04:53 pudge * Aieeeeee! Big ol' Carbon update. * * Revision 1.3 2001/12/19 22:54:15 pudge * Make DoAppleScript return errors in $@ * * Revision 1.2 2001/04/16 04:45:15 neeri * Switch from atexit() to Perl_call_atexit (MacPerl bug #232158) * * Revision 1.1 2000/08/14 03:39:34 neeri * Checked into Sourceforge * * Revision 1.1 2000/05/14 21:45:04 neeri * First build released to public * * Revision 1.1 1997/04/07 20:51:08 neeri * Synchronized with MacPerl 5.1.4a1 * */ #define MAC_CONTEXT #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #ifndef MACOS_TRADITIONAL #include "../Carbon.h" #endif #include #include #include #include #include #include ComponentInstance gScriptingComponent; void ShutDownAppleScript(pTHX_ void * p) { CloseComponent(gScriptingComponent); gScriptingComponent = nil; } OSErr InitAppleScript(void) { OSErr myErr; ComponentDescription descr; ComponentDescription capabilities; Component myComponent; short retryCount; long res; retryCount = 0; if (Gestalt(gestaltAppleEventsAttr, &res)) return -1; else if (!(res & (1<