G:/ScriptBasic/source/extensions/mt/interface.c File Reference

#include <stdio.h>
#include <time.h>
#include "../../basext.h"

Go to the source code of this file.

Data Structures

struct  _SessionInfo
struct  _MtClass
struct  _MTVariable

Defines

#define MT_ERROR_NOSESSION   0x00080001
#define MT_ERROR_BAD_PROG   0x00080002
#define MT_ERROR_BAD_SESS   0x00080003
#define IsUndef(pVar)   ((pVar) == NULL || (pVar)->vType == VTYPE_UNDEF)
#define SESSION__CONSTRAINT

Typedefs

typedef _SessionInfo SessionInfo
typedef _SessionInfopSessionInfo
typedef _MtClass MtClass
typedef _MtClasspMtClass
typedef _MTVariable MTVariable
typedef _MTVariablepMTVariable

Functions

static pSessionInfo AllocNewSession (pSupportTable pSt, void *p)
static void ReleaseSession (pSupportTable pSt, pSessionInfo pS)
static void time_out_work_thread (void *p)
INC_THREAD_COUNTER INITLOCK if (iFirst)
 if (pMT=besMODULEPOINTER==NULL)
 if (pMT->pszSessionId==NULL) return COMMAND_ERROR_MEMORY_LOW
 strcpy (pMT->pszSessionId, SymbolName(p))
 besUnlockSharedRead (&(pS->lckSession))
besEND besFUNCTION (chksession)
 besLockMutex (&mxSessionCounter)
 besUnlockMutex (&mxSessionCounter)
 besMD5INIT (&Context)
 besMD5UPDATE (&Context,(unsigned char *)&lThisSession, sizeof(unsigned long))
 if (Argument)
 STRINGVALUE (besRETURNVALUE)[32]
 if (p==NULL)
static besEND void FinishSegmentCallBack (char *SymbolName, void *SymbolValue, void *f)
 besFUNCTION (delsession)
pSt DeleteSymbol (pszSession, SessionTable, pSt->Free, besPROCMEMORYSEGMENT)
 if (pS==NULL)
 besLockSharedWrite (&(pS->lckSession))
 besTRAVERSESYMBOLTABLE (pS->stSession, FinishSegmentCallBack, pSt)
 besFINISH_SEGMENT (pS->pMemSeg)
 besFinishMutex (&(pS->mxSession))
 besUnlockSharedWrite (&(pS->lckSession))
 besFinishSharedLock (&(pS->lckSession))
 ReleaseSession (pSt, pS)
 if (!bSessDef) besFREE(pszSession)
besEND besFUNCTION (getsession)
 besLockSharedWrite (&((*p)->lckV))
 besDEREFERENCE (Argument)
 if ((*p)->vV &&TYPE((*p)->vV)==VTYPE_STRING &&STRINGVALUE((*p)->vV))
 if (IsUndef(Argument))
 if ((*p)->vV==NULL)(*p)->vV = besPROCALLOC(sizeof(FixSizeMemoryObject))
 if (TYPE(Argument)==VTYPE_STRING)
 besUnlockSharedWrite (&((*p)->lckV))
besEND besFUNCTION (getsvariable)
 besLockSharedRead (&((*p)->lckV))
 if (TYPE((*p)->vV)==VTYPE_STRING)
besEND besFUNCTION (setmtvariable)
besEND besFUNCTION (getmtvariable)
besEND besFUNCTION (lockmtwrite)
besEND besFUNCTION (lockmtread)
besEND besFUNCTION (unlockmtwrite)
besEND besFUNCTION (unlockmtread)
 besUnlockSharedRead (&((*p)->lckV))
besEND besFUNCTION (sessionto)
 if (VARIABLE Argument==NULL)
 LONGVALUE (besRETURNVALUE)
besEND besFUNCTION (getsespt)
besEND besFUNCTION (listses)
 if (cSessionList==0)
 while (pS)
besEND besVERSION_NEGOTIATE return (int)

