Charles,
I gave using
scriba.h a try but it's complaining about syntax of one of the ScriptBasic .h files. Is this a show stopper using
scriba.h with O2?
This seems to be a 'rabbit hole' that keeps getting deeper as I try to fill the holes. The
bind seems like the way to go.
% filename "weather.exe"
includepath "$/inc/"
include "RTL32.inc"
includepath "C:\sbgcc\source\"
extern lib "libscriba.dll" cdecl
include "scriba.h"
end extern
function newmem cdecl (sys le) as sys, export
return getmemory le
end function
function freemem cdecl (sys p) export
freememory p
end function
sys pProgram, fnsn
sbData *arg
sbData *argr
pProgram = scriba_new(@newmem, @freemem)
scriba_LoadConfiguration(pProgram, "C:\Windows\SCRIBA.INI")
scriba_SetFileName(pProgram, "weather.sb")
scriba_LoadSourceProgram(pProgram)
scriba_Run(pProgram, "")
@arg = scriba_NewSbArgs(pProgram, "s", "Anacortes,US")
fnsn = scriba_LookupFunctionByName(pProgram, "main::get_weather")
@argr = scriba_NewSbArgs(pProgram,"s", "")
scriba_CallArgEx(pProgram, fnsn, argr, 1, arg)
print argr.v.s
scriba_DestroySbArgs(pProgram, arg, 1)
scriba_DestroySbArgs(pProgram, argr, 1)
scriba_destroy(pProgram)
This seems to be the problem area in the
lexer.h include file.
enum LexemeType {
LEX_T_DOUBLE = 1,
LEX_T_LONG,
LEX_T_STRING,
LEX_T_ASYMBOL,
LEX_T_NSYMBOL,
LEX_T_CHARACTER,
LEX_T_SKIP,
LEX_T_SKIP_SYMBOL,
LEX_T_DUMMY
};
typedef struct _Lexeme {
enum LexemeType type;
union {
double dValue;
long lValue;
char *sValue;
} value;
long sLen;
char *szFileName;
long lLineNumber;
struct _Lexeme *next;
}Lexeme, *pLexeme;
I tried the
basext.h ScriptBasic include which is the include file for the ScriptBasic extension API.