UserTalk.h

Go to the documentation of this file.
00001 
00002 /*  $Id: UserTalk.h 355 2005-01-11 22:48:55Z andreradke $    */
00003 
00004 /******************************************************************************
00005 
00006     UserLand Frontier(tm) -- High performance Web content management,
00007     object database, system-level and Internet scripting environment,
00008     including source code editing and debugging.
00009 
00010     Copyright (C) 1992-2004 UserLand Software, Inc.
00011 
00012     This program is free software; you can redistribute it and/or modify
00013     it under the terms of the GNU General Public License as published by
00014     the Free Software Foundation; either version 2 of the License, or
00015     (at your option) any later version.
00016 
00017     This program is distributed in the hope that it will be useful,
00018     but WITHOUT ANY WARRANTY; without even the implied warranty of
00019     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020     GNU General Public License for more details.
00021 
00022     You should have received a copy of the GNU General Public License
00023     along with this program; if not, write to the Free Software
00024     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025 
00026 ******************************************************************************/
00027 
00028 /*
00029 Open Scripting Architecture: UserTalk Specific Interface
00030 */
00031 
00032 
00033 #ifndef __usertalkinclude__
00034 #define __usertalkinclude__
00035 
00036 #ifndef __OSA__
00037     #include <OSA.h>
00038 #endif
00039 
00040 #ifdef __cplusplus
00041 extern "C" {
00042 #endif
00043 
00044 
00045 /*types and constants*/
00046 
00047 #define typeUserTalk                    'LAND'
00048 
00049 #define kUserTalkSubtype                typeUserTalk
00050 
00051 #define typeUserTalkSourceType          typeChar
00052 
00053 #define typeUserTalkStorage             typeUserTalk
00054 
00055 
00056 /*mode flags*/
00057 
00058 #define kOSAModeDebug                   0x00010000
00059 #define kOSAModeTransparentScope        0x00020000
00060 
00061 
00062 /*component selectors*/
00063 
00064 #define kOSASelectSetDebugProc          0x1001
00065 #define kOSASelectDebug                 0x1002
00066 
00067 
00068 /*setting the DebugProc*/
00069 
00070 typedef pascal OSErr (*OSADebugProcPtr) (long refCon);
00071 
00072 enum {
00073     uppOSADebugProcInfo = kPascalStackBased
00074          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
00075          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
00076 };
00077 
00078 #if USESROUTINEDESCRIPTORS
00079     typedef UniversalProcPtr OSADebugUPP;
00080     
00081     #define CallOSADebugProc(userRoutine, refCon)       \
00082             CallUniversalProc((UniversalProcPtr)(userRoutine), uppOSADebugProcInfo, (refCon))
00083     #define NewOSADebugProc(userRoutine)        \
00084             (OSADebugUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppOSADebugProcInfo, GetCurrentISA())
00085 #else
00086     typedef OSADebugProcPtr OSADebugUPP;
00087     
00088     #define CallOSADebugProc(userRoutine, refCon)       \
00089             (*(userRoutine))((refCon))
00090     #define NewOSADebugProc(userRoutine)        \
00091             (OSADebugUPP)(userRoutine)
00092 #endif
00093 
00094 pascal OSAError OSASetDebugProc (ComponentInstance      scriptingComponent,
00095                                  OSADebugProcPtr        debugProc,
00096                                  long                   refCon)
00097  FIVEWORDINLINE(0x2F3C, 8, kOSASelectSetDebugProc, 0x7000, 0xA82A);
00098 //  OSAComponentFunctionInline (kOSASelectSetDebugProc, 8);
00099     
00100     /*
00101     this routine is called during script execution if the the kOSAMode
00102     if debugProc is nil, no debugging will take place subsequently.
00103     
00104     errors:
00105         badComponentInstance    invalid scripting component instance
00106         errOSASystemError
00107     */
00108 
00109 
00110 /*getting debugging information*/
00111 
00112 pascal OSAError OSADebug (ComponentInstance scriptingComponent,
00113                           OSType            selector,
00114                           const AEDesc*     selectorData,
00115                           DescType          desiredType,
00116                           AEDesc*           resultingDebugInfoOrDataToSet)
00117  FIVEWORDINLINE(0x2F3C, 16, kOSASelectDebug, 0x7000, 0xA82A);
00118 //  OSAComponentFunctionInline (kOSASelectDebug, 16);
00119     
00120     /*
00121     whenever script execution calls back to the DebugProc, this routine may
00122     be used to get information about the current debugging state.  the selector 
00123     describes the type of information desired about the state (various selectors 
00124     are listed below).  the desiredType indicates the data type of the result
00125     desired for that selector.
00126     
00127     errors:
00128         badComponentInstance    invalid scripting component instance
00129         errOSASystemError
00130         errOSABadSelector:      selector not supported by scripting component
00131         errAECoercionFail:      desiredType not supported by scripting component
00132     */
00133 
00134 
00135 /*OSADebug selectors*/
00136 
00137 #define kOSADebugGetData                    'getd'
00138     /*
00139     this selector is used to determine the value of a variable or other 
00140     property of the debugging context.
00141     
00142     required desiredTypes:
00143         typeChar
00144         typeObjectSpecifier
00145     */
00146 
00147 #define kOSADebugSetData                    'setd'
00148     /*
00149     this selector is used to set the value of a variable or other 
00150     property of the debugging context. with this selector only, 
00151     resultingDebugInfoOrDataToSet contains input data, and is not 
00152     modified by the call.
00153     
00154     required desiredTypes:
00155         typeChar
00156         typeObjectSpecifier
00157     */
00158 
00159 #define kOSADebugRange                      'drng'
00160     /*
00161     this selector is used to determine the source text range (start and 
00162     end positions) of the current point of execution.  with this selector, 
00163     selectorData is ignored and may be nil.
00164     
00165     required desiredType:
00166         typeOSADebugRange
00167     */
00168 
00169 #define typeOSADebugRange                   typeOSAErrorRange
00170     /*
00171     an AERecord type containing keyOSASourceStart and keyOSASourceEnd fields
00172     of type long.
00173     */
00174 
00175 #define keyOSADebugRangeStart               keyOSASourceStart
00176 #define keyOSADebugRangeEnd                 keyOSASourceEnd
00177     /*
00178     fields of a typeOSADebugRange record of typeLongInteger.
00179     */
00180 
00181 
00182 #ifdef __cplusplus
00183 }
00184 #endif
00185 
00186 #endif

Generated on Wed May 31 18:20:03 2006 for frontierkernel 10.1.10a by  doxygen 1.4.6