Variables

static SUPPORT_MULTITHREAD
SymbolTable 
MtVariables
static SUPPORT_MULTITHREAD
SymbolTable 
SessionTable
static MUTEX mxMTVariables
static MUTEX mxSessionCounter
static MUTEX mxSessionTable
static unsigned long lSessionCounter
static pSessionInfo pSessionRoot
besSUB_SHUTDOWN besEND besSUB_START
pMtClass 
pMT
INITUNLO besMODULEPOINTER = besALLOC(sizeof(MtClass))
pMT AssignedSession = pS
pS lPingTime = time(NULL)
 lThisSession = lSessionCounter++
pMT AssignedSession = NULL
 p = pSt->LookupSymbol(STRINGVALUE(besRETURNVALUE),SessionTable,1,pSt->Alloc,pSt->Free,besPROCMEMORYSEGMENT)
pMT AssignedSession = pS
pS lPingTime = time(NULL)
 p = pSt->LookupSymbol(pszSession,SessionTable,0,pSt->Alloc,pSt->Free,besPROCMEMORYSEGMENT)
 pS = *p
 Argument = besARGUMENT(2)
p vV sType = 0
p vV State = STATE_UNKNOWN
p vV next = NULL
p vV link prev = NULL
p vV ArrayHighLimit = 0
p vV ArrayLowLimit = 1
return EXE_ERROR_INTERNAL
return EXE_ERROR_INTERNAL
 Argument = besARGUMENT(2)
p vV sType = 0
p vV State = STATE_UNKNOWN
p vV next = NULL
p vV link prev = NULL
p vV ArrayHighLimit = 0
p vV ArrayLowLimit = 1
return EXE_ERROR_INTERNAL
return EXE_ERROR_INTERNAL
return COMMAND_ERROR_SUCCESS
return COMMAND_ERROR_SUCCESS
return COMMAND_ERROR_SUCCESS
return COMMAND_ERROR_SUCCESS
 Argument = besARGUMENT(1)
 p = pSt->LookupSymbol(pszSession,SessionTable,0,pSt->Alloc,pSt->Free,besPROCMEMORYSEGMENT)
 pS = *p
 besALLOC_RETURN_LONG
 p = pSt->LookupSymbol(pszSession,SessionTable,0,pSt->Alloc,pSt->Free,besPROCMEMORYSEGMENT)
 pS = *p
 besALLOC_RETURN_LONG
Lval = besNEWARRAY(1,cSessionList)
 cSessionList = 0
return lTC
besEND besSUB_PROCESS_START
INIT_MULTITHREAD 
return
besEND besSUB_PROCESS_FINISH
FINISH_MULTITHREAD besEND
SLFST 
MT_SLFST []


Define Documentation

#define IsUndef pVar   )     ((pVar) == NULL || (pVar)->vType == VTYPE_UNDEF)
 

Definition at line 151 of file interface.c.

#define MT_ERROR_BAD_PROG   0x00080002
 

Definition at line 98 of file interface.c.

#define MT_ERROR_BAD_SESS   0x00080003
 

Definition at line 99 of file interface.c.

#define MT_ERROR_NOSESSION   0x00080001
 

Definition at line 97 of file interface.c.

Referenced by besFUNCTION().

#define SESSION__CONSTRAINT
 

Value:

( lToMin < pS->lTimeout )  && \
        ( lPtMin < pS->lPingTime)  && \
        ( lStMin < pS->lTimeStart) &&\
        ( (!lToMax) || lToMax > pS->lTimeout)  && \
        ( (!lPtMax) || lPtMax > pS->lPingTime) && \
        ( (!lStMax) || lStMax > pS->lTimeStart)

Referenced by while().


Typedef Documentation

typedef struct _MtClass MtClass
 

typedef struct _MTVariable MTVariable
 

typedef struct _MtClass * pMtClass
 

typedef struct _MTVariable* pMTVariable
 

typedef struct _SessionInfo * pSessionInfo
 

