Commit 4581463c authored by kollo's avatar kollo

version 1.13-2007-03-17

parent 26f10af7
......@@ -100,7 +100,16 @@ cp mathemat_dummy.c mathematics.c
then:
make lib will generate libx11basic.so
make x11basic.a will generate x11basic.a
-- now you have to be root --
mv libx11basic.so /usr/lib/
mv x11basic.a /usr/lib/
-- please also check the permissions of the files:
chmod 755 /usr/lib/x11basic.a
chmod 755 /usr/lib/libx11basic.so
rehash
make installroot
will generate a dynamic linked binary of the interpreter,
copy it to /bin/, install the libraries in /usr/local/lib/,
......
......@@ -149,5 +149,9 @@ Version 1.12 (Mar 2005)
Version 1.13 (Feb 2006)
~~~~~~~~~~~~~~~~~~~~~~~~
- fixed bug in INPUT$()
- woked in the TINE implementation (TINELISTEN, TINEBROADCAST)
- new MKA$(), CVA()
- fixed bug in PAUSE/DELAY
- implemented ioctl() function
--------------------------------------------------------------------------------
Release notes for Version 1.13 (Feb 2006)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- fixed bug in INPUT$()
- woked in the TINE implementation (TINELISTEN, TINEBROADCAST)
- new MKA$(), CVA()
- fixed bug in PAUSE/DELAY
- implemented ioctl() function
......@@ -23,7 +23,7 @@
See the file `COPYING' for licensing information
Last change to this file: So Feb 5 12:45:19 CET 2006
Last change to this file: Do Mär 15 20:46:41 CET 2007
==> <==
X11-Basic is a comprehensive non-standard Basic inter­
......@@ -2833,6 +2833,19 @@ DESCRIPTION:
SEE ALSO: TIMER, STIMER
##############################################################################
Function: CVA()
Syntax: <array-result>=CVA(<string-expression>)
DESCRIPTION:
Returns array reconstructed from the string.
This function is the compliment of MKA$().
EXAMPLE:
a()=CVA(t$)
SEE ALSO: ASC(), CVF(), CVL(), MKA$()
##############################################################################
Function: CVD()
Syntax: <num-result>=CVD(<string-expression>)
DESCRIPTION:
......@@ -4406,6 +4419,38 @@ EXAMPLE:
PRINT INT(1.4), INT(-1.7)
Result: 1, -2
##############################################################################
Function: IOCTL()
Syntax: <num-result> = IOCTL(#n,d%[,adr%])
DESCRIPTION:
IOCTL() manipulates the underlying device parameters of special files.
In particular, many operating characteristics of character
special files (e.g. terminals) may be controlled with ioctl requests.
The argument #n must refer to an open file.
The second argument is a device-dependent request code. The third
argument is an untyped pointer to memory.
An ioctl request has encoded in it whether the argument is an in param-
eter or out parameter, and the size of the argument adr% refers to in
bytes.
Usually, on success zero is returned. A few ioctls use the return
value as an output parameter and return a nonnegative value on success.
On error, -1 is returned, and errno is set appropriately.
SEE ALSO: OPEN, CLOSE
EXAMPLE:
OPEN "U",#1,"/dev/console"
frequency=300
tone=1190000/frequency
KIOCSOUND=19247
PRINT ioctl(#1,KIOCSOUND,tone) ! Sounds the speaker
CLOSE #1
Result: 0
##############################################################################
##############################################################################
Function: JULDATE$()
......@@ -4853,12 +4898,13 @@ DESCRIPTION:
SEE ALSO: MAX()
##############################################################################
Function: MKI$(), MKL$(), MKS$(), MKF$(), MKD$()
Function: MKI$(), MKL$(), MKS$(), MKF$(), MKD$(), MKA$()
Syntax: <string-result>=MKI$(<num-expression>)
<string-result>=MKL$(<num-expression>)
<string-result>=MKS$(<num-expression>)
<string-result>=MKF$(<num-expression>)
<string-result>=MKD$(<num-expression>)
<string-result>=MKA$(<array-expression>)
DESCRIPTION:
......@@ -4869,9 +4915,10 @@ DESCRIPTION:
MKS$ a number into a 4-byte float format. \\
MKF$ same as MKS$(). \\
MKD$ a number into a 8-byte double float format.
MKA$() transforms a whole Array into a string.
It can be beacktransformed with CVA().
SEE ALSO: CVI(), CVF(), CVL()
SEE ALSO: CVI(), CVF(), CVL(), CVA(), CVS(), CVD()
##############################################################################
......@@ -6992,6 +7039,10 @@ Version 1.12 (Mar 2005)
Version 1.13 (Feb 2006)
~~~~~~~~~~~~~~~~~~~~~~~~
- fixed bug in INPUT$()
- woked in the TINE implementation (TINELISTEN, TINEBROADCAST)
- new MKA$(), CVA()
- fixed bug in PAUSE/DELAY
- implemented ioctl() function
--------------------------------------------------------------------------------
*Acknowlegements
......
# Preferences file for NEdit
# Preferences file for NEdit, created by Markus Hoffmann 1997-2006
# BASIC-defs
nedit.highlightPatterns: \
BASIC:1:0{\n\
Kommentar:"'":"\\n"::Comment::\n\
......@@ -13,11 +13,11 @@ nedit.highlightPatterns: \
DATA:"DATA ":"\\n"::Storage Type::\n\
operatoren:"[=<>]|<(AND|and|OR|or|NOT|not|DIV|div|MOD|mod|XOR|xor)>":::Preprocessor::\n\
num Konst:"<((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f)?>":::Numeric Const::\n\
SYSVARS:"<(ROWS|rows|COLS|cols|MOUSEK|mousek|MOUSEX|mousex|MOUSEY|mousey|MOUSES|mouses|TRUE|FALSE|true|false|crscol|CRSCOL|CRSLIN|crslin|CTIMER|ctimer|TIMER|timer|STIMER|stimer|ERR|err|DATE$|TIME$|date\\$|time\\$|TERMINALNAME$|terminalname\\$|INKEY$|inkey\\$|PI|pi|PC|SP|pc|sp)>":::Flag::\n\
Keyword2:"<(ADD|add|AFTER|after|ALERT|alert|ARRAYCOPY|arraycopy|ARRAYFILL|arrayfill|BEEP|beep|BELL|bell|BGET|bget|BLOAD|bload|BMOVE|bmove|BOX|box|BPUT|bput|BSAVE|bsave|CALL|call|CASE|case|CHAIN|chain|CIRCLE|circle|CLEAR|clear|CLEARW|clearw|CLOSE|close|CLOSEW|closew|CLR|clr|CLS|cls|COLOR|color|CONNECT|connect|COPYAREA|copyarea|DEC|dec|DEFFILL|deffill|DEFLINE|defline|DEFMARK|defmark|DEFMOUSE|defmouse|DEFTEXT|deftext|DIM|dim|DIV|div|DPOKE|dpoke|DRAW|draw|DUMP|dump|EDIT|edit|ELIPSE|elipse|ELLIPSE|ellipse|ERASE|erase|ERROR|error|EVENT|event|EVERY|every|EXEC|exec|FFT|fft|FILESELECT|fileselect|FIT|fit|FIT_LINEAR|fit_linear|FLUSH|flush|FREE|free|GET|get|GPRINT|gprint|GRAPHMODE|graphmode|CLIP|clip|HELP|help|HOME|home|INC|inc|INFOW|infow|INPUT|input|KEYEVENT|keyevent|LINE|line|LINEINPUT|lineinput|LINK|link|LIST|list|LOAD|load|LPOKE|lpoke|LTEXT|ltext|MERGE|merge|MENU|menu|MENUDEF|menudef|MENUKILL|menukill|MENUSET|menuset|MOUSE|mouse|MOUSEEVENT|mouseevent|MOTIONEVENT|motionevent|MOVEW|movew|MUL|mul|NEW|new|NOOP|noop|NOP|nop|NOROOTWINDOW|norootwindow|OPEN|open|OPENW|openw|OUT|out|PAUSE|pause|PBOX|pbox|PCIRCLE|pcircle|PELIPSE|pelipse|PELLIPSE|pellipse|PLIST|plist|PLOT|plot|POKE|poke|POLYFILL|polyfill|POLYLINE|polyline|POLYMARK|polymark|PRBOX|prbox|PRINT|print|PUT|put|PUTBACK|putback|PUT_BITMAP|put_bitmap|RANDOMIZE|randomize|RBOX|rbox|READ|read|RECEIVE|receive|RELSEEK|relseek|RESTORE|restore|ROOTWINDOW|rootwindow|RSRC_FREE|rsrc_free|RSRC_LOAD|rsrc_load|RUN|run|SAVE|save|SAVESCREEN|savescreen|SAVEWINDOW|savewindow|SCOPE|scope|SEEK|seek|SEND|send|SETFONT|setfont|SETMOUSE|setmouse|SGET|sget|SHM_DETACH|shm_detach|SHM_FREE|shm_free|SHOWPAGE|showpage|SIZEW|sizew|SORT|sort|SOUND|sound|SPLIT|split|SPUT|sput|SUB|sub|SWAP|swap|SYSTEM|system|TEXT|text|TINEMONITOR|tinemonitor|TINEPUT|tineput|TINESET|tineset|TITLEW|titlew|UNLINK|unlink|USEWINDOW|usewindow|VERSION|version|VOID|void|VSYNC|vsync|WORT_SEP|wort_sep|XLOAD|xload|XRUN|xrun|csput|csset|\\?)>":::Text Key::\n\
SYSVARS:"<(ROWS|rows|CCS_ERR|ccs_err|COLS|cols|MOUSEK|mousek|MOUSEX|mousex|MOUSEY|mousey|MOUSES|mouses|TRUE|FALSE|true|false|crscol|CRSCOL|CRSLIN|crslin|CTIMER|ctimer|TIMER|timer|STIMER|stimer|ERR|err|DATE$|TIME$|date\\$|time\\$|TERMINALNAME$|terminalname\\$|INKEY$|inkey\\$|PI|pi|PC|SP|pc|sp)>":::Flag::\n\
Keyword2:"<(ADD|add|AFTER|after|ALERT|alert|ARRAYCOPY|arraycopy|ARRAYFILL|arrayfill|BEEP|beep|BELL|bell|BGET|bget|BLOAD|bload|BMOVE|bmove|BOX|box|BPUT|bput|BSAVE|bsave|CALL|call|CASE|case|CHAIN|chain|CIRCLE|circle|CLEAR|clear|CLEARW|clearw|CLOSE|close|CLOSEW|closew|CLR|clr|CLS|cls|COLOR|color|CONNECT|connect|COPYAREA|copyarea|DEC|dec|DEFFILL|deffill|DEFLINE|defline|DEFMARK|defmark|DEFMOUSE|defmouse|DEFTEXT|deftext|DIM|dim|DIV|div|DPOKE|dpoke|DRAW|draw|DUMP|dump|EDIT|edit|ELIPSE|elipse|ELLIPSE|ellipse|ERASE|erase|ERROR|error|EVENT|event|EVERY|every|EXEC|exec|FFT|fft|FILESELECT|fileselect|FIT|fit|FIT_LINEAR|fit_linear|FLUSH|flush|FREE|free|GET|get|GPRINT|gprint|GRAPHMODE|graphmode|CLIP|clip|HELP|help|HOME|home|INC|inc|INFOW|infow|INPUT|input|KEYEVENT|keyevent|LINE|line|LINEINPUT|lineinput|LINK|link|LIST|list|LOAD|load|LPOKE|lpoke|LTEXT|ltext|MERGE|merge|MENU|menu|MENUDEF|menudef|MENUKILL|menukill|MENUSET|menuset|MOUSE|mouse|MOUSEEVENT|mouseevent|MOTIONEVENT|motionevent|MOVEW|movew|MUL|mul|NEW|new|NOOP|noop|NOP|nop|NOROOTWINDOW|norootwindow|OPEN|open|OPENW|openw|OUT|out|PAUSE|pause|PBOX|pbox|PCIRCLE|pcircle|PELIPSE|pelipse|PELLIPSE|pellipse|PLIST|plist|PLOT|plot|POKE|poke|POLYFILL|polyfill|POLYLINE|polyline|POLYMARK|polymark|PRBOX|prbox|PRINT|print|PUT|put|PUTBACK|putback|PUT_BITMAP|put_bitmap|RANDOMIZE|randomize|RBOX|rbox|READ|read|RECEIVE|receive|RELSEEK|relseek|RESTORE|restore|ROOTWINDOW|rootwindow|RSRC_FREE|rsrc_free|RSRC_LOAD|rsrc_load|RUN|run|SAVE|save|SAVESCREEN|savescreen|SAVEWINDOW|savewindow|SCOPE|scope|SEEK|seek|SEND|send|SETFONT|setfont|SETMOUSE|setmouse|SGET|sget|SHM_DETACH|shm_detach|SHM_FREE|shm_free|SHOWPAGE|showpage|SIZEW|sizew|SORT|sort|SOUND|sound|SPLIT|split|SPUT|sput|SUB|sub|SWAP|swap|SYSTEM|system|TEXT|text|TINEBROADCAST|tinebroadcast|TINECYCLE|tinecycle|TINELISTEN|tinelisten|TINEMONITOR|tinemonitor|TINEPUT|tineput|TINESERVER|tineserver|TINESET|tineset|TITLEW|titlew|UNLINK|unlink|USEWINDOW|usewindow|VERSION|version|VOID|void|VSYNC|vsync|WORT_SEP|wort_sep|XLOAD|xload|XRUN|xrun|csput|csset|\\?)>":::Text Key::\n\
Keyword:"<(TRON|TROFF|tron|troff|BREAK|break|STOP|stop|CONT|cont|DEFAULT|default|DO|do|EXIT|exit|GOSUB|gosub|GOTO|goto|IF|if|ELSE|else|ENDIF|endif|WHILE|while|WEND|wend|REPEAT|repeat|UNTIL|until|DO|do|LOOP|loop|DEFFN|deffn|FUNCTION|function|PROCEDURE|procedure|PROGRAM|program|RETURN|return|ENDFUNC|endfunc|ENDFUNCTION|endfunction|for|FOR|next|NEXT|END|end|echo|ECHO|ON|OFF|on|off|quit|QUIT|TO|to|step|STEP|SWITCH|switch|CASE|case|SELECT|select|ENDSELECT|endselect)>":::Keyword::\n\
Numbers:"#[0-9]*":::String2::\n\
sysfunctions:"(ABS|abs|ACOS|acos|ACOSH|acosh|ARRPTR|arrptr|ASC|asc|ASIN|asin|ASINH|asinh|ATAN|atan|ATAN2|atan2|ATANH|atanh|ATN|atn|BCHG|bchg|BCLR|bclr|BSET|bset|BTST|btst|CBRT|cbrt|CEIL|ceil|COS|cos|COSH|cosh|CVD|cvd|CVF|cvf|CVI|cvi|CVL|cvl|CVS|cvs|DEG|deg|DIM\\?|dim\\?|DPEEK|dpeek|EVEN|even|EXEC|exec|EXIST|exist|EXP|exp|EXPM1|expm1|FAK|fak|FIX|fix|FLOOR|floor|FORK|fork|FORM_ALERT|form_alert|FORM_CENTER|form_center|FORM_DIAL|form_dial|FORM_DO|form_do|FRAC|frac|GASDEV|gasdev|GET_COLOR|get_color|GLOB|glob|GRAY|gray|HYPOT|hypot|INP|inp|INP\\?|inp\\?|INSTR|instr|INT|int|JULIAN|julian|LEN|len|LN|ln|LOG|log|LOG10|log10|LOG1P|log1p|LOGB|logb|LPEEK|lpeek|LTEXTLEN|ltextlen|MALLOC|malloc|MAX|max|MIN|min|MOD|mod|OBJC_DRAW|objc_draw|OBJC_FIND|objc_find|ODD|odd|PEEK|peek|POINT|point|PRED|pred|RAD|rad|RAND|rand|RANDOM|random|REALLOC|realloc|RINSTR|rinstr|RND|rnd|ROUND|round|RSRC_GADDR|rsrc_gaddr|SGN|sgn|SHM_ATTACH|shm_attach|SHM_MALLOC|shm_malloc|SIN|sin|SINH|sinh|SQR|sqr|SQRT|sqrt|SRAND|srand|SUCC|succ|SYM_ADR|sym_adr|TAN|tan|TANH|tanh|TINEGET|tineget|TINEMAX|tinemax|TINEMIN|tinemin|TINESIZE|tinesize|TINETYP|tinetyp|TRUNC|trunc|TYP\\?|typ\\?|VAL|val|VARPTR|varptr|WORT_SEP|wort_sep|BIN\\$|bin\\$|CHR\\$|chr\\$|ENV\\$|env\\$|ERR\\$|err\\$|HEX\\$|hex\\$|INLINE\\$|inline\\$|INPUT\\$|input\\$|JULDATE\\$|juldate\\$|LEFT\\$|left\\$|LINEINPUT\\$|lineinput\\$|LOWER\\$|lower\\$|MID\\$|mid\\$|MKD\\$|mkd\\$|MKF\\$|mkf\\$|MKI\\$|mki\\$|MKL\\$|mkl\\$|MKS\\$|mks\\$|OCT\\$|oct\\$|PARAM\\$|param\\$|PRG\\$|prg\\$|REPLACE\\$|replace\\$|RIGHT\\$|right\\$|SPACE\\$|space\\$|STR\\$|str\\$|STRING\\$|string\\$|SYSTEM\\$|system\\$|TERMINALNAME\\$|terminalname\\$|TRIM\\$|trim\\$|UCASE\\$|ucase\\$|UNIXDATE\\$|unixdate\\$|UNIXTIME\\$|unixtime\\$|UPPER\\$|upper\\$|XTRIM\\$|xtrim\\$|csget|csget\\$|lof|LOF|EOF|eof)":::Storage Type::\n\
sysfunctions:"(ABS|abs|ACOS|acos|ACOSH|acosh|ARRPTR|arrptr|ASC|asc|ASIN|asin|ASINH|asinh|ATAN|atan|ATAN2|atan2|ATANH|atanh|ATN|atn|BCHG|bchg|BCLR|bclr|BSET|bset|BTST|btst|CBRT|cbrt|CEIL|ceil|COS|cos|COSH|cosh|CVD|cvd|CVF|cvf|CVI|cvi|CVL|cvl|CVS|cvs|DEG|deg|DIM\\?|dim\\?|DPEEK|dpeek|EVEN|even|EXEC|exec|EXIST|exist|EXP|exp|EXPM1|expm1|FAK|fak|FIX|fix|FLOOR|floor|FORK|fork|FORM_ALERT|form_alert|FORM_CENTER|form_center|FORM_DIAL|form_dial|FORM_DO|form_do|FRAC|frac|GASDEV|gasdev|GET_COLOR|get_color|GLOB|glob|GRAY|gray|HYPOT|hypot|INP|inp|INP\\?|inp\\?|INSTR|instr|INT|int|JULIAN|julian|LEN|len|LN|ln|LOG|log|LOG10|log10|LOG1P|log1p|LOGB|logb|LPEEK|lpeek|LTEXTLEN|ltextlen|MALLOC|malloc|MAX|max|MIN|min|MOD|mod|OBJC_DRAW|objc_draw|OBJC_FIND|objc_find|ODD|odd|PEEK|peek|POINT|point|PRED|pred|RAD|rad|RAND|rand|RANDOM|random|REALLOC|realloc|RINSTR|rinstr|RND|rnd|ROUND|round|RSRC_GADDR|rsrc_gaddr|SGN|sgn|SHM_ATTACH|shm_attach|SHM_MALLOC|shm_malloc|SIN|sin|SINH|sinh|SQR|sqr|SQRT|sqrt|SRAND|srand|SUCC|succ|SYM_ADR|sym_adr|TAN|tan|TANH|tanh|TINEGET|tineget|TINEMAX|tinemax|TINEMIN|tinemin|TINESIZE|tinesize|TINETYP|tinetyp|TRUNC|trunc|TYP\\?|typ\\?|VAL|val|VARPTR|varptr|WORT_SEP|wort_sep|BIN\\$|bin\\$|CHR\\$|chr\\$|ENV\\$|env\\$|ERR\\$|err\\$|HEX\\$|hex\\$|INLINE\\$|inline\\$|INPUT\\$|input\\$|JULDATE\\$|juldate\\$|LEFT\\$|left\\$|LINEINPUT\\$|lineinput\\$|LOWER\\$|lower\\$|MID\\$|mid\\$|MKD\\$|mkd\\$|MKF\\$|mkf\\$|MKI\\$|mki\\$|MKL\\$|mkl\\$|MKS\\$|mks\\$|OCT\\$|oct\\$|PARAM\\$|param\\$|PRG\\$|prg\\$|REPLACE\\$|replace\\$|RIGHT\\$|right\\$|SPACE\\$|space\\$|STR\\$|str\\$|STRING\\$|string\\$|SYSTEM\\$|system\\$|TERMINALNAME\\$|terminalname\\$|TRIM\\$|trim\\$|UCASE\\$|ucase\\$|UNIXDATE\\$|unixdate\\$|UNIXTIME\\$|unixtime\\$|UPPER\\$|upper\\$|XTRIM\\$|xtrim\\$|csget|csget\\$|lof|LOF|EOF|eof|IOCTL|ioctl)":::Storage Type::\n\
Label:"[0-9a-zA-Z]*:":::Label::\n\
}
nedit.languageModes: \
......
all : xbc.txt
clean :
rm -f xbc.html xbc.txt x11basic.html x11basic.txt
xbc.html : xbc.1
groff -mandoc -Thtml xbc.1 > xbc.html
xbc.txt : xbc.1
groff -mandoc -Tlatin1 xbc.1 > xbc.txt
x11basic.html : x11basic.1
groff -mandoc -Thtml x11basic.1 > x11basic.html
x11basic.txt : x11basic.1
groff -mandoc -Tlatin1 x11basic.1 > x11basic.txt
bas2x11basic.html : bas2x11basic.1
groff -mandoc -Thtml bas2x11basic.1 > bas2x11basic.html
bas2x11basic.txt : bas2x11basic.1
groff -mandoc -Tlatin1 bas2x11basic.1 > bas2x11basic.txt
This diff is collapsed.
' Seltsamer Attraktor von Henon
mmm=10000
dim dx(mmm)
dim dy(mmm)
schwarz=get_color(0,0,0)
weiss=get_color(65535,65535,65535)
clearw
x=0.5
y=0.5
c=0
color weiss
for c=0 to mmm
ox=x
x=y+1-1.4*x^2
y=0.3*ox
dx(c)=x
dy(c)=y
next c
sx=320
sy=200
px=320
py=200
do
clearw
scope dy(),dx(),1,sy,py,sx,px
vsync
mouseevent ox,oy,ok
print ok
if ok
if ok=4
sub py,16
else if ok=5
add py,16
else
motionevent
mouse x,y,k
if k=2 and abs(x-ox)<10 and abs(y=oy)<10
add sx,x-ox
add sy,y-oy
else if k=1 and abs(x-ox)<10 and abs(y=oy)<10
add px,x-ox
add py,y-oy
endif
endif
endif
loop
......@@ -59,9 +59,15 @@ CSRC= $(DISTOBJS:.o=.c)
DISTCSRC=$(DISTOBJS:.o=.c)
DEPSRC= $(CSRC)
DIST= README INSTALL COPYING install.sh doc/man-pages/* doc/ACKNOWLEGEMENTS \
# Headerfiles which should be added to the distribution
HSRC= defs.h file.h functions.h gkommandos.h globals.h kommandos.h \
options.h protos.h xbasic.h window.h vtypes.h ptypes.h
DIST= README INSTALL COPYING install.sh doc/man-pages/*.1 doc/ACKNOWLEGEMENTS \
doc/AUTHORS doc/HISTORY doc/RELEASE_NOTES doc/X11-Basic-manual.txt \
doc/editors/* \
doc/editors/* \
src/xbasic.c \
src/file.c \
src/main.c \
......@@ -104,6 +110,8 @@ DIST2=$(DISTOBJS:.o=.c)
DIR=X11Basic-@version@
DIR2=X11Basic-src-@version@
TINEDIR=tinexbasic-@version@
TINEDIST=$(DIST) doc/tine-xbasic.html examples2/DESY/*
LINKFLAGS =
WINLINKFLAGS =
......@@ -138,6 +146,14 @@ static : x11basic.a main.o
$(CC) $(OPT) $(LINKFLAGS) -o xbasic.static main.o x11basic.a\
$(LIBS) $(XLIBS)
strip xbasic.static
xbasic.staticreadline : x11basic.a main.o
$(CC) $(OPT) $(LINKFLAGS) -o $@ main.o x11basic.a\
/usr/lib/libreadline.a -ldl -lm -lncurses -lX11 $(XLIBS)
strip $@
tinexbasic.rs : $(OBJS) $(AOBJS)
$(CC) -DTINE $(OPT) $(LINKFLAGS) -o $@ $(AOBJS) \
/usr/lib/libreadline.a /usr/lib/libtine.a -ldl -lm -lncurses -lX11 $(XLIBS)
strip $@
psydo : psydo.o lib
$(CC) $(OPT) -L. $(LINKFLAGS) -o a.out psydo.o \
$(LIBS)-lx11basic $(XLIBS)
......@@ -169,20 +185,24 @@ tineexe: $(OBJS) main.o mathematics.o
$(WINCC) -DTINE -DWINDOWS -c $(DIST2)
$(WINCC) -DTINE -DWINDOWS $(OPT) $(WINLINKFLAGS) -o tinexbasic.exe $(DISTOBJS) \
Windows.extension/fnmatch.o Windows.extension/memfrob.o rpclib.lib $(TINEWINLIBS)
tinexbasicdyn : $(OBJS) main.o mathematics.o
$(CC) -DTINE $(LINKFLAGS) -o tinexbasic.dyn $(AOBJS) \
$(LIBS) -ltine $(XLIBS)
strip tinexbasic.dyn
xbasic : $(DISTOBJS)
$(CC) $(OPT) $(LINKFLAGS) -o xbasic $(DISTOBJS) \
$(CC) $(OPT) $(LINKFLAGS) -o $@ $(DISTOBJS) \
$(LIBS) $(XLIBS)
strip xbasic
strip $@
csxbasic : $(OBJS)
$(CC) -DCONTROL $(OPT) $(LINKFLAGS) -o csxbasic $(AOBJS) \
$(LIBS) $(XLIBS)
tinexbasic : $(OBJS) main.o mathematics.o
$(CC) -DTINE $(OPT) $(LINKFLAGS) -o tinexbasic $(AOBJS) \
$(CC) -DTINE $(OPT) $(LINKFLAGS) -o $@ $(AOBJS) \
$(LIBS) $(CCSLIBS) $(XLIBS)
strip tinexbasic
strip $@
lib : $(LIBOBJS)
$(CC) -shared -o libx11basic.so $(LIBOBJS)
winlib : x11basic.lib
......@@ -192,26 +212,26 @@ tlib : $(LIBOBJS)
$(CC) $(OPT) $(LINKFLAGS) -shared -o libtinex11basic.so $(LIBOBJS) $(CCSLIBS)
x11basic.a : $(LIBOBJS)
ar -ru x11basic.a $(LIBOBJS)
ar -ru $@ $(LIBOBJS)
x11basic.lib : clean
$(WINCC) -DWINDOWS -c $(DIST2)
$(WINCC) -DWINDOWS -c mathematics.c
i686-pc-mingw32-ar -ru x11basic.lib $(WINLIBOBJS)
i686-pc-mingw32-ar -ru $@ $(WINLIBOBJS)
tx11basic.a : $(LIBOBJS)
ar -ru tx11basic.a $(LIBOBJS) $(CCSLIBS)
ar -ru $@ $(LIBOBJS) $(CCSLIBS)
dyn : lib main.o
$(CC) -L. $(LINKFLAGS) -o xbasic.dyn main.o \
$(LIBS) -lx11basic $(XLIBS)
strip xbasic.dyn
xbc : dyn
xbasic.dyn ../examples/compiler/xbc.bas --dynamic -o xbc
strip xbc
xbasic.dyn ../examples/compiler/xbc.bas --dynamic -o $@
strip $@
bas2x11basic : xbc
xbc ../examples/compiler/bas2x11basic.bas --dynamic -o bas2x11basic
strip bas2x11basic
xbc ../examples/compiler/bas2x11basic.bas --dynamic -o $@
strip $@
myzip : xbc
xbc ../examples2/utils/myzip.bas --dynamic -o myzip
xbc ../examples2/utils/myunzip.bas --dynamic -o myunzip
......@@ -250,12 +270,37 @@ dist : $(DIST2)
mkdir /tmp/$(DIR)
(cd ..; tar cf - $(DIST))|(cd /tmp/$(DIR); tar xpf -)
(cd /tmp; tar cf - $(DIR)|gzip -9 > $(DIR).tar.gz)
tinedist : $(DIST2)
rm -rf /tmp/$(TINEDIR)
mkdir /tmp/$(TINEDIR)
(cd ..; tar cf - $(TINEDIST))|(cd /tmp/$(TINEDIR); tar xpf -)
(cd /tmp; tar cf - $(TINEDIR)|gzip -9 > $(TINEDIR).tar.gz)
rpm : dist
cp /tmp/$(DIR).tar.gz /usr/src/packages/SOURCES/
rpm -ba --clean x11basic.spec
rpm2 : dist
cp /tmp/$(DIR).tar.gz /usr/src/packages/SOURCES/
rpmbuild -ba --clean x11basic.spec
tinerpm : tinedist
cp /tmp/$(TINEDIR).tar.gz /usr/src/packages/SOURCES/$(TINEDIR).tar.gz
rpmbuild -ba --clean tinexbasic.spec
# create DSL package (for Damn Small Linux MyDSL)
dslpackage : xbasic.staticreadline
(cd /dev/shm; mkdir -p home/dsl/.xtdesktop)
convert Windows-Installer/x11basic.ico /dev/shm/home/dsl/.xtdesktop/x11basic.png
echo "table Icon" > /dev/shm/home/dsl/.xtdesktop/x11basic.lnk
echo " Type: Program" >> /dev/shm/home/dsl/.xtdesktop/x11basic.lnk
echo " Caption: X11Basic" >> /dev/shm/home/dsl/.xtdesktop/x11basic.lnk
echo " Command: aterm -e /opt/X11Basic-@version@/xbasic" >> /dev/shm/home/dsl/.xtdesktop/x11basic.lnk
echo " Icon: .xtdesktop/x11basic.png" >> /dev/shm/home/dsl/.xtdesktop/x11basic.lnk
echo " X: 405" >> /dev/shm/home/dsl/.xtdesktop/x11basic.lnk
echo " Y: 25" >> /dev/shm/home/dsl/.xtdesktop/x11basic.lnk
echo "end" >> /dev/shm/home/dsl/.xtdesktop/x11basic.lnk
(cd /dev/shm; mkdir -p opt/X11Basic-@version@)
cp xbasic.staticreadline /dev/shm/opt/X11Basic-@version@/xbasic
(cd /dev/shm; tar czf X11Basic.tar.gz home/dsl/.xtdesktop/x11basic* opt/X11Basic-@version@)
mv /dev/shm/X11Basic.tar.gz .
(md5sum X11Basic.tar.gz > X11Basic.tar.gz.md5.txt )
check : xbasic
./xbasic -e version
depend : $(DEPSRC)
......
This diff is collapsed.
......@@ -100,6 +100,9 @@
/* readline in readline */
#undef HAVE_READLINE
/* _SystemCycle in dynamical TINE lib */
#undef HAVE_TINE
/* Define to 1 if you have the `select' function. */
#undef HAVE_SELECT
......
This diff is collapsed.
......@@ -137,6 +137,8 @@ AC_CHECK_LIB([curses], [main], libs="$libs -lcurses")
AC_CHECK_LIB([ncurses], [main], libs="$libs -lncurses")
# `-lx11basic':
#AC_CHECK_LIB([x11basic], [programmlauf],,,[$X_LIBS -lX11 -lm])
# `-ltine':
AC_CHECK_LIB([tine], [_SystemCycle],AC_DEFINE(HAVE_TINE,1,[_SystemCycle in dynamical TINE lib]),,[ -lm])
# `-lvgagl -lvga':
AC_CHECK_LIB([vga], [main],vgalibs="-lvgagl -lvga",,[$VGA_LIBS])
......
......@@ -9,6 +9,7 @@
*/
#include <stdio.h>
#include <stdlib.h>
#include "defs.h"
#ifdef HAVE_READLINE
#include <readline/readline.h>
......
......@@ -6,6 +6,7 @@
* COPYING for details
*/
#include "options.h"
#include <stdio.h>
const char *errortxt[] = {
#ifdef GERMAN
......@@ -186,7 +187,7 @@ const char *errortxt[] = {
/* a*/ "Error 97",
/* 98*/ "Error 98",
/* 99*/ "Error 99",
/* 100*/ "X11-BASIC Version 1.13 Copyright (c) 1997-2006 Markus Hoffmann",
/* 100*/ "X11-BASIC Version 1.13 Copyright (c) 1997-2007 Markus Hoffmann",
/* e*/ "** 1 - Segmentation fault : Speicherschutzverletzung",
/* f*/ "** 2 - Bus Error Peek/Poke falsch?",
/* g*/ "** 3 - Adress error Ungerade Wort-Adresse! Dpoke/Dpeek, Lpoke/Lpeek?",
......
......@@ -19,6 +19,7 @@ int f_crc (PARAMETER *,int);
int f_gray (int);
int f_julian (STRING);
int f_ioctl (PARAMETER *,int);
STRING f_chrs (int);
STRING f_spaces (int);
......
......@@ -335,20 +335,17 @@ int init_sockaddr(struct sockaddr_in *name,const char *hostname, unsigned short
connect socket to server and port */
void c_connect(PARAMETER *plist,int e) {
FILE *fff;
struct sockaddr_in host_address;
int host_address_size;
unsigned char *address_holder;
if(e>=2) {
int sock;
fff=get_fileptr(plist[0].integer);
if(fff==NULL) {error(24,"");return;} /* File nicht geoeffnet */
sock=fileno(fff);
if(init_sockaddr(&host_address,plist[1].pointer,plist[2].integer)<0) io_error(errno,"init_sockadr");
else {
if(0>connect(sock,(struct sockaddr *) &host_address, sizeof(host_address)))
io_error(errno,"connect");
}
int sock;
FILE *fff=get_fileptr(plist[0].integer);
if(fff==NULL) {error(24,"");return;} /* File nicht geoeffnet */
sock=fileno(fff);
if(init_sockaddr(&host_address,plist[1].pointer,plist[2].integer)<0) io_error(errno,"init_sockadr");
else {
if(0>connect(sock,(struct sockaddr *) &host_address, sizeof(host_address)))
io_error(errno,"connect");
}
}
int make_socket(unsigned short int port) {
......@@ -955,48 +952,40 @@ void c_unget(char *n) {
void c_flush(PARAMETER *plist,int e) {
FILE *fff=stdout;
int i;
if(e) {
i=plist[0].integer;
if(filenr[i]) fff=dptr[i];
else {error(24,"");return;} /* File nicht geoeffnet */
}
if(e) fff=get_fileptr(plist[0].integer);
if(fff==NULL) {error(24,"");return;} /* File nicht geoeffnet */
if(fflush(fff)) io_error(errno,"FLUSH");
}
void c_seek(PARAMETER *plist,int e) {
if(e>=1) {
int j=0,i=plist[0].integer;
if(e>1) j=plist[1].integer;
if(filenr[i]) {
if(fseek(dptr[i],j,SEEK_SET)) io_error(errno,"SEEK");
} else error(24,""); /* File nicht geoeffnet */
}
int j=0,i=plist[0].integer;
if(e>1) j=plist[1].integer;
if(filenr[i]) {
if(fseek(dptr[i],j,SEEK_SET)) io_error(errno,"SEEK");
} else error(24,""); /* File nicht geoeffnet */
}
void c_relseek(PARAMETER *plist,int e) {
if(e==2) {
int i=plist[0].integer;
if(filenr[i]) {
if(fseek(dptr[i],plist[1].integer,SEEK_CUR)) io_error(errno,"RELSEEK");
} else error(24,""); /* File nicht geoeffnet */
}
int i=plist[0].integer;
if(filenr[i]) {
if(fseek(dptr[i],plist[1].integer,SEEK_CUR)) io_error(errno,"RELSEEK");
} else error(24,""); /* File nicht geoeffnet */
}
int inp8(char *n) {
int fp,i=get_number(n);
char ergebnis;
FILE *fff=get_fileptr(i);
int inp8(PARAMETER *plist,int e) {
unsigned char ergebnis;
FILE *fff=get_fileptr(plist[0].integer);
if(fff==NULL) {error(24,"");return(-1);} /* File nicht geoeffnet */
fread(&ergebnis,1,1,fff);
return((int)ergebnis);
}
int inpf(char *n) {
int fp,i=get_number(n);
FILE *fff=stdin;
if(i==-2) {
return(kbhit() ? -1 : 0);
} else if(filenr[i]) {
fff=dptr[i];
int inpf(PARAMETER *plist,int e) {
if(plist[0].integer==-2) return(kbhit() ? -1 : 0);
else {
FILE *fff=get_fileptr(plist[0].integer);
#ifndef WINDOWS
int fp,i;
#endif
if(fff==NULL) {error(24,"");return(-1);} /* File nicht geoeffnet */
fflush(fff);
#ifndef WINDOWS
fp=fileno(fff);
......@@ -1004,22 +993,20 @@ int inpf(char *n) {
return(i);
#else
return(((eof(fff)) ? 0 : -1));
#endif
} else {error(24,"");return(-1);} /* File nicht geoeffnet */
#endif
}
}
int inp16(char *n) {
int i=get_number(n);
short ergebnis;
FILE *fff=get_fileptr(i);
int inp16(PARAMETER *plist,int e) {
unsigned short ergebnis;
FILE *fff=get_fileptr(plist[0].integer);
if(fff==NULL) {error(24,"");return(-1);} /* File nicht geoeffnet */
fread(&ergebnis,sizeof(short),1,fff);
return((int)ergebnis);
}
int inp32(char *n) {
int i=get_number(n);
int inp32(PARAMETER *plist,int e) {
unsigned int ergebnis;
FILE *fff=get_fileptr(i);
if(fff==NULL) {error(24,"");return(-1);} /* File nicht geoeffnet */
FILE *fff=get_fileptr(plist[0].integer);
if(fff==NULL) {error(24,"");return(-1);} /* File nicht geoeffnet */
fread(&ergebnis,sizeof(long),1,fff);
return(ergebnis);
}
......@@ -1061,31 +1048,27 @@ void reset_input_mode() {
/* Dynamisches Linken von Shared-Object-Files */
int f_symadr(char *n) {
char v[strlen(n)+1],w[strlen(n)+1];
int e=wort_sep(n,',',TRUE,v,w);
int f_symadr(PARAMETER *plist,int e) {
int adr=0;
if(e>1) {
int i=get_number(v);
if(filenr[i]==2) {
char *sym=s_parser(w);
char *derror;
#ifdef WINDOWS
adr = (int)GetProcAddress(dptr[i],sym);
if(filenr[plist[0].integer]==2) {
char *sym=malloc(plist[1].integer+1);
char *derror;
memcpy(sym,plist[1].pointer,plist[1].integer);
sym[plist[1].integer]=0;
#ifdef WINDOWS
adr = (int)GetProcAddress(dptr[plist[0].integer],sym);
if (adr==0) printf("ERROR: SYM_ADR: %s\n",GetLastError());
#else
#else
#ifdef HAVE_DLOPEN
adr = (int)dlsym(dptr[i],sym);
adr = (int)dlsym(dptr[plist[0].integer],sym);
if ((derror = (char *)dlerror()) != NULL) printf("ERROR: SYM_ADR: %s\n",derror);
#else
adr=-1;
error(9,"SYM_ADR"); /*Function or command %s not implemented*/
adr=-1;
error(9,"SYM_ADR"); /*Function or command %s not implemented*/
#endif
#endif
free(sym);
} else error(24,v); /* File nicht geoeffnet */
} else error(32,"SYM_ADR"); /* Syntax error */
#endif
free(sym);
} else error(24,""); /* File nicht geoeffnet */
return(adr);
}
......@@ -1100,6 +1083,8 @@ char *terminalname(int fp) {
return(erg);
}
void c_out(char *n) {
char v[strlen(n)+1],w[strlen(n)+1];
int e=wort_sep(n,',',TRUE,v,w);
......@@ -1154,14 +1139,11 @@ void c_out(char *n) {
#ifndef WINDOWS
/* kbhit-Funktion */
int kbhit() {
fd_set set;
#ifdef TIMEVAL_WORKAROUND
struct {
int tv_sec;
int tv_usec;
} tv;
struct { int tv_sec;
int tv_usec; } tv;
#else
struct timeval tv;
#endif
......@@ -1384,3 +1366,19 @@ void speaker(int frequency) {
if (fd>2) close(fd); /* console */
#endif
}
int f_ioctl(PARAMETER *plist,int e) {
FILE *fff;
int ret=0;
if(e>=2) {
int sock;
fff=get_fileptr(plist[0].integer);
if(fff==NULL) {error(24,"");return;} /* File nicht geoeffnet */
sock=fileno(fff);
if (e==2) ret=ioctl(sock,plist[1].integer);
else ret=ioctl(sock,plist[1].integer,(void *)plist[2].integer);
if(ret==-1) io_error(errno,"ioctl");
}
return(ret);
}
......@@ -1231,11 +1231,11 @@ void c_inc(PARAMETER *plist,int e) {
if(plist[0].integer&FLOATTYP)
*((double *)plist[0].pointer)=*((double *)plist[0].pointer)+1;
else if(plist[0].integer&INTTYP)
#ifdef __hpux
*((int *)plist[0].pointer)=*((int *)plist[0].pointer)+1;
#else
*((int *)plist[0].pointer)++;
#endif
//#ifdef __hpux
// *((int *)plist[0].pointer)=*((int *)plist[0].pointer)+1;
//#else
(*((int *)plist[0].pointer))++;
//#endif
}
}
......@@ -1244,11 +1244,11 @@ void c_dec(PARAMETER *plist,int e) {
if(plist[0].integer&FLOATTYP)
*((double *)plist[0].pointer)=*((double *)plist[0].pointer)-1;
else if(plist[0].integer&INTTYP)
#ifdef __hpux
*((int *)plist[0].pointer)=*((int *)plist[0].pointer)-1;
#else
*((int *)plist[0].pointer)--;
#endif
// #ifdef __hpux
// *((int *)plist[0].pointer)=*((int *)plist[0].pointer)-1;
// #else
(*((int *)plist[0].pointer))--;
// #endif
}
}
void c_cls(char *n) {
......@@ -1286,7 +1286,7 @@ void c_home(char *n) {
puts("\033[H");
#endif
}
void c_version(char *n) { printf("X11-BASIC Version: %s vom %s \n",version,vdate);}
void c_version(char *n) { printf("X11-BASIC Version: %s %s\n",version,vdate);}
#ifndef WINDOWS
#include <fnmatch.h>
......@@ -1394,15 +1394,15 @@ void c_detatch(char *w) {
void c_shm_free(PARAMETER *plist,int e) {
shm_free((char *)plist[0].integer);
}
void c_pause(char *w) {
void c_pause(PARAMETER *plist,int e) {
#ifdef WINDOWS
sleep((int)(1000*parser(w)));
sleep((int)(1000*plist[0].real));
#else
int dummy,i=0;
dummy=(int)(1000000*parser(w));
while(dummy>=1000000) {i++;dummy-=1000000;}
double zeit=plist[0].real;
int i=(int)zeit;
if(i) sleep(i);
if(dummy>0) usleep(dummy);
zeit=zeit-(double)i;
if(zeit>0) usleep((int)(1000000*zeit));
#endif
}
......
......@@ -57,8 +57,8 @@ void c_objc_add (PARAMETER *,int);
void c_objc_delete (PARAMETER *,int);
void c_on(char *);
void c_onbreak(char *);
void c_pause (char *);
void c_poke (PARAMETER *,int);
void c_pause (PARAMETER *,int);
void c_poke (PARAMETER *,int);
void c_print (char *);
void c_quit (PARAMETER *,int);
void c_receive (PARAMETER *,int);
......