Back to index

lightning-sunbird  0.9+nobinonly
jsdebug.c
Go to the documentation of this file.
00001 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is mozilla.org code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1998
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either the GNU General Public License Version 2 or later (the "GPL"), or
00026  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00027  * in which case the provisions of the GPL or the LGPL are applicable instead
00028  * of those above. If you wish to allow use of your version of this file only
00029  * under the terms of either the GPL or the LGPL, and not to allow others to
00030  * use your version of this file under the terms of the MPL, indicate your
00031  * decision by deleting the provisions above and replace them with the notice
00032  * and other provisions required by the GPL or the LGPL. If you do not delete
00033  * the provisions above, a recipient may use your version of this file under
00034  * the terms of any one of the MPL, the GPL or the LGPL.
00035  *
00036  * ***** END LICENSE BLOCK ***** */
00037 
00038 /*
00039  * JavaScript Debugging support - All public functions
00040  */
00041 
00042 #include "jsd.h"
00043 
00044 /***************************************************************************/
00045 /* High Level calls */
00046 
00047 JSD_PUBLIC_API(JSDContext*)
00048 JSD_DebuggerOnForUser(JSRuntime*         jsrt,
00049                       JSD_UserCallbacks* callbacks,
00050                       void*              user)
00051 {
00052     return jsd_DebuggerOnForUser(jsrt, callbacks, user);
00053 }
00054 
00055 JSD_PUBLIC_API(JSDContext*)
00056 JSD_DebuggerOn(void)
00057 {
00058     return jsd_DebuggerOn();
00059 }
00060 
00061 JSD_PUBLIC_API(void)
00062 JSD_DebuggerOff(JSDContext* jsdc)
00063 {
00064     JSD_ASSERT_VALID_CONTEXT(jsdc);
00065     jsd_DebuggerOff(jsdc);
00066 }
00067 
00068 
00069 JSD_PUBLIC_API(uintN)
00070 JSD_GetMajorVersion(void)
00071 {
00072     return JSD_MAJOR_VERSION;
00073 }
00074 
00075 JSD_PUBLIC_API(uintN)
00076 JSD_GetMinorVersion(void)
00077 {
00078     return JSD_MINOR_VERSION;
00079 }
00080 
00081 JSD_PUBLIC_API(JSContext*)
00082 JSD_GetDefaultJSContext(JSDContext* jsdc)
00083 {
00084     JSD_ASSERT_VALID_CONTEXT(jsdc);
00085     return jsdc->dumbContext;
00086 }
00087 
00088 JSD_PUBLIC_API(void)
00089 JSD_SetUserCallbacks(JSRuntime* jsrt, JSD_UserCallbacks* callbacks, void* user)
00090 {
00091     jsd_SetUserCallbacks(jsrt, callbacks, user);
00092 }
00093 
00094 JSD_PUBLIC_API(void)
00095 JSD_JSContextInUse(JSDContext* jsdc, JSContext* context)
00096 {
00097     JSD_ASSERT_VALID_CONTEXT(jsdc);
00098     /* we no longer need this information - may need it again in the future */
00099 }
00100 
00101 JSD_PUBLIC_API(void *)
00102 JSD_SetContextPrivate(JSDContext *jsdc, void *data)
00103 {
00104     JSD_ASSERT_VALID_CONTEXT(jsdc);
00105     return jsd_SetContextPrivate (jsdc, data);
00106 }
00107 
00108 JSD_PUBLIC_API(void *)
00109 JSD_GetContextPrivate(JSDContext *jsdc)
00110 {
00111     JSD_ASSERT_VALID_CONTEXT(jsdc);
00112     return jsd_GetContextPrivate (jsdc);
00113 }
00114 
00115 JSD_PUBLIC_API(void)
00116 JSD_ClearAllProfileData(JSDContext *jsdc)
00117 {
00118     JSD_ASSERT_VALID_CONTEXT(jsdc);
00119     jsd_ClearAllProfileData(jsdc);    
00120 }
00121 
00122 JSD_PUBLIC_API(void)
00123 JSD_SetContextFlags(JSDContext *jsdc, uint32 flags)
00124 {
00125     JSD_ASSERT_VALID_CONTEXT(jsdc);
00126     jsdc->flags = flags;
00127 }
00128 
00129 JSD_PUBLIC_API(uint32)
00130 JSD_GetContextFlags(JSDContext *jsdc)
00131 {
00132     JSD_ASSERT_VALID_CONTEXT(jsdc);
00133     return jsdc->flags;
00134 }
00135     
00136 JSD_PUBLIC_API(JSDContext*)
00137 JSD_JSDContextForJSContext(JSContext* context)
00138 {
00139     return jsd_JSDContextForJSContext(context);
00140 }
00141 
00142 /***************************************************************************/
00143 /* Script functions */
00144 
00145 JSD_PUBLIC_API(void)
00146 JSD_LockScriptSubsystem(JSDContext* jsdc)
00147 {
00148     JSD_ASSERT_VALID_CONTEXT(jsdc);
00149     JSD_LOCK_SCRIPTS(jsdc);
00150 }
00151 
00152 JSD_PUBLIC_API(void)
00153 JSD_UnlockScriptSubsystem(JSDContext* jsdc)
00154 {
00155     JSD_ASSERT_VALID_CONTEXT(jsdc);
00156     JSD_UNLOCK_SCRIPTS(jsdc);
00157 }
00158 
00159 JSD_PUBLIC_API(JSDScript*)
00160 JSD_IterateScripts(JSDContext* jsdc, JSDScript **iterp)
00161 {
00162     JSD_ASSERT_VALID_CONTEXT(jsdc);
00163     return jsd_IterateScripts(jsdc, iterp);
00164 }
00165 
00166 JSD_PUBLIC_API(uint32)
00167 JSD_GetScriptFlags(JSDContext *jsdc, JSDScript *script)
00168 {
00169     JSD_ASSERT_VALID_CONTEXT(jsdc);
00170     return jsd_GetScriptFlags(jsdc, script);
00171 }
00172     
00173 JSD_PUBLIC_API(void)
00174 JSD_SetScriptFlags(JSDContext *jsdc, JSDScript *script, uint32 flags)
00175 {
00176     JSD_ASSERT_VALID_CONTEXT(jsdc);
00177     jsd_SetScriptFlags(jsdc, script, flags);
00178 }
00179 
00180 JSD_PUBLIC_API(uintN)
00181 JSD_GetScriptCallCount(JSDContext* jsdc, JSDScript *script)
00182 {
00183     JSD_ASSERT_VALID_CONTEXT(jsdc);
00184     return jsd_GetScriptCallCount(jsdc, script);
00185 }
00186 
00187 JSD_PUBLIC_API(uintN)
00188 JSD_GetScriptMaxRecurseDepth(JSDContext* jsdc, JSDScript *script)
00189 {
00190     JSD_ASSERT_VALID_CONTEXT(jsdc);
00191     return jsd_GetScriptMaxRecurseDepth(jsdc, script);
00192 }
00193     
00194 
00195 JSD_PUBLIC_API(jsdouble)
00196 JSD_GetScriptMinExecutionTime(JSDContext* jsdc, JSDScript *script)
00197 {
00198     JSD_ASSERT_VALID_CONTEXT(jsdc);
00199     return jsd_GetScriptMinExecutionTime(jsdc, script);
00200 }
00201     
00202 JSD_PUBLIC_API(jsdouble)
00203 JSD_GetScriptMaxExecutionTime(JSDContext* jsdc, JSDScript *script)
00204 {
00205     JSD_ASSERT_VALID_CONTEXT(jsdc);
00206     return jsd_GetScriptMaxExecutionTime(jsdc, script);
00207 }
00208 
00209 JSD_PUBLIC_API(jsdouble)
00210 JSD_GetScriptTotalExecutionTime(JSDContext* jsdc, JSDScript *script)
00211 {
00212     JSD_ASSERT_VALID_CONTEXT(jsdc);
00213     return jsd_GetScriptTotalExecutionTime(jsdc, script);
00214 }
00215 
00216 JSD_PUBLIC_API(jsdouble)
00217 JSD_GetScriptMinOwnExecutionTime(JSDContext* jsdc, JSDScript *script)
00218 {
00219     JSD_ASSERT_VALID_CONTEXT(jsdc);
00220     return jsd_GetScriptMinOwnExecutionTime(jsdc, script);
00221 }
00222     
00223 JSD_PUBLIC_API(jsdouble)
00224 JSD_GetScriptMaxOwnExecutionTime(JSDContext* jsdc, JSDScript *script)
00225 {
00226     JSD_ASSERT_VALID_CONTEXT(jsdc);
00227     return jsd_GetScriptMaxOwnExecutionTime(jsdc, script);
00228 }
00229 
00230 JSD_PUBLIC_API(jsdouble)
00231 JSD_GetScriptTotalOwnExecutionTime(JSDContext* jsdc, JSDScript *script)
00232 {
00233     JSD_ASSERT_VALID_CONTEXT(jsdc);
00234     return jsd_GetScriptTotalOwnExecutionTime(jsdc, script);
00235 }
00236 
00237 JSD_PUBLIC_API(void)
00238 JSD_ClearScriptProfileData(JSDContext* jsdc, JSDScript *script)
00239 {
00240     JSD_ASSERT_VALID_CONTEXT(jsdc);
00241     jsd_ClearScriptProfileData(jsdc, script);
00242 }
00243 
00244 JSD_PUBLIC_API(JSScript*)
00245 JSD_GetJSScript(JSDContext* jsdc, JSDScript *script)
00246 {
00247     return jsd_GetJSScript(jsdc, script);
00248 }
00249 
00250 JSD_PUBLIC_API(JSFunction*)
00251 JSD_GetJSFunction(JSDContext* jsdc, JSDScript *script)
00252 {
00253     return jsd_GetJSFunction (jsdc, script);
00254 }
00255 
00256 JSD_PUBLIC_API(void *)
00257 JSD_SetScriptPrivate(JSDScript *jsdscript, void *data)
00258 {
00259     JSD_ASSERT_VALID_SCRIPT(jsdscript);
00260     return jsd_SetScriptPrivate (jsdscript, data);
00261 }
00262 
00263 JSD_PUBLIC_API(void *)
00264 JSD_GetScriptPrivate(JSDScript *jsdscript)
00265 {
00266     JSD_ASSERT_VALID_SCRIPT(jsdscript);
00267     return jsd_GetScriptPrivate (jsdscript);
00268 }
00269     
00270 
00271 JSD_PUBLIC_API(JSBool)
00272 JSD_IsActiveScript(JSDContext* jsdc, JSDScript *jsdscript)
00273 {
00274     JSD_ASSERT_VALID_CONTEXT(jsdc);
00275     return jsd_IsActiveScript(jsdc, jsdscript);
00276 }
00277 
00278 JSD_PUBLIC_API(const char*)
00279 JSD_GetScriptFilename(JSDContext* jsdc, JSDScript *jsdscript)
00280 {
00281     JSD_ASSERT_VALID_CONTEXT(jsdc);
00282     JSD_ASSERT_VALID_SCRIPT(jsdscript);
00283     return jsd_GetScriptFilename(jsdc, jsdscript);
00284 }
00285 
00286 JSD_PUBLIC_API(const char*)
00287 JSD_GetScriptFunctionName(JSDContext* jsdc, JSDScript *jsdscript)
00288 {
00289     JSD_ASSERT_VALID_CONTEXT(jsdc);
00290     JSD_ASSERT_VALID_SCRIPT(jsdscript);
00291     return jsd_GetScriptFunctionName(jsdc, jsdscript);
00292 }
00293 
00294 JSD_PUBLIC_API(uintN)
00295 JSD_GetScriptBaseLineNumber(JSDContext* jsdc, JSDScript *jsdscript)
00296 {
00297     JSD_ASSERT_VALID_CONTEXT(jsdc);
00298     JSD_ASSERT_VALID_SCRIPT(jsdscript);
00299     return jsd_GetScriptBaseLineNumber(jsdc, jsdscript);
00300 }
00301 
00302 JSD_PUBLIC_API(uintN)
00303 JSD_GetScriptLineExtent(JSDContext* jsdc, JSDScript *jsdscript)
00304 {
00305     JSD_ASSERT_VALID_CONTEXT(jsdc);
00306     JSD_ASSERT_VALID_SCRIPT(jsdscript);
00307     return jsd_GetScriptLineExtent(jsdc, jsdscript);
00308 }
00309 
00310 JSD_PUBLIC_API(JSBool)
00311 JSD_SetScriptHook(JSDContext* jsdc, JSD_ScriptHookProc hook, void* callerdata)
00312 {
00313     JSD_ASSERT_VALID_CONTEXT(jsdc);
00314     return jsd_SetScriptHook(jsdc, hook, callerdata);
00315 }
00316 
00317 JSD_PUBLIC_API(JSBool)
00318 JSD_GetScriptHook(JSDContext* jsdc, JSD_ScriptHookProc* hook, void** callerdata)
00319 {
00320     JSD_ASSERT_VALID_CONTEXT(jsdc);
00321     return jsd_GetScriptHook(jsdc, hook, callerdata);
00322 }
00323 
00324 JSD_PUBLIC_API(jsuword)
00325 JSD_GetClosestPC(JSDContext* jsdc, JSDScript* jsdscript, uintN line)
00326 {
00327     JSD_ASSERT_VALID_CONTEXT(jsdc);
00328     JSD_ASSERT_VALID_SCRIPT(jsdscript);
00329     return jsd_GetClosestPC(jsdc, jsdscript, line);
00330 }
00331 
00332 JSD_PUBLIC_API(uintN)
00333 JSD_GetClosestLine(JSDContext* jsdc, JSDScript* jsdscript, jsuword pc)
00334 {
00335     JSD_ASSERT_VALID_CONTEXT(jsdc);
00336     JSD_ASSERT_VALID_SCRIPT(jsdscript);
00337     return jsd_GetClosestLine(jsdc, jsdscript, pc);
00338 }
00339 
00340 JSD_PUBLIC_API(void)
00341 JSD_ScriptCreated(JSDContext* jsdc,
00342                   JSContext   *cx,
00343                   const char  *filename,    /* URL this script loads from */
00344                   uintN       lineno,       /* line where this script starts */
00345                   JSScript    *script,
00346                   JSFunction  *fun)
00347 {
00348     JSD_ASSERT_VALID_CONTEXT(jsdc);
00349     jsd_ScriptCreated(jsdc, cx, filename, lineno, script, fun);
00350 }
00351 
00352 JSD_PUBLIC_API(void)
00353 JSD_ScriptDestroyed(JSDContext* jsdc,
00354                     JSContext   *cx,
00355                     JSScript    *script)
00356 {
00357     JSD_ASSERT_VALID_CONTEXT(jsdc);
00358     jsd_ScriptDestroyed(jsdc, cx, script);
00359 }
00360 
00361 /***************************************************************************/
00362 /* Source Text functions */
00363 
00364 JSD_PUBLIC_API(void)
00365 JSD_LockSourceTextSubsystem(JSDContext* jsdc)
00366 {
00367     JSD_ASSERT_VALID_CONTEXT(jsdc);
00368     JSD_LOCK_SOURCE_TEXT(jsdc);
00369 }
00370 
00371 JSD_PUBLIC_API(void)
00372 JSD_UnlockSourceTextSubsystem(JSDContext* jsdc)
00373 {
00374     JSD_ASSERT_VALID_CONTEXT(jsdc);
00375     JSD_UNLOCK_SOURCE_TEXT(jsdc);
00376 }
00377 
00378 JSD_PUBLIC_API(JSDSourceText*)
00379 JSD_IterateSources(JSDContext* jsdc, JSDSourceText **iterp)
00380 {
00381     JSD_ASSERT_VALID_CONTEXT(jsdc);
00382     return jsd_IterateSources(jsdc, iterp);
00383 }
00384 
00385 JSD_PUBLIC_API(JSDSourceText*)
00386 JSD_FindSourceForURL(JSDContext* jsdc, const char* url)
00387 {
00388     JSD_ASSERT_VALID_CONTEXT(jsdc);
00389     JS_ASSERT(url);
00390     return jsd_FindSourceForURL(jsdc, url);
00391 }
00392 
00393 JSD_PUBLIC_API(const char*)
00394 JSD_GetSourceURL(JSDContext* jsdc, JSDSourceText* jsdsrc)
00395 {
00396     JSD_ASSERT_VALID_CONTEXT(jsdc);
00397     JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc);
00398     return jsd_GetSourceURL(jsdc,jsdsrc);
00399 }
00400 
00401 JSD_PUBLIC_API(JSBool)
00402 JSD_GetSourceText(JSDContext* jsdc, JSDSourceText* jsdsrc,
00403                   const char** ppBuf, intN* pLen)
00404 {
00405     JSD_ASSERT_VALID_CONTEXT(jsdc);
00406     JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc);
00407     JS_ASSERT(ppBuf);
00408     JS_ASSERT(pLen);
00409     return jsd_GetSourceText(jsdc, jsdsrc, ppBuf, pLen);
00410 }
00411 
00412 JSD_PUBLIC_API(void)
00413 JSD_ClearSourceText(JSDContext* jsdc, JSDSourceText* jsdsrc)
00414 {
00415     JSD_ASSERT_VALID_CONTEXT(jsdc);
00416     JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc);
00417     jsd_ClearSourceText(jsdc, jsdsrc);
00418 }
00419 
00420 
00421 JSD_PUBLIC_API(JSDSourceStatus)
00422 JSD_GetSourceStatus(JSDContext* jsdc, JSDSourceText* jsdsrc)
00423 {
00424     JSD_ASSERT_VALID_CONTEXT(jsdc);
00425     JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc);
00426     return jsd_GetSourceStatus(jsdc, jsdsrc);
00427 }
00428 
00429 JSD_PUBLIC_API(JSBool)
00430 JSD_IsSourceDirty(JSDContext* jsdc, JSDSourceText* jsdsrc)
00431 {
00432     JSD_ASSERT_VALID_CONTEXT(jsdc);
00433     JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc);
00434     return jsd_IsSourceDirty(jsdc, jsdsrc);
00435 }
00436 
00437 JSD_PUBLIC_API(void)
00438 JSD_SetSourceDirty(JSDContext* jsdc, JSDSourceText* jsdsrc, JSBool dirty)
00439 {
00440     JSD_ASSERT_VALID_CONTEXT(jsdc);
00441     JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc);
00442     jsd_SetSourceDirty(jsdc, jsdsrc, dirty);
00443 }
00444 
00445 JSD_PUBLIC_API(uintN)
00446 JSD_GetSourceAlterCount(JSDContext* jsdc, JSDSourceText* jsdsrc)
00447 {
00448     JSD_ASSERT_VALID_CONTEXT(jsdc);
00449     JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc);
00450     return jsd_GetSourceAlterCount(jsdc, jsdsrc);
00451 }
00452 
00453 JSD_PUBLIC_API(uintN)
00454 JSD_IncrementSourceAlterCount(JSDContext* jsdc, JSDSourceText* jsdsrc)
00455 {
00456     JSD_ASSERT_VALID_CONTEXT(jsdc);
00457     JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc);
00458     return jsd_IncrementSourceAlterCount(jsdc, jsdsrc);
00459 }
00460 
00461 JSD_PUBLIC_API(void)
00462 JSD_DestroyAllSources( JSDContext* jsdc )
00463 {
00464     JSD_ASSERT_VALID_CONTEXT(jsdc);
00465     jsd_DestroyAllSources(jsdc);
00466 }
00467 
00468 JSD_PUBLIC_API(JSDSourceText*)
00469 JSD_NewSourceText(JSDContext* jsdc, const char* url)
00470 {
00471     JSD_ASSERT_VALID_CONTEXT(jsdc);
00472     JS_ASSERT(url);
00473     return jsd_NewSourceText(jsdc, url);
00474 }
00475 
00476 JSD_PUBLIC_API(JSDSourceText*)
00477 JSD_AppendSourceText(JSDContext* jsdc,
00478                      JSDSourceText* jsdsrc,
00479                      const char* text,       /* *not* zero terminated */
00480                      size_t length,
00481                      JSDSourceStatus status)
00482 {
00483     JSD_ASSERT_VALID_CONTEXT(jsdc);
00484     JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc);
00485     return jsd_AppendSourceText(jsdc, jsdsrc, text, length, status);
00486 }
00487 
00488 extern JSD_PUBLIC_API(JSDSourceText*)
00489 JSD_AppendUCSourceText(JSDContext*     jsdc,
00490                        JSDSourceText*  jsdsrc,
00491                        const jschar*   text,       /* *not* zero terminated */
00492                        size_t          length,
00493                        JSDSourceStatus status)
00494 {
00495     JSD_ASSERT_VALID_CONTEXT(jsdc);
00496     JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc);
00497     return jsd_AppendUCSourceText(jsdc, jsdsrc, text, length, status);
00498 }
00499 
00500 JSD_PUBLIC_API(JSBool)
00501 JSD_AddFullSourceText(JSDContext* jsdc,
00502                       const char* text,       /* *not* zero terminated */
00503                       size_t      length,
00504                       const char* url)
00505 {
00506     JSD_ASSERT_VALID_CONTEXT(jsdc);
00507     JS_ASSERT(url);
00508     return jsd_AddFullSourceText(jsdc, text, length, url);
00509 }
00510 
00511 /***************************************************************************/
00512 /* Execution/Interrupt Hook functions */
00513 
00514 JSD_PUBLIC_API(JSBool)
00515 JSD_SetExecutionHook(JSDContext*           jsdc,
00516                      JSDScript*            jsdscript,
00517                      jsuword              pc,
00518                      JSD_ExecutionHookProc hook,
00519                      void*                 callerdata)
00520 {
00521     JSD_ASSERT_VALID_CONTEXT(jsdc);
00522     JSD_ASSERT_VALID_SCRIPT(jsdscript);
00523     return jsd_SetExecutionHook(jsdc, jsdscript, pc, hook, callerdata);
00524 }
00525 
00526 JSD_PUBLIC_API(JSBool)
00527 JSD_ClearExecutionHook(JSDContext*           jsdc,
00528                        JSDScript*            jsdscript,
00529                        jsuword              pc)
00530 {
00531     JSD_ASSERT_VALID_CONTEXT(jsdc);
00532     JSD_ASSERT_VALID_SCRIPT(jsdscript);
00533     return jsd_ClearExecutionHook(jsdc, jsdscript, pc);
00534 }
00535 
00536 JSD_PUBLIC_API(JSBool)
00537 JSD_ClearAllExecutionHooksForScript(JSDContext* jsdc, JSDScript* jsdscript)
00538 {
00539     JSD_ASSERT_VALID_CONTEXT(jsdc);
00540     JSD_ASSERT_VALID_SCRIPT(jsdscript);
00541     return jsd_ClearAllExecutionHooksForScript(jsdc, jsdscript);
00542 }
00543 
00544 JSD_PUBLIC_API(JSBool)
00545 JSD_ClearAllExecutionHooks(JSDContext* jsdc)
00546 {
00547     JSD_ASSERT_VALID_CONTEXT(jsdc);
00548     return jsd_ClearAllExecutionHooks(jsdc);
00549 }
00550 
00551 JSD_PUBLIC_API(JSBool)
00552 JSD_SetInterruptHook(JSDContext*           jsdc,
00553                      JSD_ExecutionHookProc hook,
00554                      void*                 callerdata)
00555 {
00556     JSD_ASSERT_VALID_CONTEXT(jsdc);
00557     return jsd_SetInterruptHook(jsdc, hook, callerdata);
00558 }
00559 
00560 JSD_PUBLIC_API(JSBool)
00561 JSD_ClearInterruptHook(JSDContext* jsdc)
00562 {
00563     JSD_ASSERT_VALID_CONTEXT(jsdc);
00564     return jsd_ClearInterruptHook(jsdc);
00565 }
00566 
00567 JSD_PUBLIC_API(JSBool)
00568 JSD_SetDebugBreakHook(JSDContext*           jsdc,
00569                       JSD_ExecutionHookProc hook,
00570                       void*                 callerdata)
00571 {
00572     JSD_ASSERT_VALID_CONTEXT(jsdc);
00573     return jsd_SetDebugBreakHook(jsdc, hook, callerdata);
00574 }
00575 
00576 JSD_PUBLIC_API(JSBool)
00577 JSD_ClearDebugBreakHook(JSDContext* jsdc)
00578 {
00579     JSD_ASSERT_VALID_CONTEXT(jsdc);
00580     return jsd_ClearDebugBreakHook(jsdc);
00581 }
00582 
00583 JSD_PUBLIC_API(JSBool)
00584 JSD_SetDebuggerHook(JSDContext*           jsdc,
00585                     JSD_ExecutionHookProc hook,
00586                     void*                 callerdata)
00587 {
00588     JSD_ASSERT_VALID_CONTEXT(jsdc);
00589     return jsd_SetDebuggerHook(jsdc, hook, callerdata);
00590 }
00591 
00592 JSD_PUBLIC_API(JSBool)
00593 JSD_ClearDebuggerHook(JSDContext* jsdc)
00594 {
00595     JSD_ASSERT_VALID_CONTEXT(jsdc);
00596     return jsd_ClearDebuggerHook(jsdc);
00597 }
00598 
00599 JSD_PUBLIC_API(JSBool)
00600 JSD_SetThrowHook(JSDContext*           jsdc,
00601                  JSD_ExecutionHookProc hook,
00602                  void*                 callerdata)
00603 {
00604     JSD_ASSERT_VALID_CONTEXT(jsdc);
00605     return jsd_SetThrowHook(jsdc, hook, callerdata);
00606 }
00607 
00608 JSD_PUBLIC_API(JSBool)
00609 JSD_ClearThrowHook(JSDContext* jsdc)
00610 {
00611     JSD_ASSERT_VALID_CONTEXT(jsdc);
00612     return jsd_ClearThrowHook(jsdc);
00613 }
00614 
00615 JSD_PUBLIC_API(JSBool)
00616 JSD_SetTopLevelHook(JSDContext*      jsdc,
00617                     JSD_CallHookProc hook,
00618                     void*            callerdata)
00619 {
00620     JSD_ASSERT_VALID_CONTEXT(jsdc);
00621     return jsd_SetTopLevelHook(jsdc, hook, callerdata);
00622 }
00623 
00624 JSD_PUBLIC_API(JSBool)
00625 JSD_ClearTopLevelHook(JSDContext* jsdc)
00626 {
00627     JSD_ASSERT_VALID_CONTEXT(jsdc);
00628     return jsd_ClearTopLevelHook(jsdc);
00629 }
00630 
00631 JSD_PUBLIC_API(JSBool)
00632 JSD_SetFunctionHook(JSDContext*      jsdc,
00633                     JSD_CallHookProc hook,
00634                     void*            callerdata)
00635 {
00636     JSD_ASSERT_VALID_CONTEXT(jsdc);
00637     return jsd_SetFunctionHook(jsdc, hook, callerdata);
00638 }
00639 
00640 JSD_PUBLIC_API(JSBool)
00641 JSD_ClearFunctionHook(JSDContext* jsdc)
00642 {
00643     JSD_ASSERT_VALID_CONTEXT(jsdc);
00644     return jsd_ClearFunctionHook(jsdc);
00645 }
00646 
00647 /***************************************************************************/
00648 /* Stack Frame functions */
00649 
00650 JSD_PUBLIC_API(uintN)
00651 JSD_GetCountOfStackFrames(JSDContext* jsdc, JSDThreadState* jsdthreadstate)
00652 {
00653     JSD_ASSERT_VALID_CONTEXT(jsdc);
00654     return jsd_GetCountOfStackFrames(jsdc, jsdthreadstate);
00655 }
00656 
00657 JSD_PUBLIC_API(JSDStackFrameInfo*)
00658 JSD_GetStackFrame(JSDContext* jsdc, JSDThreadState* jsdthreadstate)
00659 {
00660     JSD_ASSERT_VALID_CONTEXT(jsdc);
00661     return jsd_GetStackFrame(jsdc, jsdthreadstate);
00662 }
00663 
00664 JSD_PUBLIC_API(JSContext*)
00665 JSD_GetJSContext(JSDContext* jsdc, JSDThreadState* jsdthreadstate)
00666 {
00667     JSD_ASSERT_VALID_CONTEXT(jsdc);
00668     return jsd_GetJSContext(jsdc, jsdthreadstate);
00669 }
00670 
00671 JSD_PUBLIC_API(JSDStackFrameInfo*)
00672 JSD_GetCallingStackFrame(JSDContext* jsdc,
00673                          JSDThreadState* jsdthreadstate,
00674                          JSDStackFrameInfo* jsdframe)
00675 {
00676     JSD_ASSERT_VALID_CONTEXT(jsdc);
00677     return jsd_GetCallingStackFrame(jsdc, jsdthreadstate, jsdframe);
00678 }
00679 
00680 JSD_PUBLIC_API(JSDScript*)
00681 JSD_GetScriptForStackFrame(JSDContext* jsdc,
00682                            JSDThreadState* jsdthreadstate,
00683                            JSDStackFrameInfo* jsdframe)
00684 {
00685     JSD_ASSERT_VALID_CONTEXT(jsdc);
00686     return jsd_GetScriptForStackFrame(jsdc, jsdthreadstate, jsdframe);
00687 }
00688 
00689 JSD_PUBLIC_API(jsuword)
00690 JSD_GetPCForStackFrame(JSDContext* jsdc,
00691                        JSDThreadState* jsdthreadstate,
00692                        JSDStackFrameInfo* jsdframe)
00693 {
00694     JSD_ASSERT_VALID_CONTEXT(jsdc);
00695     return jsd_GetPCForStackFrame(jsdc, jsdthreadstate, jsdframe);
00696 }
00697 
00698 JSD_PUBLIC_API(JSDValue*)
00699 JSD_GetCallObjectForStackFrame(JSDContext* jsdc,
00700                                JSDThreadState* jsdthreadstate,
00701                                JSDStackFrameInfo* jsdframe)
00702 {
00703     JSD_ASSERT_VALID_CONTEXT(jsdc);
00704     return jsd_GetCallObjectForStackFrame(jsdc, jsdthreadstate, jsdframe);
00705 }
00706 
00707 JSD_PUBLIC_API(JSDValue*)
00708 JSD_GetScopeChainForStackFrame(JSDContext* jsdc,
00709                                JSDThreadState* jsdthreadstate,
00710                                JSDStackFrameInfo* jsdframe)
00711 {
00712     JSD_ASSERT_VALID_CONTEXT(jsdc);
00713     return jsd_GetScopeChainForStackFrame(jsdc, jsdthreadstate, jsdframe);
00714 }
00715 
00716 JSD_PUBLIC_API(JSDValue*)
00717 JSD_GetThisForStackFrame(JSDContext* jsdc,
00718                          JSDThreadState* jsdthreadstate,
00719                          JSDStackFrameInfo* jsdframe)
00720 {
00721     JSD_ASSERT_VALID_CONTEXT(jsdc);
00722     return jsd_GetThisForStackFrame(jsdc, jsdthreadstate, jsdframe);
00723 }
00724 
00725 JSD_PUBLIC_API(const char*)
00726 JSD_GetNameForStackFrame(JSDContext* jsdc,
00727                          JSDThreadState* jsdthreadstate,
00728                          JSDStackFrameInfo* jsdframe)
00729 {
00730     JSD_ASSERT_VALID_CONTEXT(jsdc);
00731     return jsd_GetNameForStackFrame(jsdc, jsdthreadstate, jsdframe);
00732 }
00733 
00734 JSD_PUBLIC_API(JSBool)
00735 JSD_IsStackFrameNative(JSDContext* jsdc,
00736                        JSDThreadState* jsdthreadstate,
00737                        JSDStackFrameInfo* jsdframe)
00738 {
00739     JSD_ASSERT_VALID_CONTEXT(jsdc);
00740     return jsd_IsStackFrameNative(jsdc, jsdthreadstate, jsdframe);
00741 }
00742 
00743 JSD_PUBLIC_API(JSBool)
00744 JSD_IsStackFrameDebugger(JSDContext* jsdc,
00745                          JSDThreadState* jsdthreadstate,
00746                          JSDStackFrameInfo* jsdframe)
00747 {
00748     JSD_ASSERT_VALID_CONTEXT(jsdc);
00749     return jsd_IsStackFrameDebugger(jsdc, jsdthreadstate, jsdframe);
00750 }
00751 
00752 JSD_PUBLIC_API(JSBool)
00753 JSD_IsStackFrameConstructing(JSDContext* jsdc,
00754                              JSDThreadState* jsdthreadstate,
00755                              JSDStackFrameInfo* jsdframe)
00756 {
00757     JSD_ASSERT_VALID_CONTEXT(jsdc);
00758     return jsd_IsStackFrameConstructing(jsdc, jsdthreadstate, jsdframe);
00759 }
00760 
00761 JSD_PUBLIC_API(JSBool)
00762 JSD_EvaluateUCScriptInStackFrame(JSDContext* jsdc,
00763                                  JSDThreadState* jsdthreadstate,
00764                                  JSDStackFrameInfo* jsdframe,
00765                                  const jschar *bytes, uintN length,
00766                                  const char *filename, uintN lineno, jsval *rval)
00767 {
00768     JSD_ASSERT_VALID_CONTEXT(jsdc);
00769     JS_ASSERT(bytes);
00770     JS_ASSERT(length);
00771     JS_ASSERT(filename);
00772     JS_ASSERT(rval);
00773 
00774     return jsd_EvaluateUCScriptInStackFrame(jsdc, jsdthreadstate,jsdframe,
00775                                             bytes, length, filename, lineno,
00776                                              JS_TRUE, rval);
00777 }
00778 
00779 JSD_PUBLIC_API(JSBool)
00780 JSD_AttemptUCScriptInStackFrame(JSDContext* jsdc,
00781                                 JSDThreadState* jsdthreadstate,
00782                                 JSDStackFrameInfo* jsdframe,
00783                                 const jschar *bytes, uintN length,
00784                                 const char *filename, uintN lineno,
00785                                 jsval *rval)
00786 {
00787     JSD_ASSERT_VALID_CONTEXT(jsdc);
00788     JS_ASSERT(bytes);
00789     JS_ASSERT(length);
00790     JS_ASSERT(filename);
00791     JS_ASSERT(rval);
00792 
00793     return jsd_EvaluateUCScriptInStackFrame(jsdc, jsdthreadstate,jsdframe,
00794                                             bytes, length, filename, lineno,
00795                                             JS_FALSE, rval);
00796 }
00797 
00798 JSD_PUBLIC_API(JSBool)
00799 JSD_EvaluateScriptInStackFrame(JSDContext* jsdc,
00800                                JSDThreadState* jsdthreadstate,
00801                                JSDStackFrameInfo* jsdframe,
00802                                const char *bytes, uintN length,
00803                                const char *filename, uintN lineno, jsval *rval)
00804 {
00805     JSD_ASSERT_VALID_CONTEXT(jsdc);
00806     JS_ASSERT(bytes);
00807     JS_ASSERT(length);
00808     JS_ASSERT(filename);
00809     JS_ASSERT(rval);
00810 
00811     return jsd_EvaluateScriptInStackFrame(jsdc, jsdthreadstate,jsdframe,
00812                                           bytes, length,
00813                                           filename, lineno, JS_TRUE, rval);
00814 }
00815 
00816 JSD_PUBLIC_API(JSBool)
00817 JSD_AttemptScriptInStackFrame(JSDContext* jsdc,
00818                               JSDThreadState* jsdthreadstate,
00819                               JSDStackFrameInfo* jsdframe,
00820                               const char *bytes, uintN length,
00821                               const char *filename, uintN lineno, jsval *rval)
00822 {
00823     JSD_ASSERT_VALID_CONTEXT(jsdc);
00824     JS_ASSERT(bytes);
00825     JS_ASSERT(length);
00826     JS_ASSERT(filename);
00827     JS_ASSERT(rval);
00828 
00829     return jsd_EvaluateScriptInStackFrame(jsdc, jsdthreadstate,jsdframe,
00830                                           bytes, length,
00831                                           filename, lineno, JS_FALSE, rval);
00832 }
00833 
00834 JSD_PUBLIC_API(JSString*)
00835 JSD_ValToStringInStackFrame(JSDContext* jsdc,
00836                             JSDThreadState* jsdthreadstate,
00837                             JSDStackFrameInfo* jsdframe,
00838                             jsval val)
00839 {
00840     JSD_ASSERT_VALID_CONTEXT(jsdc);
00841     return jsd_ValToStringInStackFrame(jsdc, jsdthreadstate, jsdframe, val);
00842 }
00843 
00844 JSD_PUBLIC_API(JSDValue*)
00845 JSD_GetException(JSDContext* jsdc, JSDThreadState* jsdthreadstate)
00846 {
00847     JSD_ASSERT_VALID_CONTEXT(jsdc);
00848     return jsd_GetException(jsdc, jsdthreadstate);
00849 }
00850 
00851 extern JSD_PUBLIC_API(JSBool)
00852 JSD_SetException(JSDContext* jsdc, JSDThreadState* jsdthreadstate,
00853                  JSDValue* jsdval)
00854 {
00855     JSD_ASSERT_VALID_CONTEXT(jsdc);
00856     return jsd_SetException(jsdc, jsdthreadstate, jsdval);
00857 }
00858 
00859 /***************************************************************************/
00860 
00861 JSD_PUBLIC_API(JSBool)
00862 JSD_SetErrorReporter(JSDContext*       jsdc,
00863                      JSD_ErrorReporter reporter,
00864                      void*             callerdata)
00865 {
00866     JSD_ASSERT_VALID_CONTEXT(jsdc);
00867     return jsd_SetErrorReporter(jsdc, reporter, callerdata);
00868 }
00869 
00870 JSD_PUBLIC_API(JSBool)
00871 JSD_GetErrorReporter(JSDContext*        jsdc,
00872                      JSD_ErrorReporter* reporter,
00873                      void**             callerdata)
00874 {
00875     JSD_ASSERT_VALID_CONTEXT(jsdc);
00876     return jsd_GetErrorReporter(jsdc, reporter, callerdata);
00877 }
00878 
00879 /***************************************************************************/
00880 
00881 JSD_PUBLIC_API(JSBool)
00882 JSD_IsLockingAndThreadIdSupported()
00883 {
00884 #ifdef JSD_THREADSAFE
00885     return JS_TRUE;
00886 #else
00887     return JS_FALSE;
00888 #endif
00889 }
00890 
00891 JSD_PUBLIC_API(void*)
00892 JSD_CreateLock()
00893 {
00894 #ifdef JSD_THREADSAFE
00895     return jsd_CreateLock();
00896 #else
00897     return (void*)1;
00898 #endif
00899 }
00900 
00901 JSD_PUBLIC_API(void)
00902 JSD_Lock(void* lock)
00903 {
00904 #ifdef JSD_THREADSAFE
00905     jsd_Lock(lock);
00906 #endif
00907 }
00908 
00909 JSD_PUBLIC_API(void)
00910 JSD_Unlock(void* lock)
00911 {
00912 #ifdef JSD_THREADSAFE
00913     jsd_Unlock(lock);
00914 #endif
00915 }
00916 
00917 JSD_PUBLIC_API(JSBool)
00918 JSD_IsLocked(void* lock)
00919 {
00920 #if defined(JSD_THREADSAFE) && defined(DEBUG)
00921     return jsd_IsLocked(lock);
00922 #else
00923     return JS_TRUE;
00924 #endif
00925 }
00926 
00927 JSD_PUBLIC_API(JSBool)
00928 JSD_IsUnlocked(void* lock)
00929 {
00930 #if defined(JSD_THREADSAFE) && defined(DEBUG)
00931     return ! jsd_IsLocked(lock);
00932 #else
00933     return JS_TRUE;
00934 #endif
00935 }
00936 
00937 JSD_PUBLIC_API(void*)
00938 JSD_CurrentThread()
00939 {
00940     return JSD_CURRENT_THREAD();
00941 }
00942 
00943 /***************************************************************************/
00944 /* Value and Property Functions */
00945 
00946 JSD_PUBLIC_API(JSDValue*)
00947 JSD_NewValue(JSDContext* jsdc, jsval val)
00948 {
00949     JSD_ASSERT_VALID_CONTEXT(jsdc);
00950     return jsd_NewValue(jsdc, val);
00951 }
00952 
00953 JSD_PUBLIC_API(void)
00954 JSD_DropValue(JSDContext* jsdc, JSDValue* jsdval)
00955 {
00956     JSD_ASSERT_VALID_CONTEXT(jsdc);
00957     JSD_ASSERT_VALID_VALUE(jsdval);
00958     jsd_DropValue(jsdc, jsdval);
00959 }
00960 
00961 JSD_PUBLIC_API(jsval)
00962 JSD_GetValueWrappedJSVal(JSDContext* jsdc, JSDValue* jsdval)
00963 {
00964     JSD_ASSERT_VALID_CONTEXT(jsdc);
00965     JSD_ASSERT_VALID_VALUE(jsdval);
00966     return jsd_GetValueWrappedJSVal(jsdc, jsdval);
00967 }
00968 
00969 JSD_PUBLIC_API(void)
00970 JSD_RefreshValue(JSDContext* jsdc, JSDValue* jsdval)
00971 {
00972     JSD_ASSERT_VALID_CONTEXT(jsdc);
00973     JSD_ASSERT_VALID_VALUE(jsdval);
00974     jsd_RefreshValue(jsdc, jsdval);
00975 }
00976 
00977 /**************************************************/
00978 
00979 JSD_PUBLIC_API(JSBool)
00980 JSD_IsValueObject(JSDContext* jsdc, JSDValue* jsdval)
00981 {
00982     JSD_ASSERT_VALID_CONTEXT(jsdc);
00983     JSD_ASSERT_VALID_VALUE(jsdval);
00984     return jsd_IsValueObject(jsdc, jsdval);
00985 }
00986 
00987 JSD_PUBLIC_API(JSBool)
00988 JSD_IsValueNumber(JSDContext* jsdc, JSDValue* jsdval)
00989 {
00990     JSD_ASSERT_VALID_CONTEXT(jsdc);
00991     JSD_ASSERT_VALID_VALUE(jsdval);
00992     return jsd_IsValueNumber(jsdc, jsdval);
00993 }
00994 
00995 JSD_PUBLIC_API(JSBool)
00996 JSD_IsValueInt(JSDContext* jsdc, JSDValue* jsdval)
00997 {
00998     JSD_ASSERT_VALID_CONTEXT(jsdc);
00999     JSD_ASSERT_VALID_VALUE(jsdval);
01000     return jsd_IsValueInt(jsdc, jsdval);
01001 }
01002 
01003 JSD_PUBLIC_API(JSBool)
01004 JSD_IsValueDouble(JSDContext* jsdc, JSDValue* jsdval)
01005 {
01006     JSD_ASSERT_VALID_CONTEXT(jsdc);
01007     JSD_ASSERT_VALID_VALUE(jsdval);
01008     return jsd_IsValueDouble(jsdc, jsdval);
01009 }
01010 
01011 JSD_PUBLIC_API(JSBool)
01012 JSD_IsValueString(JSDContext* jsdc, JSDValue* jsdval)
01013 {
01014     JSD_ASSERT_VALID_CONTEXT(jsdc);
01015     JSD_ASSERT_VALID_VALUE(jsdval);
01016     return jsd_IsValueString(jsdc, jsdval);
01017 }
01018 
01019 JSD_PUBLIC_API(JSBool)
01020 JSD_IsValueBoolean(JSDContext* jsdc, JSDValue* jsdval)
01021 {
01022     JSD_ASSERT_VALID_CONTEXT(jsdc);
01023     JSD_ASSERT_VALID_VALUE(jsdval);
01024     return jsd_IsValueBoolean(jsdc, jsdval);
01025 }
01026 
01027 JSD_PUBLIC_API(JSBool)
01028 JSD_IsValueNull(JSDContext* jsdc, JSDValue* jsdval)
01029 {
01030     JSD_ASSERT_VALID_CONTEXT(jsdc);
01031     JSD_ASSERT_VALID_VALUE(jsdval);
01032     return jsd_IsValueNull(jsdc, jsdval);
01033 }
01034 
01035 JSD_PUBLIC_API(JSBool)
01036 JSD_IsValueVoid(JSDContext* jsdc, JSDValue* jsdval)
01037 {
01038     JSD_ASSERT_VALID_CONTEXT(jsdc);
01039     JSD_ASSERT_VALID_VALUE(jsdval);
01040     return jsd_IsValueVoid(jsdc, jsdval);
01041 }
01042 
01043 JSD_PUBLIC_API(JSBool)
01044 JSD_IsValuePrimitive(JSDContext* jsdc, JSDValue* jsdval)
01045 {
01046     JSD_ASSERT_VALID_CONTEXT(jsdc);
01047     JSD_ASSERT_VALID_VALUE(jsdval);
01048     return jsd_IsValuePrimitive(jsdc, jsdval);
01049 }
01050 
01051 JSD_PUBLIC_API(JSBool)
01052 JSD_IsValueFunction(JSDContext* jsdc, JSDValue* jsdval)
01053 {
01054     JSD_ASSERT_VALID_CONTEXT(jsdc);
01055     JSD_ASSERT_VALID_VALUE(jsdval);
01056     return jsd_IsValueFunction(jsdc, jsdval);
01057 }
01058 
01059 JSD_PUBLIC_API(JSBool)
01060 JSD_IsValueNative(JSDContext* jsdc, JSDValue* jsdval)
01061 {
01062     JSD_ASSERT_VALID_CONTEXT(jsdc);
01063     JSD_ASSERT_VALID_VALUE(jsdval);
01064     return jsd_IsValueNative(jsdc, jsdval);
01065 }
01066 
01067 /**************************************************/
01068 
01069 JSD_PUBLIC_API(JSBool)
01070 JSD_GetValueBoolean(JSDContext* jsdc, JSDValue* jsdval)
01071 {
01072     JSD_ASSERT_VALID_CONTEXT(jsdc);
01073     JSD_ASSERT_VALID_VALUE(jsdval);
01074     return jsd_GetValueBoolean(jsdc, jsdval);
01075 }
01076 
01077 JSD_PUBLIC_API(int32)
01078 JSD_GetValueInt(JSDContext* jsdc, JSDValue* jsdval)
01079 {
01080     JSD_ASSERT_VALID_CONTEXT(jsdc);
01081     JSD_ASSERT_VALID_VALUE(jsdval);
01082     return jsd_GetValueInt(jsdc, jsdval);
01083 }
01084 
01085 JSD_PUBLIC_API(jsdouble*)
01086 JSD_GetValueDouble(JSDContext* jsdc, JSDValue* jsdval)
01087 {
01088     JSD_ASSERT_VALID_CONTEXT(jsdc);
01089     JSD_ASSERT_VALID_VALUE(jsdval);
01090     return jsd_GetValueDouble(jsdc, jsdval);
01091 }
01092 
01093 JSD_PUBLIC_API(JSString*)
01094 JSD_GetValueString(JSDContext* jsdc, JSDValue* jsdval)
01095 {
01096     JSD_ASSERT_VALID_CONTEXT(jsdc);
01097     JSD_ASSERT_VALID_VALUE(jsdval);
01098     return jsd_GetValueString(jsdc, jsdval);
01099 }
01100 
01101 JSD_PUBLIC_API(const char*)
01102 JSD_GetValueFunctionName(JSDContext* jsdc, JSDValue* jsdval)
01103 {
01104     JSD_ASSERT_VALID_CONTEXT(jsdc);
01105     JSD_ASSERT_VALID_VALUE(jsdval);
01106     return jsd_GetValueFunctionName(jsdc, jsdval);
01107 }
01108 
01109 /**************************************************/
01110 
01111 JSD_PUBLIC_API(uintN)
01112 JSD_GetCountOfProperties(JSDContext* jsdc, JSDValue* jsdval)
01113 {
01114     JSD_ASSERT_VALID_CONTEXT(jsdc);
01115     JSD_ASSERT_VALID_VALUE(jsdval);
01116     return jsd_GetCountOfProperties(jsdc, jsdval);
01117 }
01118 
01119 JSD_PUBLIC_API(JSDProperty*)
01120 JSD_IterateProperties(JSDContext* jsdc, JSDValue* jsdval, JSDProperty **iterp)
01121 {
01122     JSD_ASSERT_VALID_CONTEXT(jsdc);
01123     JSD_ASSERT_VALID_VALUE(jsdval);
01124     JS_ASSERT(iterp);
01125     return jsd_IterateProperties(jsdc, jsdval, iterp);
01126 }
01127 
01128 JSD_PUBLIC_API(JSDProperty*)
01129 JSD_GetValueProperty(JSDContext* jsdc, JSDValue* jsdval, JSString* name)
01130 {
01131     JSD_ASSERT_VALID_CONTEXT(jsdc);
01132     JSD_ASSERT_VALID_VALUE(jsdval);
01133     JS_ASSERT(name);
01134     return jsd_GetValueProperty(jsdc, jsdval, name);
01135 }
01136 
01137 JSD_PUBLIC_API(JSDValue*)
01138 JSD_GetValuePrototype(JSDContext* jsdc, JSDValue* jsdval)
01139 {
01140     JSD_ASSERT_VALID_CONTEXT(jsdc);
01141     JSD_ASSERT_VALID_VALUE(jsdval);
01142     return jsd_GetValuePrototype(jsdc, jsdval);
01143 }
01144 
01145 JSD_PUBLIC_API(JSDValue*)
01146 JSD_GetValueParent(JSDContext* jsdc, JSDValue* jsdval)
01147 {
01148     JSD_ASSERT_VALID_CONTEXT(jsdc);
01149     JSD_ASSERT_VALID_VALUE(jsdval);
01150     return jsd_GetValueParent(jsdc, jsdval);
01151 }
01152 
01153 JSD_PUBLIC_API(JSDValue*)
01154 JSD_GetValueConstructor(JSDContext* jsdc, JSDValue* jsdval)
01155 {
01156     JSD_ASSERT_VALID_CONTEXT(jsdc);
01157     JSD_ASSERT_VALID_VALUE(jsdval);
01158     return jsd_GetValueConstructor(jsdc, jsdval);
01159 }
01160 
01161 JSD_PUBLIC_API(const char*)
01162 JSD_GetValueClassName(JSDContext* jsdc, JSDValue* jsdval)
01163 {
01164     JSD_ASSERT_VALID_CONTEXT(jsdc);
01165     JSD_ASSERT_VALID_VALUE(jsdval);
01166     return jsd_GetValueClassName(jsdc, jsdval);
01167 }
01168 
01169 /**************************************************/
01170 
01171 JSD_PUBLIC_API(void)
01172 JSD_DropProperty(JSDContext* jsdc, JSDProperty* jsdprop)
01173 {
01174     JSD_ASSERT_VALID_CONTEXT(jsdc);
01175     JSD_ASSERT_VALID_PROPERTY(jsdprop);
01176     jsd_DropProperty(jsdc, jsdprop);
01177 }
01178 
01179 
01180 JSD_PUBLIC_API(JSDValue*)
01181 JSD_GetPropertyName(JSDContext* jsdc, JSDProperty* jsdprop)
01182 {
01183     JSD_ASSERT_VALID_CONTEXT(jsdc);
01184     JSD_ASSERT_VALID_PROPERTY(jsdprop);
01185     return jsd_GetPropertyName(jsdc, jsdprop);
01186 }
01187 
01188 JSD_PUBLIC_API(JSDValue*)
01189 JSD_GetPropertyValue(JSDContext* jsdc, JSDProperty* jsdprop)
01190 {
01191     JSD_ASSERT_VALID_CONTEXT(jsdc);
01192     JSD_ASSERT_VALID_PROPERTY(jsdprop);
01193     return jsd_GetPropertyValue(jsdc, jsdprop);
01194 }
01195 
01196 JSD_PUBLIC_API(JSDValue*)
01197 JSD_GetPropertyAlias(JSDContext* jsdc, JSDProperty* jsdprop)
01198 {
01199     JSD_ASSERT_VALID_CONTEXT(jsdc);
01200     JSD_ASSERT_VALID_PROPERTY(jsdprop);
01201     return jsd_GetPropertyAlias(jsdc, jsdprop);
01202 }
01203 
01204 JSD_PUBLIC_API(uintN)
01205 JSD_GetPropertyFlags(JSDContext* jsdc, JSDProperty* jsdprop)
01206 {
01207     JSD_ASSERT_VALID_CONTEXT(jsdc);
01208     JSD_ASSERT_VALID_PROPERTY(jsdprop);
01209     return jsd_GetPropertyFlags(jsdc, jsdprop);
01210 }
01211 
01212 JSD_PUBLIC_API(uintN)
01213 JSD_GetPropertyVarArgSlot(JSDContext* jsdc, JSDProperty* jsdprop)
01214 {
01215     JSD_ASSERT_VALID_CONTEXT(jsdc);
01216     JSD_ASSERT_VALID_PROPERTY(jsdprop);
01217     return jsd_GetPropertyVarArgSlot(jsdc, jsdprop);
01218 }
01219 
01220 /**************************************************/
01221 /* Object Functions */
01222 
01223 JSD_PUBLIC_API(void)
01224 JSD_LockObjectSubsystem(JSDContext* jsdc)
01225 {
01226     JSD_ASSERT_VALID_CONTEXT(jsdc);
01227     JSD_LOCK_OBJECTS(jsdc);
01228 }
01229 
01230 JSD_PUBLIC_API(void)
01231 JSD_UnlockObjectSubsystem(JSDContext* jsdc)
01232 {
01233     JSD_ASSERT_VALID_CONTEXT(jsdc);
01234     JSD_UNLOCK_OBJECTS(jsdc);
01235 }
01236 
01237 JSD_PUBLIC_API(JSDObject*)
01238 JSD_IterateObjects(JSDContext* jsdc, JSDObject** iterp)
01239 {
01240     JSD_ASSERT_VALID_CONTEXT(jsdc);
01241     return jsd_IterateObjects(jsdc, iterp);
01242 }
01243 
01244 JSD_PUBLIC_API(JSObject*)
01245 JSD_GetWrappedObject(JSDContext* jsdc, JSDObject* jsdobj)
01246 {
01247     JSD_ASSERT_VALID_CONTEXT(jsdc);
01248     JSD_ASSERT_VALID_OBJECT(jsdobj);
01249     return jsd_GetWrappedObject(jsdc, jsdobj);
01250 
01251 }
01252 
01253 JSD_PUBLIC_API(const char*)
01254 JSD_GetObjectNewURL(JSDContext* jsdc, JSDObject* jsdobj)
01255 {
01256     JSD_ASSERT_VALID_CONTEXT(jsdc);
01257     JSD_ASSERT_VALID_OBJECT(jsdobj);
01258     return jsd_GetObjectNewURL(jsdc, jsdobj);
01259 }
01260 
01261 JSD_PUBLIC_API(uintN)
01262 JSD_GetObjectNewLineNumber(JSDContext* jsdc, JSDObject* jsdobj)
01263 {
01264     JSD_ASSERT_VALID_CONTEXT(jsdc);
01265     JSD_ASSERT_VALID_OBJECT(jsdobj);
01266     return jsd_GetObjectNewLineNumber(jsdc, jsdobj);
01267 }
01268 
01269 JSD_PUBLIC_API(const char*)
01270 JSD_GetObjectConstructorURL(JSDContext* jsdc, JSDObject* jsdobj)
01271 {
01272     JSD_ASSERT_VALID_CONTEXT(jsdc);
01273     JSD_ASSERT_VALID_OBJECT(jsdobj);
01274     return jsd_GetObjectConstructorURL(jsdc, jsdobj);
01275 }
01276 
01277 JSD_PUBLIC_API(uintN)
01278 JSD_GetObjectConstructorLineNumber(JSDContext* jsdc, JSDObject* jsdobj)
01279 {
01280     JSD_ASSERT_VALID_CONTEXT(jsdc);
01281     JSD_ASSERT_VALID_OBJECT(jsdobj);
01282     return jsd_GetObjectConstructorLineNumber(jsdc, jsdobj);
01283 }
01284 
01285 JSD_PUBLIC_API(const char*)
01286 JSD_GetObjectConstructorName(JSDContext* jsdc, JSDObject* jsdobj)
01287 {
01288     JSD_ASSERT_VALID_CONTEXT(jsdc);
01289     JSD_ASSERT_VALID_OBJECT(jsdobj);
01290     return jsd_GetObjectConstructorName(jsdc, jsdobj);
01291 }
01292 
01293 JSD_PUBLIC_API(JSDObject*)
01294 JSD_GetJSDObjectForJSObject(JSDContext* jsdc, JSObject* jsobj)
01295 {
01296     JSD_ASSERT_VALID_CONTEXT(jsdc);
01297     JS_ASSERT(jsobj);
01298     return jsd_GetJSDObjectForJSObject(jsdc, jsobj);
01299 }
01300 
01301 JSD_PUBLIC_API(JSDObject*)
01302 JSD_GetObjectForValue(JSDContext* jsdc, JSDValue* jsdval)
01303 {
01304     JSD_ASSERT_VALID_CONTEXT(jsdc);
01305     JSD_ASSERT_VALID_VALUE(jsdval);
01306     return jsd_GetObjectForValue(jsdc, jsdval);
01307 }
01308 
01309 JSD_PUBLIC_API(JSDValue*)
01310 JSD_GetValueForObject(JSDContext* jsdc, JSDObject* jsdobj)
01311 {
01312     JSD_ASSERT_VALID_CONTEXT(jsdc);
01313     JSD_ASSERT_VALID_OBJECT(jsdobj);
01314     return jsd_GetValueForObject(jsdc, jsdobj);
01315 }
01316 
01317 /***************************************************************************/
01318 /* Livewire specific API */
01319 #ifdef LIVEWIRE
01320 
01321 JSD_PUBLIC_API(LWDBGScript*)
01322 JSDLW_GetLWScript(JSDContext* jsdc, JSDScript* jsdscript)
01323 {
01324     JSD_ASSERT_VALID_CONTEXT(jsdc);
01325     JSD_ASSERT_VALID_SCRIPT(jsdscript);
01326     return jsdlw_GetLWScript(jsdc, jsdscript);
01327 }
01328 
01329 JSD_PUBLIC_API(JSDSourceText*)
01330 JSDLW_PreLoadSource( JSDContext* jsdc, LWDBGApp* app,
01331                      const char* filename, JSBool clear )
01332 {
01333     JSD_ASSERT_VALID_CONTEXT(jsdc);
01334     JS_ASSERT(app);
01335     JS_ASSERT(filename);
01336     return jsdlw_PreLoadSource(jsdc, app, filename, clear);
01337 }
01338 
01339 JSD_PUBLIC_API(JSDSourceText*)
01340 JSDLW_ForceLoadSource( JSDContext* jsdc, JSDSourceText* jsdsrc )
01341 {
01342     JSD_ASSERT_VALID_CONTEXT(jsdc);
01343     JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc);
01344     return jsdlw_ForceLoadSource(jsdc, jsdsrc);
01345 }
01346 
01347 JSD_PUBLIC_API(JSBool)
01348 JSDLW_RawToProcessedLineNumber(JSDContext* jsdc, JSDScript* jsdscript,
01349                                uintN lineIn, uintN* lineOut)
01350 {
01351     JSD_ASSERT_VALID_CONTEXT(jsdc);
01352     JSD_ASSERT_VALID_SCRIPT(jsdscript);
01353     return jsdlw_RawToProcessedLineNumber(jsdc, jsdscript, lineIn, lineOut);
01354 }
01355 
01356 JSD_PUBLIC_API(JSBool)
01357 JSDLW_ProcessedToRawLineNumber(JSDContext* jsdc, JSDScript* jsdscript,
01358                                uintN lineIn, uintN* lineOut)
01359 {
01360     JSD_ASSERT_VALID_CONTEXT(jsdc);
01361     JSD_ASSERT_VALID_SCRIPT(jsdscript);
01362     return jsdlw_ProcessedToRawLineNumber(jsdc, jsdscript, lineIn, lineOut);
01363 }
01364 
01365 #endif
01366 /***************************************************************************/