typedef struct _SessionInfo SessionInfo
 


Function Documentation

static pSessionInfo AllocNewSession pSupportTable  pSt,
void *  p
[static]
 

Definition at line 104 of file interface.c.

References NULL, pS, and pSessionRoot.

besDEREFERENCE Argument   ) 
 

besFINISH_SEGMENT pS->  pMemSeg  ) 
 

besFinishMutex (pS->mxSession)  ) 
 

besFinishSharedLock (pS->lckSession)  ) 
 

Referenced by FinishSegmentCallBack().

besEND besFUNCTION listses   ) 
 

=section ListSessions =H mt::ListSessions

This subroutine collects the session ids.

=verbatim call mt::ListSessions Array,Sm,SM,Pm,PM,Tm,TM =noverbatim

The first argument to the subroutine should be a variable. This variable will loose its previous value and gets a new array value containing the session strings.

If there is no more arguments to the subroutine call this array will contain all the existing sessions in the MT module. However the programmer may define six optional parameters that select only certain sessions that have time value parameters that are between the specified values. These are

=itemize =item T<Sm> required minimal start time of the session =item T<SM> required maximal start time of the session =item T<Pm> required minimal ping time of the session =item T<PM> required maximal ping time of the session =item T<Tm> required minimal time-out time of the session =item T<TM> required maximal time-out time of the session =noitemize

These time values have to be expressed as GTM time stamps. If a value is zero or T<undef> the value in the constraint is ignored. Unspecified arguments are T<undef> by ScriptBasic behaviour.

For example to get the list of all sessions that are older than an hour

=verbatim call mt::ListSession Array,undef,GmTime()-60*60 =noverbatim

To get all session IDs that timed out:

=verbatim call mt::ListSession Array,undef,undef,undef,undef,undef,GmTime() =noverbatim

To get all sessions that are idle for more than ten minutes

=verbatim call mt::ListSession Array,undef,undef,undef,GmTime()-600 =noverbatim

Note that this subroutine is rarely used in "cgi" scripts. This subroutine has to be used in scripts that are run by the Eszter SB Engine asynchronously started using the configuration key T<httpd.run.[re]start>. Those scripts start before the engine starts to listen on a port and run so long as long the engine runs and are able to scan the sessions from time to time and delete the old sessions freeing the memoryof the module MT.

Definition at line 1447 of file interface.c.

besEND besFUNCTION getsespt   ) 
 

=section GetSessionPingTime =H mt::GetSessionPingTime ["sessionid"]

This function returns the time when the session was last used (assigned to a script). This value is expressed as GMT seconds since January 1, 1970. 0:00.

If the argument is missing the actual argument is used.

Definition at line 1330 of file interface.c.

References MT_ERROR_NOSESSION, pMT, and _MtClass::pszSessionId.

besEND besFUNCTION sessionto   ) 
 

=section SessionTimeout =H mt::SessionTimeout [sec]

Call this function to set session timeout (20 minutes in the example) =verbatim mt::SessionTimeout 20*60 =noverbatim or =verbatim mt::SessionTimeout =noverbatim cancelling session timeout.

Definition at line 1223 of file interface.c.

References COMMAND_ERROR_SUCCESS, and pS.

besEND besFUNCTION unlockmtread   ) 
 

=section UnlockRead =H mt::UnlockRead "variablename" Unlock mt variable from read protection

Definition at line 1169 of file interface.c.

References besUnlockMutex(), and COMMAND_ERROR_MEMORY_LOW.

besEND besFUNCTION unlockmtwrite   ) 
 

=section UnlockWrite =H mt::UnlockWrite "variablename"

Unlock mt variable from write protection.

Definition at line 1125 of file interface.c.

References besUnlockMutex(), and COMMAND_ERROR_MEMORY_LOW.

besEND besFUNCTION lockmtread   ) 
 

=section LockRead =H mt::LockRead "variablename"

Lock mt variable for read protection. Several concurrent programs can read lock a variable, but so long as long there are read locks no program can write lock a variable.

