int qasReleaseContext( int contextHandle ) { contexthandle_t *prevhandle; contexthandle_t *ch = qasGetContextHandle( contextHandle ); if( !ch ) return QASINVALIDHANDLE; if( ch == contextHandlesHead ) { contextHandlesHead = ch->next; } else { // find the handle that links our handle as next for( prevhandle = contextHandlesHead; prevhandle != NULL; prevhandle = prevhandle->next ) { if( prevhandle->next == ch ) { prevhandle->next = ch->next; break; } } } ch->ctx->Release(); QAS_Free( ch ); return 1; }
int qasGetCallstackLineNumber( int contextHandle, int index ) { contexthandle_t *ch = qasGetContextHandle( contextHandle ); if( !ch ) return QASINVALIDHANDLE; return ch->ctx->GetCallstackLineNumber( index ); }
void *qasGetThisPointer( int contextHandle ) { contexthandle_t *ch = qasGetContextHandle( contextHandle ); if( !ch ) return NULL; return ch->ctx->GetThisPointer(); }
void *qasGetAddressOfVar( int contextHandle, int varIndex ) { contexthandle_t *ch = qasGetContextHandle( contextHandle ); if( !ch ) return NULL; return ch->ctx->GetAddressOfVar( varIndex ); }
const char *qasGetVarDeclaration( int contextHandle, int varIndex ) { contexthandle_t *ch = qasGetContextHandle( contextHandle ); if( !ch ) return NULL; return ch->ctx->GetVarDeclaration( varIndex ); }
const char *qasGetExceptionString( int contextHandle ) { contexthandle_t *ch = qasGetContextHandle( contextHandle ); if( !ch ) return NULL; return ch->ctx->GetExceptionString(); }
int qasGetExceptionLineNumber( int contextHandle ) { contexthandle_t *ch = qasGetContextHandle( contextHandle ); if( !ch ) return QASINVALIDHANDLE; return ch->ctx->GetExceptionLineNumber(); }
int qasSuspend( int contextHandle ) { contexthandle_t *ch = qasGetContextHandle( contextHandle ); if( !ch ) return QASINVALIDHANDLE; return ch->ctx->Suspend(); }
int qasSetArgAddress( int contextHandle, unsigned int arg, void *addr ) { contexthandle_t *ch = qasGetContextHandle( contextHandle ); if( !ch ) return QASINVALIDHANDLE; return ch->ctx->SetArgAddress( (asUINT)arg, addr ); }
int qasSetArgDouble( int contextHandle, unsigned int arg, double value ) { contexthandle_t *ch = qasGetContextHandle( contextHandle ); if( !ch ) return QASINVALIDHANDLE; return ch->ctx->SetArgDouble( (asUINT)arg, value ); }
int qasSetArgDWord( int contextHandle, unsigned int arg, unsigned int value ) { contexthandle_t *ch = qasGetContextHandle( contextHandle ); if( !ch ) return QASINVALIDHANDLE; return ch->ctx->SetArgDWord( (asUINT)arg, (asDWORD)value ); }
int qasSetArgByte( int contextHandle, unsigned int arg, unsigned char value ) { contexthandle_t *ch = qasGetContextHandle( contextHandle ); if( !ch ) return QASINVALIDHANDLE; return ch->ctx->SetArgByte( (asUINT)arg, (asBYTE)value ); }
int qasUnprepare( int contextHandle ) { contexthandle_t *ch = qasGetContextHandle( contextHandle ); if( !ch ) return QASINVALIDHANDLE; return ch->ctx->Unprepare(); }
int qasGetState( int contextHandle ) { contexthandle_t *ch = qasGetContextHandle( contextHandle ); if( !ch ) return QASINVALIDHANDLE; return (int)ch->ctx->GetState(); }
int qasGetEngine( int contextHandle ) { contexthandle_t *ch = qasGetContextHandle( contextHandle ); if( !ch ) return QASINVALIDHANDLE; return ch->owner; }
void *qasGetReturnObject( int contextHandle ) { contexthandle_t *ch = qasGetContextHandle( contextHandle ); if( !ch ) return NULL; return ch->ctx->GetReturnObject(); }
void *qasGetAddressOfReturnValue( int contextHandle ) { contexthandle_t *ch = qasGetContextHandle( contextHandle ); if( !ch ) return NULL; return ch->ctx->GetAddressOfReturnValue(); }
int qasSetArgObject( int contextHandle, unsigned int arg, void *obj ) { contexthandle_t *ch = qasGetContextHandle( contextHandle ); if( !ch ) return QASINVALIDHANDLE; return ch->ctx->SetArgObject( (asUINT)arg, obj ); }
int qasSetException( int contextHandle, const char *string ) { contexthandle_t *ch = qasGetContextHandle( contextHandle ); if( !ch ) return QASINVALIDHANDLE; return ch->ctx->SetException( string ); }
void *qasGetAddressOfArg( int contextHandle, unsigned int arg ) { contexthandle_t *ch = qasGetContextHandle( contextHandle ); if( !ch ) return NULL; return ch->ctx->GetAddressOfArg( (asUINT)arg ); }
void *qasGetExceptionFunction( int contextHandle ) { contexthandle_t *ch = qasGetContextHandle( contextHandle ); if( !ch ) return NULL; return static_cast<void*>( ch->ctx->GetExceptionFunction() ); }
int qasSetObject( int contextHandle, void *obj ) { contexthandle_t *ch = qasGetContextHandle( contextHandle ); if( !ch ) return QASINVALIDHANDLE; return ch->ctx->SetObject( obj ); }
int qasGetVarCount( int contextHandle ) { contexthandle_t *ch = qasGetContextHandle( contextHandle ); if( !ch ) return QASINVALIDHANDLE; return ch->ctx->GetVarCount(); }
unsigned int qasGetReturnBool( int contextHandle ) { contexthandle_t *ch = qasGetContextHandle( contextHandle ); if( !ch ) QAS_Error( "qasGetReturnBool: invalid context\n" ); return (unsigned char)ch->ctx->GetReturnByte(); }
int qasGetVarTypeId( int contextHandle, int varIndex ) { contexthandle_t *ch = qasGetContextHandle( contextHandle ); if( !ch ) return QASINVALIDHANDLE; return ch->ctx->GetVarTypeId( varIndex ); }
unsigned int qasGetReturnDWord( int contextHandle ) { contexthandle_t *ch = qasGetContextHandle( contextHandle ); if( !ch ) QAS_Error( "qasGetReturnDWord: invalid context\n" ); return (unsigned int)ch->ctx->GetReturnDWord(); }
int qasGetThisTypeId( int contextHandle ) { contexthandle_t *ch = qasGetContextHandle( contextHandle ); if( !ch ) return QASINVALIDHANDLE; return ch->ctx->GetThisTypeId(); }
quint64 qasGetReturnQWord( int contextHandle ) { contexthandle_t *ch = qasGetContextHandle( contextHandle ); if( !ch ) QAS_Error( "qasGetReturnQWord: invalid context\n" ); return ch->ctx->GetReturnQWord(); }
double qasGetReturnDouble( int contextHandle ) { contexthandle_t *ch = qasGetContextHandle( contextHandle ); if( !ch ) return QASINVALIDHANDLE; return ch->ctx->GetReturnDouble(); }
int qasGetCallstackSize( int contextHandle ) { contexthandle_t *ch = qasGetContextHandle( contextHandle ); if( !ch ) return QASINVALIDHANDLE; return ch->ctx->GetCallstackSize(); }