ScriptBasic Developers Manual
by Peter Verhas
Table of Contents
1. Introduction
2. Interpreter Architecture
3. Embedding the Interpreter
4. Extension Modules
4.1. How Extension Modules are Used
4.2. A Simple Sample Module
4.3. Compiling a Module
4.4. Installing a Module
4.5. Module Support Functions
4.5.1. Basic Extension Support functions, structures and macros
4.5.2. besALLOC(X)
4.5.3. besPROCALLOC(X)
4.5.4. besFREE(X)
4.5.5. besPROCFREE(X)
4.5.6. besPROCMEMORYSEGMENT
4.5.7. besNEWMORTALSTRING(X)
4.5.8. besNEWMORTALLONG
4.5.9. besNEWMORTALREF
4.5.10. besNEWMORTALDOUBLE
4.5.11. besNEWMORTALARRAY(X,Y)
4.5.12. besNEWSTRING(X)
4.5.13. besNEWLONG
4.5.14. besNEWREF
4.5.15. besNEWDOUBLE
4.5.16. besNEWARRAY(X,Y)
4.5.17. besRELEASE(X)
4.5.18. besSETREF(VAR,VAL)
4.5.19. besCONFIG(X)
4.5.20. besCONFIGFINDNODE(X,Y,Z)
4.5.21. besCONFIGEX(CT,CS,NS,CSS,LS,DS,IS)
4.5.22. besCONFIGENUMFIRST(X,Y)
4.5.23. besCONFIGENUMNEXT(X,Y)
4.5.24. besCONFIGGETKEY(X,Y)
4.5.25. besNEWSYMBOLTABLE
4.5.26. besFREESYMBOLTABLE(X)
4.5.27. besTRAVERSESYMBOLTABLE(X,Y,Z)
4.5.28. besLOOKUPSYMBOL(X,Y,Z)
4.5.29. besDeleteSymbol(X,Y,Z)
4.5.30. besLOADLIBRARY(X)
4.5.31. besFREELIBRARY(X)
4.5.32. besGETFUNCTIONBYNAME(X)
4.5.33. besFOPEN
4.5.34. besFCLOSE
4.5.35. besSIZE
4.5.36. besTIME_ACCESSED
4.5.37. besTIME_MODIFIED
4.5.38. besTIME_CREATED
4.5.39. besISDIR
4.5.40. besISREG
4.5.41. besEXISTS
4.5.42. besTRUNCATE
4.5.43. besFGETC
4.5.44. besFREAD
4.5.45. besFWRITE
4.5.46. besSETMODE
4.5.47. besBINMODE
4.5.48. besTEXTMODE
4.5.49. besFERROR
4.5.50. besFPUTC
4.5.51. besFLOCK
4.5.52. besLOCK
4.5.53. besFEOF
4.5.54. besMKDIR
4.5.55. besRMDIR
4.5.56. besREMOVE
4.5.57. besDELTREE
4.5.58. besMAKEDIRECTORY
4.5.59. besOPENDIR
4.5.60. besREADDIR
4.5.61. besCLOSEDIR
4.5.62. besOPTION(X)
4.5.63. besSETOPTION(x,y)
4.5.64. besRESETOPTION(X)
4.5.65. besCONVERT2STRING(x)
4.5.66. besCONVERT2LONG(x)
4.5.67. besGETLONGVALUE(x)
4.5.68. besCONVERT2DOUBLE(x)
4.5.69. besGETDOUBLEVALUE(x)
4.5.70. besISSTRINGINTEGER(x)
4.5.71. besCONVERT2ZCHAR(x)
4.5.72. besREINITINTERFACE
4.5.73. besLOADMODULE(x,y)
4.5.74. besGETMODULEFUNCTIONBYNAME
4.5.75. besUNLOADALLMODULES
4.5.76. besUNLOADMODULE(x)
4.5.77. besSLEEP(x)
4.5.78. besCURDIR(x,y)
4.5.79. besCHDIR(x)
4.5.80. besCHOWN(x,y)
4.5.81. besSETCREATETIME(x,y)
4.5.82. besSETMODIFYTIME(x,y)
4.5.83. besSETACCESSTIME(x,y)
4.5.84. besGETHOSTNAME(x,y)
4.5.85. besGETHOST(x,y)
4.5.86. besTCPCONNECT(x,y)
4.5.87. besTCPSEND(x,y,z)
4.5.88. besTCPRECV(x,y,z)
4.5.89. besTCPCLOSE(y)
4.5.90. besKILLPROC(x)
4.5.91. besGETOWNER(x,y,z)
4.5.92. besCRYPT(x,y,z)
4.5.93. besMD5INIT(C)
4.5.94. besMD5UPDATE(C,I,L)
4.5.95. besMD5FINAL(D,C)
4.5.96. besCREATEPROCESS(X)
4.5.97. besCOPYCOMMANDTABLE(X)
4.5.98. besGETCOMMANDBYNAME(X,Y)
4.5.99. besEVALUATEEXPRESSION(X)
4.5.100. _besEVALUATEEXPRESSION(X)
4.5.101. _besEVALUATEEXPRESSION_A(X)
4.5.102. besEVALUATELEFTVALUE(X)
4.5.103. besEVALUATELEFTVALUE_A(X)
4.5.104. besIMMORTALIZE(x)
4.5.105. besDEREFERENCE(X)
4.5.106. besMatchIndex(X)
4.5.107. besMatchIniSets(X)
4.5.108. besMatchModifySet(X,Y,Z,W,Q)
4.5.109. besMatchMatch(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12)
4.5.110. besMatchCount(X,Y)
4.5.111. besMatchParameter(P1,P2,P3,P4,P5,P6,P7)
4.5.112. besMatchSize(P1,P2,P3,P4,P5)
4.5.113. besCreateThread(X,Y,Z)
4.5.114. besExitThread
4.5.115. besInitMutex(X)
4.5.116. besFinishMutex(X)
4.5.117. besLockMutex(X)
4.5.118. besUnlockMutex(X)
4.5.119. besInitSharedLock(X)
4.5.120. besFinishSharedLock(X)
4.5.121. besLockSharedRead(X)
4.5.122. besLockSharedWrite(X)
4.5.123. besUnlockSharedRead(X)
4.5.124. besUnlockSharedWrite(X)
4.5.125. besScribaNew(F0,F1)
4.5.126. besScribaDestroy(F0)
4.5.127. besScribaNewSbData(F0)
4.5.128. besScribaNewSbLong(F0,F1)
4.5.129. besScribaNewSbDouble(F0,F1)
4.5.130. besScribaNewSbUndef(F0)
4.5.131. besScribaNewSbString(F0,F1)
4.5.132. besScribaNewSbBytes(F0,F1,F2)
4.5.133. besScribaDestroySbData(F0,F1)
4.5.134. besScribaPurgeReaderMemory(F0)
4.5.135. besScribaPurgeLexerMemory(F0)
4.5.136. besScribaPurgeSyntaxerMemory(F0)
4.5.137. besScribaPurgeBuilderMemory(F0)
4.5.138. besScribaPurgeExecuteMemory(F0)
4.5.139. besScribaSetFileName(F0,F1)
4.5.140. besScribaLoadConfiguration(F0,F1)
4.5.141. besScribaInheritConfiguration(F0,F1)
4.5.142. besScribaSetCgiFlag(F0)
4.5.143. besScribaSetReportFunction(F0,F1)
4.5.144. besScribaSetReportPointer(F0,F1)
4.5.145. besScribaSetStdin(F0,F1)
4.5.146. besScribaSetStdout(F0,F1)
4.5.147. besScribaSetEmbedPointer(F0,F1)
4.5.148. besScribaSetEnvironment(F0,F1)
4.5.149. besScribaLoadBinaryProgram(F0)
4.5.150. besScribaInheritBinaryProgram(F0,F1)
4.5.151. besScribaReadSource(F0)
4.5.152. besScribaDoLexicalAnalysis(F0)
4.5.153. besScribaDoSyntaxAnalysis(F0)
4.5.154. besScribaBuildCode(F0)
4.5.155. besScribaIsFileBinaryFormat(F0)
4.5.156. besScribaGetCacheFileName(F0)
4.5.157. besScribaUseCacheFile(F0)
4.5.158. besScribaSaveCacheFile(F0)
4.5.159. besScribaRunExternalPreprocessor(F0,F1)
4.5.160. besScribaSaveCode(F0,F1)
4.5.161. besScribaSaveCCode(F0,F1)
4.5.162. besScribaLoadSourceProgram(F0)
4.5.163. besScribaRun(F0,F1)
4.5.164. besScribaNoRun(F0)
4.5.165. besScribaResetVariables(F0)
4.5.166. besScribaCall(F0,F1)
4.5.167. besScribaCallArg(F0,F1,F2,F3)
4.5.168. besScribaDestroySbArgs(F0,F1,F2)
4.5.169. besScribaNewSbArgs(F0,F1,F2)
4.5.170. besScribaCallArgEx(F0,F1,F2,F3,F4)
4.5.171. besScribaLookupFunctionByName(F0,F1)
4.5.172. besScribaLookupVariableByName(F0,F1)
4.5.173. besScribaGetVariableType(F0,F1)
4.5.174. besScribaGetVariable(F0,F1,F2)
4.5.175. besScribaSetVariable(F0,F1,F2,F3,F4,F5,F6)
4.5.176. besLogState(X)
4.5.177. besLogInit(F0,F1,F2,F3,F4,F5)
4.5.178. besLogPrintf(pLOG,FORMAT, ...)
4.5.179. besLogShutdown(pLOG)
4.5.180. besHandleGetHandle(X,Y)
4.5.181. besHandleGetPointer(X,Y)
4.5.182. besHandleFreeHandle(X,Y)
4.5.183. besHandleDestroyHandleArray(X)
4.5.184. besINIT_SEGMENT(MAF,MRF)
4.5.185. besSEGMENT_LIMIT(PMS,L)
4.5.186. besFREE_SEGMENT(PMS)
4.5.187. besFINISH_SEGMENT(PMS)
4.5.188. besFUNCTION(X)
4.5.189. besASSERT_FUNCTION
4.5.190. besCOMMAND(X)
4.5.191. besASSERT_COMMAND
4.5.192. besEND_COMMAND
4.5.193. besARGNR
4.5.194. besARGUMENT(X)
4.5.195. besPARAMETERLIST
4.5.196. besLEFTVALUE(X,Y)
4.5.197. besVERSION_NEGOTIATE
4.5.198. besSUB_START
4.5.199. besSUB_FINISH
4.5.200. besSUB_ERRMSG
4.5.201. besSUB_PROCESS_START
4.5.202. besSUB_PROCESS_FINISH
4.5.203. besSUB_KEEP
4.5.204. besSUB_SHUTDOWN
4.5.205. besSUB_AUTO
4.5.206. besEND
4.5.207. besRETURNVALUE
4.5.208. besMODULEPOINTER
4.5.209. besALLOC_RETURN_STRING(X)
4.5.210. besALLOC_RETURN_POINTER
4.5.211. besALLOC_RETURN_LONG
4.5.212. besALLOC_RETURN_DOUBLE
4.5.213. besRETURN_STRING(X)
4.5.214. besSET_RETURN_STRING(X)
4.5.215. besRETURN_MEM(X,Y)
4.5.216. besRETURN_POINTER(X)
4.5.217. besRETURN_LONG(X)
4.5.218. besRETURN_DOUBLE
4.5.219. besSETCOMMAND(X,Y)
4.5.220. besGETCOMMAND(X)
4.5.221. INTERFACE_VERSION
4.5.222. besHOOK_FILE_ACCESS
4.5.223. besHOOK_FOPEN
4.5.224. besHOOK_FCLOSE
4.5.225. besHOOK_SIZE
4.5.226. besHOOK_TIME_ACCESSED
4.5.227. besHOOK_TIME_MODIFIED
4.5.228. besHOOK_TIME_CREATED
4.5.229. besHOOK_ISDIR
4.5.230. besHOOK_ISREG
4.5.231. besHOOK_EXISTS
4.5.232. besHOOK_TRUNCATE
4.5.233. besHOOK_FGETC
4.5.234. besHOOK_FREAD
4.5.235. besHOOK_FWRITE
4.5.236. besHOOK_FERROR
4.5.237. besHOOK_PUTC
4.5.238. besHOOK_FLOCK
4.5.239. besHOOK_LOCK
4.5.240. besHOOK_FEOF
4.5.241. besHOOK_MKDIR
4.5.242. besHOOK_RMDIR
4.5.243. besHOOK_REMOVE
4.5.244. besHOOK_DELTREE
4.5.245. besHOOK_MAKEDIRECTORY
4.5.246. besHOOK_OPENDIR
4.5.247. besHOOK_READDIR
4.5.248. besHOOK_CLOSEDIR
4.5.249. besHOOK_SLEEP
4.5.250. besHOOK_CURDIR
4.5.251. besHOOK_CHDIR
4.5.252. besHOOK_CHOWN
4.5.253. besHOOK_SETCREATETIME
4.5.254. besHOOK_SETMODIFYTIME
4.5.255. besHOOK_SETACCESSTIME
4.5.256. besHOOK_GETHOSTNAME
4.5.257. besHOOK_GETHOST
4.5.258. besHOOK_TCPCONNECT
4.5.259. besHOOK_TCPSEND
4.5.260. besHOOK_TCPRECV
4.5.261. besHOOK_TCPCLOSE
4.5.262. besHOOK_KILLPROC
4.5.263. besHOOK_GETOWNER
4.5.264. besHOOK_CREATEPROCESS
4.5.265. besHOOK_CALLSCRIBAFUNCTION
4.5.266. besSETHOOK(X,Y)
4.5.267. besDLL_MAIN
4.5.268. INITLOCK
4.5.269. basext_GetArgsF()
5. Preprocessors
6. Compilation