The function will wait until it can lock the variable. A variable can not be read locked if the variable is write locked or there is a write lock waiting for the variable.

Definition at line 1081 of file interface.c.

References besUnlockMutex(), and COMMAND_ERROR_MEMORY_LOW.

besEND besFUNCTION lockmtwrite   ) 
 

=section LockWrite =H mt::LockWrite "variablename"

Lock mt variable for write protection. While the variable is locked no programs can access it, not even the one that locked the variable.

Usually there is no need to alter the MT variables, as the variables are automatically locked while their value is altered. Locking is needed when a program needs to alter more than one MT variable in a coincise manner. Another possibility is when a program wants to alter a variable and the new value depends on the previous value. As a simplest example is when aprogram wants to increment a variable.

In either case the programs have to have a pseudo MT variable, which is used in the locking and unlocking functions. Usually the programs use these variables only to lock and to release and do not care their values, albeit there is nothing that would prohibit using the values.

For example a program (X) wants to increment the MT variable "B" and it has to keep track of the variable "BB" to ensure that "BB" is the double of "B".

In the meantime another (Y) program wants to decrement "BB" by two and set "B" to the half of "BB" to keep the rule.

Program X: =verbatim mt::GetVariable "B",B B = B+1 mt::SetVariable "B",B mt::SetVariable "BB",2*B =noverbatim

Program Y: =verbatim mt::GetVariable "BB",BB BB = BB-2 mt::SetVariable "BB",BB mt::SetVariable "B",B \ 2 =noverbatim

The lines of the two programs can execute in any mixed order.

See the following scenario: =itemize =item Program X examines B and sees that B is 3 (for example) =item Program Y examines BB and sees that BB is 6. =item Program X increments B to be 4. =item Program Y decrements BB to be 4. =item Program Y sets B to be the half of BB to 2. =item Program X sets the variable BB to the double of B, which is 8 for that program. =end itemize

Instead a variable called "BLCK" has to be used (BLCK is just for example):

Program X: =verbatim mt::LockWrite "BLCK" mt::GetVariable "B",B B = B+1 mt::SetVariable "B",B mt::SetVariable "BB",2*B mt::UnlockWrite "BLCK" =noverbatim

Program Y: =verbatim mt::LockWrite "BLCK" mt::GetVariable "BB",BB BB = BB-2 mt::SetVariable "BB",BB mt::SetVariable "B",B \ 2 mt::UnlockWrite "BLCK" =noverbatim

The locking at the start of the critical code segments prevents two programs to enter the critical part at the same time.

Definition at line 1033 of file interface.c.

References besUnlockMutex(), and COMMAND_ERROR_MEMORY_LOW.

besEND besFUNCTION getmtvariable   ) 
 

=section GetVariable =H mt::GetVariable("variablename")

Get Mt variable. This function gets the value of an Mt variable.

Definition at line 901 of file interface.c.

References besUnlockMutex(), and COMMAND_ERROR_SUCCESS.

besEND besFUNCTION setmtvariable   ) 
 

=section SetVariable =H mt::SetVariable "variablename",value

Set the value of an MT variable. The first argument has to be a string that identifies the variable. The second argument is the new value of the variable.

MT variables are global, all running scripts like the same values.

Definition at line 803 of file interface.c.

References besUnlockMutex(), and COMMAND_ERROR_MEMORY_LOW.

besEND besFUNCTION getsvariable   ) 
 

=section GetSessionVariable =H mt::GetSessionVariabe("variablename")

Get the value of a session variable. The argument has to be a string that identifies the session variable.

The value of a session variable can be set using R<SetSessionVariable>.

Definition at line 732 of file interface.c.

References besUnlockMutex(), COMMAND_ERROR_SUCCESS, and pS.

besEND besFUNCTION getsession   ) 
 

=section GetSessionId =H mt::GetSessionId()

This function returns the actual session id. This is usually known by the program because this is the id that was set calling R<SetSessionId> or was created and returned by R<NewSessionId>. However some programs may need to call this function.

