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 Copyright  1993 UserLand Software, Inc. All rights reserved.
00032 */
00033 
00034 
00035 #ifndef __usertalkinclude__
00036 #define __usertalkinclude__
00037 
00038 #ifndef __OSA__
00039     #include <OSA.h>
00040 #endif
00041 
00042 #ifdef __cplusplus
00043 extern "C" {
00044 #endif
00045 
00046 
00047 /*types and constants*/
00048 
00049 #define typeUserTalk                    'LAND'
00050 
00051 #define kUserTalkSubtype                typeUserTalk
00052 
00053 #define typeUserTalkSourceType          typeChar
00054 
00055 #define typeUserTalkStorage             typeUserTalk
00056 
00057 
00058 /*mode flags*/
00059 
00060 #define kOSAModeDebug                   0x00010000
00061 #define kOSAModeTransparentScope        0x00020000
00062 
00063 
00064 /*component selectors*/
00065 
00066 #define kOSASelectSetDebugProc          0x1001
00067 #define kOSASelectDebug                 0x1002
00068 
00069 
00070 /*setting the DebugProc*/
00071 
00072 typedef pascal OSErr (*OSADebugProcPtr) (long refCon);
00073 
00074 enum {
00075     uppOSADebugProcInfo = kPascalStackBased
00076          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
00077          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
00078 };
00079 
00080 #if USESROUTINEDESCRIPTORS
00081     typedef UniversalProcPtr OSADebugUPP;
00082     
00083     #define CallOSADebugProc(userRoutine, refCon)       \
00084             CallUniversalProc((UniversalProcPtr)(userRoutine), uppOSADebugProcInfo, (refCon))
00085     #define NewOSADebugProc(userRoutine)        \
00086             (OSADebugUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppOSADebugProcInfo, GetCurrentISA())
00087 #else
00088     typedef OSADebugProcPtr OSADebugUPP;
00089     
00090     #define CallOSADebugProc(userRoutine, refCon)       \
00091             (*(userRoutine))((refCon))
00092     #define NewOSADebugProc(userRoutine)        \
00093             (OSADebugUPP)(userRoutine)
00094 #endif
00095 
00096 pascal OSAError OSASetDebugProc (ComponentInstance      scriptingComponent,
00097                                  OSADebugProcPtr        debugProc,
00098                                  long                   refCon)
00099  FIVEWORDINLINE(0x2F3C, 8, kOSASelectSetDebugProc, 0x7000, 0xA82A);
00100 //  OSAComponentFunctionInline (kOSASelectSetDebugProc, 8);
00101     
00102     /*
00103     this routine is called during script execution if the the kOSAMode
00104     if debugProc is nil, no debugging will take place subsequently.
00105     
00106     errors:
00107         badComponentInstance    invalid scripting component instance
00108         errOSASystemError
00109     */
00110 
00111 
00112 /*getting debugging information*/
00113 
00114 pascal OSAError OSADebug (ComponentInstance scriptingComponent,
00115                           OSType            selector,
00116                           const AEDesc*     selectorData,
00117                           DescType          desiredType,
00118                           AEDesc*           resultingDebugInfoOrDataToSet)
00119  FIVEWORDINLINE(0x2F3C, 16, kOSASelectDebug, 0x7000, 0xA82A);
00120 //  OSAComponentFunctionInline (kOSASelectDebug, 16);
00121     
00122     /*
00123     whenever script execution calls back to the DebugProc, this routine may
00124     be used to get information about the current debugging state.  the selector 
00125     describes the type of information desired about the state (various selectors 
00126     are listed below).  the desiredType indicates the data type of the result
00127     desired for that selector.
00128     
00129     errors:
00130         badComponentInstance    invalid scripting component instance
00131         errOSASystemError
00132         errOSABadSelector:      selector not supported by scripting component
00133         errAECoercionFail:      desiredType not supported by scripting component
00134     */
00135 
00136 
00137 /*OSADebug selectors*/
00138 
00139 #define kOSADebugGetData                    'getd'
00140     /*
00141     this selector is used to determine the value of a variable or other 
00142     property of the debugging context.
00143     
00144     required desiredTypes:
00145         typeChar
00146         typeObjectSpecifier
00147     */
00148 
00149 #define kOSADebugSetData                    'setd'
00150     /*
00151     this selector is used to set the value of a variable or other 
00152     property of the debugging context. with this selector only, 
00153     resultingDebugInfoOrDataToSet contains input data, and is not 
00154     modified by the call.
00155     
00156     required desiredTypes:
00157         typeChar
00158         typeObjectSpecifier
00159     */
00160 
00161 #define kOSADebugRange                      'drng'
00162     /*
00163     this selector is used to determine the source text range (start and 
00164     end positions) of the current point of execution.  with this selector, 
00165     selectorData is ignored and may be nil.
00166     
00167     required desiredType:
00168         typeOSADebugRange
00169     */
00170 
00171 #define typeOSADebugRange                   typeOSAErrorRange
00172     /*
00173     an AERecord type containing keyOSASourceStart and keyOSASourceEnd fields
00174     of type long.
00175     */
00176 
00177 #define keyOSADebugRangeStart               keyOSASourceStart
00178 #define keyOSADebugRangeEnd                 keyOSASourceEnd
00179     /*
00180     fields of a typeOSADebugRange record of typeLongInteger.
00181     */
00182 
00183 
00184 #ifdef __cplusplus
00185 }
00186 #endif
00187 
00188 #endif

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