Definition at line 606 of file interface.c.

References besUnlockMutex(), COMMAND_ERROR_MEMORY_LOW, and pS.

besFUNCTION delsession   ) 
 

=section DeleteSession =H mt::DeleteSession ["sessionid"]

Call this function to delete a session. The function deletes the session and releases all memory that was allocated to store session variables.

If no argumentum is supplied then the function deletes the actual session.

Definition at line 508 of file interface.c.

References MT_ERROR_NOSESSION, pMT, and _MtClass::pszSessionId.

besEND besFUNCTION chksession   ) 
 

=section CheckSessionId =H mt::CheckSessionId("sessionid")

Checks that a session already exists. The function returns T<TRUE> if the session id already exists.

This function can and should be used to check that a session is valid or not based on its existence. If the session is not existent the program can still call the function R<SetSessionId> to set the session and the new session is autmatically created.

However calling this function is a good chanhe to check if any session initialization is needed, for example password check.

Definition at line 349 of file interface.c.

References besCONVERT2STRING(), and besDEREFERENCE().

besLockMutex mxSessionCounter  ) 
 

Referenced by alloc_Wrapper(), delete_Wrapper(), ReleaseSession(), rpm_ager(), rpm_close_excess(), rpm_GetResource(), rpm_open(), rpm_PutResource(), and rpm_thread().

besLockSharedRead ((*p)->lckV)  ) 
 

besLockSharedWrite ((*p)->lckV)  ) 
 

besLockSharedWrite (pS->lckSession)  ) 
 

besMD5INIT Context  ) 
 

besMD5UPDATE Context,
(unsigned char *)&  lThisSession,
sizeof(unsigned long) 
 

besTRAVERSESYMBOLTABLE pS->  stSession,
FinishSegmentCallBack  ,
pSt 
 

besUnlockMutex mxSessionCounter  ) 
 

Referenced by alloc_Wrapper(), besFUNCTION(), delete_Wrapper(), if(), ReleaseSession(), rpm_ager(), rpm_close_excess(), rpm_GetResource(), rpm_open(), rpm_PutResource(), rpm_thread(), and while().

besUnlockSharedRead ((*p)->lckV)  ) 
 

besUnlockSharedRead (pS->lckSession)  ) 
 

Referenced by if().

besUnlockSharedWrite ((*p)->lckV)  ) 
 

besUnlockSharedWrite (pS->lckSession)  ) 
 

Referenced by if().

pSt DeleteSymbol pszSession  ,
SessionTable  ,
pSt->  Free,
besPROCMEMORYSEGMENT 
 

static besEND void FinishSegmentCallBack char *  SymbolName,
void *  SymbolValue,
void *  f
[static]
 

Definition at line 489 of file interface.c.

References besFinishSharedLock(), p, and pSt.

if cSessionList  = = 0  ) 
 

Definition at line 1480 of file interface.c.

References besUnlockMutex(), COMMAND_ERROR_SUCCESS, and mxSessionTable.

if VARIABLE  Argument = NULL  ) 
 

Definition at line 1245 of file interface.c.

if TYPE((*p)->vV)  = = VTYPE_STRING  ) 
 

Definition at line 769 of file interface.c.

References besALLOC_RETURN_STRING(), besRETURNVALUE, besUnlockSharedRead(), COMMAND_ERROR_SUCCESS, memcpy(), STRINGVALUE(), and STRLEN().

if TYPE(Argument = = VTYPE_STRING  ) 
 

Definition at line 696 of file interface.c.

References besUnlockSharedWrite(), COMMAND_ERROR_MEMORY_LOW, COMMAND_ERROR_SUCCESS, memcpy(), NULL, pS, pSt, STRINGVALUE(), and STRLEN().

if *p->  vV = =NULL  )  = besPROCALLOC(sizeof(FixSizeMemoryObject))
 

Definition at line 684 of file interface.c.

References besUnlockSharedWrite(), and COMMAND_ERROR_MEMORY_LOW.

if IsUndef(Argument  ) 
 

Definition at line 676 of file interface.c.

References besUnlockSharedWrite(), COMMAND_ERROR_SUCCESS, NULL, pS, and pSt.

if *p->vV &&  TYPE((*p)->vV) = = VTYPE_STRING && STRINGVALUE((*p)->vV)  ) 
 

Definition at line 670 of file interface.c.

References NULL, pS, pSt, and STRINGVALUE().

if bSessDef  ) 
 

Definition at line 1846 of file string.c.

if pS  = NULL  ) 
 

Definition at line 561 of file interface.c.

References besFREE(), and EXE_ERROR_INTERNAL.

if p  = NULL  ) 
 

Definition at line 454 of file interface.c.

References besUnlockMutex(), COMMAND_ERROR_MEMORY_LOW, and mxSessionTable.

if Argument   ) 
 

Definition at line 438 of file interface.c.

if pMT->  pszSessionId = =NULL  ) 
 

if pMT besMODULEPOINTER = NULL  ) 
 

Definition at line 193 of file interface.c.

References besFREE(), besUnlockMutex(), and COMMAND_ERROR_MEMORY_LOW.

INC_THREAD_COUNTER INITLOCK if iFirst   ) 
 

Definition at line 169 of file interface.c.

References COMMAND_ERROR_MEMORY_LOW, lSessionCounter, MtVariables, mxMTVariables, mxSessionCounter, mxSessionTable, NULL, pSessionRoot, pSt, and SessionTable.

LONGVALUE besRETURNVALUE   ) 
 

ReleaseSession pSt  ,
pS 
 

static void ReleaseSession pSupportTable  pSt,
pSessionInfo  pS
[static]
 

Definition at line 117 of file interface.c.

References besLockMutex(), besUnlockMutex(), mxSessionTable, pS, and pSessionRoot.

besEND besVERSION_NEGOTIATE return int   ) 
 

Definition at line 1514 of file interface.c.

strcpy pMT->  pszSessionId,
SymbolName(p
 

Referenced by _GetParam(), AllocFileName(), AllocUserFunction(), bestfta_p(), build_PutFTableItem(), build_PutVTableItem(), build_SaveECode(), BuildSubTree(), c_StrDup(), CBF_ListGlobalVars(), CBF_ListLocalVars(), cft_GetConfigFileName(), cft_start(), collect_dirs(), collect_dirs_r(), dynlolib_GetFunctionByName(), dynlolib_LoadLibrary(), epreproc(), ex_ConvertName(), ex_init(), ex_IsCommandOPEN(), ex_IsCommandThis(), ex_IsSymbolValidLval(), ExecuteProgram(), ExecuteProgramThread(), expression_PopNameSpace(), expression_PushNameSpace(), F_LibraryLoaded(), file_deltree(), file_deltree_r(), file_opendir(), fork(), format_num(), FtpProc(), GetSBRegString(), HttpExtensionProc(), if(), InstallScriptBasic(), ipreproc_LoadInternalPreprocessor(), lex_ReadInput(), main(), mcadd(), modu_LoadModule(), MyFiles(), MyLinks(), pathdialog(), preproc(), reader_LoadPreprocessors(), reader_ProcessIncludeFiles(), reader_ReadLines_r(), reader_RelateFile(), regerror(), scriba_GetCacheFileName(), scriba_LoadProgramString(), scriba_ReadSource(), scriba_RunExternalPreprocessor(), scriba_SetFileName(), scriba_UseCacheFile(), SearchProcAddress(), SPrintVariable(), and sym_LookupSymbol().

STRINGVALUE besRETURNVALUE   ) 
 

Referenced by _GetData(), basext_GetArgsF(), besFUNCTION(), CHECK_OPTION(), FileIsSecure(), if(), IsTrue(), scriba_CallArg(), scriba_CallArgEx(), serconv(), serconvXML(), STRCMP(), switch(), varcmp(), varhashpjw(), and while().

static void time_out_work_thread void *  p  )  [static]
 

Definition at line 134 of file interface.c.

References besCONFIGEX(), NULL, pS, pSessionRoot, and pSt.

while pS   ) 
 

Definition at line 1493 of file interface.c.

References besUnlockMutex(), COMMAND_ERROR_MEMORY_LOW, memcpy(), mxSessionTable, SESSION__CONSTRAINT, and STRINGVALUE().


Variable Documentation

Argument = besARGUMENT(1)
 

Definition at line 1242 of file interface.c.

Argument = besARGUMENT(2)
 

Definition at line 840 of file interface.c.

Argument = besARGUMENT(2)
 

Definition at line 667 of file interface.c.

p vV ArrayHighLimit = 0
 

Definition at line 867 of file interface.c.

p vV ArrayHighLimit = 0
 

Definition at line 693 of file interface.c.

Referenced by memory_ReleaseVariable(), return(), serconv(), serconvXML(), and unserconv().

p vV ArrayLowLimit = 1
 

Definition at line 868 of file interface.c.

p vV ArrayLowLimit = 1
 

Definition at line 694 of file interface.c.

Referenced by memory_ReDimArray(), and unserconv().

pMT AssignedSession = pS
 

Definition at line 483 of file interface.c.

pMT AssignedSession = NULL
 

Definition at line 450 of file interface.c.

pMT AssignedSession = pS
 

Definition at line 328 of file interface.c.

besALLOC_RETURN_LONG
 

Definition at line 1381 of file interface.c.

besALLOC_RETURN_LONG
 

Definition at line 1313 of file interface.c.

INITUNLO besMODULEPOINTER = besALLOC(sizeof(MtClass))
 

Definition at line 192 of file interface.c.

return COMMAND_ERROR_SUCCESS
 

Definition at line 1205 of file interface.c.

return COMMAND_ERROR_SUCCESS
 

Definition at line 1161 of file interface.c.

return COMMAND_ERROR_SUCCESS
 

Definition at line 1116 of file interface.c.

return COMMAND_ERROR_SUCCESS
 

Definition at line 1068 of file interface.c.

cSessionList = 0
 

Definition at line 1492 of file interface.c.

return EXE_ERROR_INTERNAL
 

Definition at line 954 of file interface.c.

return EXE_ERROR_INTERNAL
 

Definition at line 892 of file interface.c.

return EXE_ERROR_INTERNAL
 

Definition at line 790 of file interface.c.

return EXE_ERROR_INTERNAL
 

Definition at line 720 of file interface.c.

Referenced by execute_Evaluate(), execute_LeftValue(), execute_LeftValueArray(), execute_LeftValueSarray(), and if().

pS lPingTime = time(NULL)
 

Definition at line 484 of file interface.c.

pS lPingTime = time(NULL)
 

Definition at line 329 of file interface.c.

unsigned long lSessionCounter [static]
 

Definition at line 69 of file interface.c.

Referenced by if().

return lTC
 

Definition at line 1553 of file interface.c.

lThisSession = lSessionCounter++
 

Definition at line 432 of file interface.c.

* Lval = besNEWARRAY(1,cSessionList)
 

Definition at line 1485 of file interface.c.

Referenced by if().

besEND besSUB_PROCESS_FINISH FINISH_MULTITHREAD besEND SLFST MT_SLFST[]
 

Initial value:

{

{ "keepmodu" , keepmodu },
{ "shutmodu" , shutmodu },
{ "bootmodu" , bootmodu },
{ "setsession" , setsession },
{ "chksession" , chksession },
{ "sessioncount" , sessioncount },
{ "newsession" , newsession },
{ "delsession" , delsession },
{ "getsession" , getsession },
{ "setsvariable" , setsvariable },
{ "getsvariable" , getsvariable },
{ "setmtvariable" , setmtvariable },
{ "getmtvariable" , getmtvariable },
{ "lockmtwrite" , lockmtwrite },
{ "lockmtread" , lockmtread },
{ "unlockmtwrite" , unlockmtwrite },
{ "unlockmtread" , unlockmtread },
{ "sessionto" , sessionto },
{ "getsesto" , getsesto },
{ "getsespt" , getsespt },
{ "listses" , listses },
{ "versmodu" , versmodu },
{ "finimodu" , finimodu },
{ "keepmodu" , keepmodu },
{ "_init" , _init },
{ "_fini" , _fini },
{ NULL , NULL }
  }

Definition at line 1565 of file interface.c.

SUPPORT_MULTITHREAD SymbolTable MtVariables [static]
 

=H The module MT =abstract Support for multi-thread implementation web applications. =end

This module delivers functions that can be used by ScriptBasic programs executed by a multi-thread basic interpreter. This means that the programs are executed in the same process one after the other or in synchron. The typical example is the Eszter SB Engine that is a standalone webserver execution BASIC programs to answer http questions. Those programs may ask this module to store session variables, wait for eachother.

Definition at line 67 of file interface.c.

Referenced by if().

MUTEX mxMTVariables [static]
 

Definition at line 68 of file interface.c.

Referenced by if().

MUTEX mxSessionCounter [static]
 

Definition at line 68 of file interface.c.

Referenced by if().

MUTEX mxSessionTable [static]
 

Definition at line 68 of file interface.c.

Referenced by if(), ReleaseSession(), and while().

p vV next = NULL
 

Definition at line 865 of file interface.c.

p vV next = NULL
 

Definition at line 691 of file interface.c.

Referenced by alloc_Merge(), and reader_ReadLines().

p = pSt->LookupSymbol(pszSession,SessionTable,0,pSt->Alloc,pSt->Free,besPROCMEMORYSEGMENT)
 

Definition at line 1357 of file interface.c.

p = pSt->LookupSymbol(pszSession,SessionTable,0,pSt->Alloc,pSt->Free,besPROCMEMORYSEGMENT)
 

Definition at line 1289 of file interface.c.

p = pSt->LookupSymbol(pszSession,SessionTable,0,pSt->Alloc,pSt->Free,besPROCMEMORYSEGMENT)
 

Definition at line 545 of file interface.c.

p = pSt->LookupSymbol(STRINGVALUE(besRETURNVALUE),SessionTable,1,pSt->Alloc,pSt->Free,besPROCMEMORYSEGMENT)
 

Definition at line 453 of file interface.c.

besSUB_SHUTDOWN besEND besSUB_START pMtClass pMT
 

Definition at line 159 of file interface.c.

Referenced by besFUNCTION().

p vV link prev = NULL
 

Definition at line 866 of file interface.c.

p vV link prev = NULL
 

Definition at line 692 of file interface.c.

pS = *p
 

Definition at line 1368 of file interface.c.

pS = *p
 

Definition at line 1300 of file interface.c.

pS = *p
 

Definition at line 554 of file interface.c.

Referenced by AllocNewSession(), besFUNCTION(), if(), ReleaseSession(), and time_out_work_thread().

pSessionInfo pSessionRoot [static]
 

Definition at line 84 of file interface.c.

Referenced by AllocNewSession(), if(), ReleaseSession(), and time_out_work_thread().

besEND besSUB_PROCESS_START INIT_MULTITHREAD return
 

Definition at line 1558 of file interface.c.

SUPPORT_MULTITHREAD SymbolTable SessionTable [static]
 

Definition at line 67 of file interface.c.

Referenced by if().

p vV State = STATE_UNKNOWN
 

Definition at line 864 of file interface.c.

p vV State = STATE_UNKNOWN
 

Definition at line 690 of file interface.c.

p vV sType = 0
 

Definition at line 863 of file interface.c.

p vV sType = 0
 

Definition at line 689 of file interface.c.


Generated on Sun Mar 12 23:56:36 2006 for ScriptBasic by  doxygen 1.4.6-NO