ScriptBasic development auxilliarry files

by Peter Verhas

Table of Contents

[Contents]

1. Introduction

This documentation describes some of the auxiliary files that were created and are used in the ScriptBasic project. These are UNIX shell scripts, Windows NT command files, Perl programs that ease the maintenance of the developers and automate such tasks as creating a new build.

It is not the intention of the creator of this document to have anyone to read this documentation throughly and to learn its content. This is rather a reference book that helps to understand, which file implements which tool and how to invoke them.

But I do not try to prevent you to read it in case you want.

[Contents]

2. Directory Structure

ScriptBasic is usually developed on a Windows 2000 Professional workstation. Linux is used to test the portability. Files are uploaded via SMB and GNU command line tools are used to build the binaries.

The source of ScriptBasic on the development station is `\MyProjects\sb\source'.

The actual location of the source code root should not affect the building of the source.

The directory structure of the source under this directory is the following:

--- ScriptBasic core C source files,
    def files, command files,
    shell scripts, Perl scripts

commands --- all C source files that implement ScriptBasic commands deb --- Debian package files deb/scriba --- temporary directory that is filled by the script mkdeb.sh when creating a Debian package deb/DEBIAN --- Debian package script files (source, these are copied into deb/scriba when building the package) examples --- example BASIC program files extensions --- module extension files extensions/berkeley_db --- Berkeley DB module extensions/cgi --- CGI module extensions/cio --- Console Input Output module only for Windows NT extensions/gd --- GD module to generate PNG graphics extensions/hash --- hash module extensions/japi --- Interface module to the graphics features of the Java AWT extensions/md5 --- md5 module extensions/mt --- Multi-thread support module with session, locks and global variables extensions/mysql --- MySQL interface extensions/noprint --- Example module that switches off printing extensions/nt --- Special Windows NT module extensions/re --- Regular Expression module extensions/tools --- Tools module extensions/trial --- Example module mainly for test purposes extensions/ux --- Special UNIX module extensions/zlib --- zlib compression module filesdoc --- auxilliary source file documentations gif --- banner.gif file html --- web page HTML source using the jamal preprocessor and ssplit.pl html/texi --- texi.jam documentation source files. Should be processed with jamal.pl first to get texi include --- BASIC include files for the modules preproc --- a sample preprocessor. Note that preprocessor is experimental and will change in future. test --- test programs tools --- tool programs variations --- different variations of ScriptBasic variations/apacmodu --- Apache module version of ScriptBasic. This variation was never developed and this thread of the development is stopped. Instead the httpd variation should be used together with the Apache web server. variations/httpd --- Standalone web server variation. variations/standalone --- Standalone version that allows BASIC compile to C and link together with the runtime environment. variations/standard --- The standard command line variation. variations/win32dll --- Win32dll version that allows embedding of the program into WIN32 applications. This thread of the development was stopped and is not supported anymore. There are plans to support similar variations. variations/winisapi --- Variation that executes web programs as ISAPI application. This version is not supported any more. Laster it may revitalized.

[Contents]

3. BASIC programs

In this chapter I list the BASIC programs that are used as utility programs. Note that the BASIC samples are documented in a separate document.

[Contents]

3.1. heber.bas

This BASIC program is an external preprocessor for ScriptBasic. This demonstrates how simple to write an external preprocessor, as it can even be done in BASIC itself.

This small program converts HTML Embedded BASIC (heb) into pure BASIC. HEB is something like PHP or Microsoft ASP BASIC, where the BASIC code is put between HTML code. This small preprocessor converts the heb file taking all HTML that is outside of the BASIC code and putting it into print statements, and all BASIC code that is inside HTML code putting outside.

This is a sample implementation and has significant shortages. In case the BASIC program inside some string has <% or >% (which is not likely though possible) the preprocessor crates false code.

The souce code of the file `heber.bas' is:

while  len(InputText) > 0
  StringPosition = InStr(InputText,"<%")
  if not IsDefined(StringPosition) then goto Finished
  AppendString = Mid@$(InputText,1,StringPosition-1)
  InputText = Mid@$(InputText,StringPosition+2)
  if len(AppendString) > 0 Then
    AppendString = Replace(AppendString,"\\","\\\\")
    AppendString = Replace(AppendString,"\"","\\\"")
    OutputText = OutputText & "print \"\"\"" & AppendString & "\"\"\"\n"
  end if
  StringPosition = InStr(InputText,"%>")
  if not IsDefined(StringPosition) then error(1)
  AppendString = Mid@$(InputText,1,StringPosition-1)
  InputText = Mid@$(InputText,StringPosition+2)
  if len(AppendString) > 0 then
    if Mid@$(AppendString,1,1) = "=" then
      AppendString = "print " & Mid@$(AppendString,2)
    end if
    OutputText = OutputText & AppendString & "\n"
  end if
wend
if len(InputText) > 0 then
  InputText = Replace(InputText,"\"","\\\"")
  OutputText = OutputText & "print \"\"\"" & InputText & "\"\"\"\n"
end if

[Contents]

3.2. newbuild.bas Start a new build

Whenever the development of a new build is started this program has to be executed. This will increase the build number stored in the file T<build.txt> and also creates the file `buildnum.c'

The souce code of the file `newbuild.bas' is:

on error goto FileOpenError
BuildNumber = Command()
if len(BuildNumber) > 0 then
  BuildNumber += 0
  goto BuildCalculated
endif
BuildCalculated:
fn = 0
FileToOpen = "build.txt"
Doing = "write"
open FileToOpen for output as fn
print#fn,BuildNumber
fn = 0
FileToOpen = "buildnum.h"
open FileToOpen for output as fn
This file was automatically created by newbuild.bas
Each time a new build is to be released this program
is ran and it increments the build number.
"""
close fn
#ifndef SCRIPTBASIC_BUILD
#define SCRIPTBASIC_BUILD """,BuildNumber,"""
#endif
*/
"""
fn = 0
FileToOpen = "pack.cmd"
Doing = "read"
s = t::LoadString(FileToOpen)
If re::m( s,"(.*)SET BUILD=([0-9]+)(.*)") then
  s = re::@$(1) & "SET BUILD=" & BuildNumber & re::@$(3)
  Doing = "write"
  t::SaveString FileToOpen,s
Else
  print "\npack.cmd does not contain build version\n"
Endif
stop

[Contents]

3.3. cbbfc.bas Convert Basic Binary Format Command

This program reads a ScriptBasic binary format file and replaces the leading interpreter specification by the one specified by the user.

For example a program was developed on a machine having scriba in the directory /usr/bin. The first line of the bbf file is then #!/usr/bin/scriba To run this bbf file without having the original source file on a machine having scriba on /usr/local/bin this first line has to be replaced. This is not a simple task, because the bbf file is binary.

The souce code of the file `cbbfc.bas' is:

cmdlin = command()
on error goto usage
if left(File@$,1) = "#" then
  i = 1
  while i < len(File@$) and mid(File@$,i,1) <> "\n"
    i = i+1
  wend
  if mid(File@$,i,1) = "\n" then
    File@$ = "#!" & Interpreter & mid(File@$,i,len(File@$))
  end if
  open FileName for output as 1
  binmode 1
  print#1,File@$
  close 1
end if
stop
usage:
print """Usage:

[Contents]

4. Batch (.CMD) files

These command files can be used to maintain the source files under Windows NT.

[Contents]

4.1. mkdoc.cmd

Create the on-line documentation

This batch file creates the on-line documentations

The souce code of the file `mkdoc.cmd' is:

[Contents]

4.2. mkcdoc.cmd

Create the command reference

This batch file creates the `command.html' file that contains the user reference documentation of the BASIC commands. The source of the documentation is maintained on the C source files that are in the directory `commands'. This way the reference documentation of a BASIC command is maintained together with the actual C code implementing the command.

The souce code of the file `mkcdoc.cmd' is:

[Contents]

4.3. install.cmd

This command file copies all the generated and documentation files into the root directory `\ScriptBasic' that belong to the final installation set under Win32.

The souce code of the file `install.cmd' is:

IF EXIST bin\vc7\exe\scriba.exe GOTO VC7INSTALL
IF EXIST bin\bcc\exe\scriba.exe GOTO BCCINSTALL
GOTO ENDLABEL
:BCCINSTALL
IF "%1" == "" GOTO BCCIPRD
bin\bcc\exe\scriba install.sb %1 bcc
GOTO ENDLABEL
:BCCIPRD
bin\bcc\exe\scriba install.sb T:\ScriptBasic bcc
GOTO ENDLABEL

[Contents]

4.4. makerrs.cmd

This command file creates the files `errcodes.c' and `errcodes.h' file from the file T<errors.def>. The file T<errors.def> contains the error messages in an easy to maintain and easy to read format. This bacth file using the Perl script `generrh.pl' creates the C source files for the error codes.

The souce code of the file `makerrs.cmd' is:

[Contents]

4.5. mkweb.cmd

This command file compiles the ScriptBasic web content. It has to be executed from the source root directory.

The souce code of the file `mkweb.cmd' is:

[Contents]

4.6. mksyntax.cmd

This command file runs the Perl script `syntaxer.pl' to create the `syntax.c' file from the file `syntax.def'

The syntax definition of the BASIC language is defined in an easy to maintain text file named `syntax.def' and a Perl script `syntaxer.pl' creates the human-unreadable C source file from it that contains all the tables that drive the syntax analyzer.

The souce code of the file `mksyntax.cmd' is:

[Contents]

4.7. precompile.cmd

This command file performs all the tasks that are needed before the C compilation of ScriptBasic can start. This is

The souce code of the file `precompile.cmd' is:

[Contents]

4.8. pack.cmd

This command file compiles all the ScriptBasic package for the Windows NT platform, copies the resulting files to the `\ScriptBasic' directory and creates the distribution ZIP files.

Before releasing a new release this batch file has to be edited to alter the %BUILD% variable for the actual build.

The souce code of the file `pack.cmd ' is:

[Contents]

4.9. mksamples.cms

This command file converts a .texi.jam file in the directory `./html/texi' using `jamal.pl' to .texi files and then converts it using the Perl script t2h.pl to html files into the directory `../html/texi'. The command also starts TeX to convert the texi file to dvi, ps and pdf as well as the Microsoft hhc help compiler to result compiled html file (chm).

Running Jamal may result several .bas files in the temporary directory. This command file puts them into a tgz archive and copies to the directory `html/texi'.

The command file deletes all auxiliary files when done.

The script has to be executed from the source directory and should get a single argument that is the name of the documentation file without any extension. For example

call mkth samplebas

This command is similar to mkth.com except that this file also cares the resulting BASIC sample files.

[Contents]

4.10. mkth.cmd

This command file converts a .texi.jam files in the directory `./html/texi' using `jamal.pl' to .texi files and then converts it using the Perl script t2h.pl to html files into the directory `../html/texi'. The command also starts TeX to convert the texi file to dvi, ps and pdf as well as the Microsoft hhc help compiler to result compiled html file (chm). The command file deletes all auxiliary files when done.

The script has to be executed from the source directory and should get a single argument that is the name of the documentation file without any extension. For example

call mkth auxfiles

will convert the file `auxfiles.texi.jam' (the source file for this text) to `auxfiles_toc.html' and `auxfiles_xxx.html' files in the appropriate html directory.

The command file mkath.cmd calls this command file for each .texi.jam file.

The souce code of the file `mkth.cmd' is:

perl ..\..\..\jamal.pl ..\%1.texi.jam %1.texi
perl ..\..\..\t2h.pl %1.texi %1
mkdir ..\..\..\..\html\texi\
gzip %1.rtf
copy %1.rtf.gz ..\..\..\..\html\texi\
hhc %1.hhp
copy %1.chm ..\..\..\..\html\texi\
rm -rf ..\..\..\..\html\texi\%1
mkdir ..\..\..\..\html\texi\%1
copy *.html ..\..\..\..\html\texi\%1\
cd ..
rm -rf tmp
cd ..\..
GOTO ENDLABEL
:ENDLABEL

[Contents]

4.11. mkthl.cmd

This command file should be used the same way as mkth.cmd. This command file performs only minimal compilation, running only `jamal.pl' and `t2h.pl' on the documentation file, but does not run TeX or dviXX or Microsoft help compiler.

This command file is to be used instead of mkth.cmd when editing the documentation and there is a need for a fast proof reading, but you do not need all versions of the document.

[Contents]

4.12. mkath.cmd

This is a simple command script that calls mkth.cmd for each .texi.jam file that is in the `./html/texi' directory.

The souce code of the file `mkath.cmd' is:

[Contents]

5. C source files

The C source files are documented in a separate document in more detail that the scope of this document.

[Contents]

6. Configuration files

Configuration files in the source package hold default values that are shipped with the program. Each "setuper" has to edit the configuration file according to the local needs and recompile it using `cftc.exe' or `cftc' (UNIX).

There are two configuration files currently in the source:

[Contents]

7. Definition files

This chapter lists the definition files. These files are used to have a maintainable format instead of complex C syntax. The definition files have simple syntax and are converted into C source file.

[Contents]

7.1. errors.def

This file contains the error constant definitions. This file is converted to C source file using the Perl script `generrh.pl'

The source code of the file is not included in this documentation because the file itself is too long for the purpose.

[Contents]

7.2. syntax.def

This file contains the syntax definition of the language ScriptBasic. This syntax definition is converted to C source file containing syntax definition tables using the Perl script `syntaxer.pl'.

The souce code of the file `syntax.def' is:

%FILE syntax
#%HFILE syntax.h
#%CFILE syntax.c
%COMMANDS
EMPTY: nl noexec
LOCAL: 'local' local_list nl noexec
PRAGMA: 'declare' 'option' pragma nl noexec
OPTION: 'option' absolute_symbol expression
# Compare
! sbCaseSensitive   0x00000000
! sbCaseInsensitive 0x00000001
! sbMathErrDiv          0x00000001
! sbMathErrUndef        0x00000002
! sbMathErrUndefCompare 0x00000004
CUNDEF:       'undef' lval_list nl
CBYVAL:       'byval' lval_list nl
# the different looping statements that are common in BASIC
# the ordering of the defintion *IS* important
WHILE:     'while' expression  go_forward(WHILE) come_back(WHILE) nl
WEND:      'wend' go_back(WHILE) come_forward(WHILE) nl
DOWHILE:   'do' 'while' expression go_forward(DO) come_back(DO) nl
DOUNTIL:   'do' 'until' expression go_forward(DO) come_back(DO) nl
LOOPWHILE: 'loop' 'while' expression go_back(LOOP) come_forward(LOOP) nl
LOOPUNTIL: 'loop' 'until' expression go_back(LOOP) come_forward(LOOP) nl
UNTIL:     'until' expression go_back(REPEAT) come_forward(REPEAT) nl
LOOP:      'loop' go_back(DO) come_forward(DO) nl
REPEAT:    'repeat' go_forward(REPEAT) come_back(REPEAT) nl
DO:        'do' go_forward(LOOP) come_back(LOOP) nl
# we allow a symbol after the next, but it does not help to recongnise nexting errors
NEXTI:    'next' symbol go_back(FOR) come_forward(FOR) nl
NEXT:    'next' go_back(FOR) come_forward(FOR) nl
OPENDIR: 'open' 'directory' expression 'pattern' expression 'option' expression 'as' expression nl
# predefined global constants
! sbCollectDirectories   0xFFFFFFFE
! sbCollectDots          0xFFFFFFFD
! sbCollectRecursively   0xFFFFFFFB
! sbCollectFullPath      0xFFFFFDFF
! sbCollectFiles         0xFFFFFFFF
! sbSortBySize           0xFFFFFFF7
! sbSortByCreateTime     0xFFFFFFEF
! sbSortByAccessTime     0xFFFFFFDF
! sbSortByModifyTime     0xFFFFFFBF
! sbSortByName           0xFFFFFF7F
! sbSortByPath           0xFFFFFEFF
! sbSortAscending        0xFFFFFBFF
! sbSortDescending       0xFFFFFFFF
! sbSortByNone           0xFFFFFFFF
# file operations
OPEN/OPEN:   'open' expression 'for' absolute_symbol 'as' expression 'len' '=' expression nl
CLOSE:  'close' '#' expression nl
CLOSE:  'close' expression nl
SEEK:   'seek' '#' expression ',' expression nl
SEEK:   'seek' expression ',' expression nl
REWIND: 'rewind' '#' expression nl
REWIND: 'rewind' expression nl
RESET:  'reset' nl
LINPUTF: 'line' 'input' '#' expression ',' lval nl
LINPUT: 'line' 'input' lval nl
TRUNCATEF: 'truncate' '#' expression ',' expression nl
RLOCK: 'lock' 'region' '#' expression 'from' expression 'to' expression 'for' absolute_symbol nl
RLOCK: 'lock' 'region'  expression 'from' expression 'to' expression 'for' absolute_symbol nl
FLOCK: 'lock' '#' expression ',' absolute_symbol nl
FLOCK: 'lock' expression ',' absolute_symbol nl
MKDIR: 'mkdir' expression nl
DELETEF: 'deltree' expression nl
DELETE: 'delete' expression nl
FCOPY: 'filecopy' expression ',' expression nl
NAME: 'name' expression ',' expression nl
CHDIR: 'chdir' expression nl
SETFILE: 'set' 'file' expression absolute_symbol '=' expression nl
BINMO: 'binmode' 'output' nl
BINMI: 'binmode' 'input' nl
TXTMO: 'textmode' 'output' nl
TXTMI: 'textmode' 'input' nl
BINMF: 'binmode' '#' expression nl
BINMF: 'binmode' expression nl
TXTMF: 'textmode' '#' expression nl
TXTMF: 'textmode' expression nl
SLEEP: 'sleep' expression nl
PAUSE: 'pause' expression nl
# list of unary operators
%UNARIES
PLUS:  +
MINUS: -
NOT: not
BYVAL: byval
EXTOPAC: +^
EXTOPAD: +<
EXTOPAE: +>
EXTOPAF: +?
EXTOPAG: +=
EXTOPAH: +*
EXTOPAI: +/
EXTOPAJ: +%
EXTOPAK: +!
EXTOPAL: +#
EXTOPAM: +&
EXTOPAN: +\
EXTOPAO: +`
EXTOPAP: +'
EXTOPAQ: +@
EXTOPBC: -^
EXTOPBD: -<
EXTOPBE: ->
EXTOPBF: -?
EXTOPBG: -=
EXTOPBH: -*
EXTOPBI: -/
EXTOPBJ: -%
EXTOPBK: -!
EXTOPBL: -#
EXTOPBM: -&
EXTOPBN: -\
EXTOPBO: -`
EXTOPBP: -'
EXTOPBQ: -@
EXTOPCC: ^^
EXTOPCD: ^<
EXTOPCE: ^>
EXTOPCF: ^?
EXTOPCG: ^=
EXTOPCH: ^*
EXTOPCI: ^/
EXTOPCJ: ^%
EXTOPCK: ^!
EXTOPCL: ^#
EXTOPCM: ^&
EXTOPCN: ^\
EXTOPCO: ^`
EXTOPCP: ^'
EXTOPCQ: ^@
EXTOPDC: <^
EXTOPDD: <<
EXTOPDF: <?
EXTOPDH: <*
EXTOPDI: </
EXTOPDJ: <%
EXTOPDK: <!
EXTOPDL: <#
EXTOPDM: <&
EXTOPDN: <\
EXTOPDO: <`
EXTOPDP: <'
EXTOPDQ: <@
EXTOPEC: >^
EXTOPED: ><
EXTOPEE: >>
EXTOPEF: >?
EXTOPEH: >*
EXTOPEI: >/
EXTOPEJ: >%
EXTOPEK: >!
EXTOPEL: >#
EXTOPEM: >&
EXTOPEN: >\
EXTOPEO: >`
EXTOPEP: >'
EXTOPEQ: >@
EXTOPFC: ?^
EXTOPFD: ?<
EXTOPFE: ?>
EXTOPFF: ??
EXTOPFG: ?=
EXTOPFH: ?*
EXTOPFI: ?/
EXTOPFJ: ?%
EXTOPFK: ?!
EXTOPFL: ?#
EXTOPFM: ?&
EXTOPFN: ?\
EXTOPFO: ?`
EXTOPFP: ?'
EXTOPFQ: ?@
EXTOPGC: =^
EXTOPGD: =<
EXTOPGE: =>
EXTOPGF: =?
EXTOPGG: ==
EXTOPGH: =*
EXTOPGI: =/
EXTOPGJ: =%
EXTOPGK: =!
EXTOPGL: =#
EXTOPGM: =&
EXTOPGN: =\
EXTOPGO: =`
EXTOPGP: ='
EXTOPGQ: =@
EXTOPHC: *^
EXTOPHD: *<
EXTOPHE: *>
EXTOPHF: *?
EXTOPHG: *=
EXTOPHH: **
EXTOPHI: */
EXTOPHJ: *%
EXTOPHK: *!
EXTOPHL: *#
EXTOPHM: *&
EXTOPHN: *\
EXTOPHO: *`
EXTOPHP: *'
EXTOPHQ: *@
EXTOPIC: /^
EXTOPID: /<
EXTOPIE: />
EXTOPIF: /?
EXTOPIG: /=
EXTOPIH: /*
EXTOPII: //
EXTOPIJ: /%
EXTOPIK: /!
EXTOPIL: /#
EXTOPIM: /&
EXTOPIN: /\
EXTOPIO: /`
EXTOPIP: /'
EXTOPIQ: /@
EXTOPJC: %^
EXTOPJD: %<
EXTOPJE: %>
EXTOPJF: %?
EXTOPJG: %=
EXTOPJH: %*
EXTOPJI: %/
EXTOPJJ: %%
EXTOPJK: %!
EXTOPJL: %#
EXTOPJM: %&
EXTOPJN: %\
EXTOPJO: %`
EXTOPJP: %'
EXTOPJQ: %@
EXTOPKC: !^
EXTOPKD: !<
EXTOPKE: !>
EXTOPKF: !?
EXTOPKG: !=
EXTOPKH: !*
EXTOPKI: !/
EXTOPKJ: !%
EXTOPKK: !!
EXTOPKL: !#
EXTOPKM: !&
EXTOPKN: !\
EXTOPKO: !`
EXTOPKP: !'
EXTOPKQ: !@
EXTOPLC: #^
EXTOPLD: #<
EXTOPLE: #>
EXTOPLF: #?
EXTOPLG: #=
EXTOPLH: #*
EXTOPLI: #/
EXTOPLJ: #%
EXTOPLK: #!
EXTOPLL: ##
EXTOPLM: #&
EXTOPLN: #\
EXTOPLO: #`
EXTOPLP: #'
EXTOPLQ: #@
EXTOPMC: &^
EXTOPMD: &<
EXTOPME: &>
EXTOPMF: &?
EXTOPMG: &=
EXTOPMH: &*
EXTOPMI: &/
EXTOPMJ: &%
EXTOPMK: &!
EXTOPML: &#
EXTOPMM: &&
EXTOPMN: &\
EXTOPMO: &`
EXTOPMP: &'
EXTOPMQ: &@
EXTOPNC: \^
EXTOPND: \<
EXTOPNE: \>
EXTOPNF: \?
EXTOPNG: \=
EXTOPNH: \*
EXTOPNI: \/
EXTOPNJ: \%
EXTOPNK: \!
EXTOPNL: \#
EXTOPNM: \&
EXTOPNN: \\
EXTOPNO: \`
EXTOPNP: \'
EXTOPNQ: \@
EXTOPOC: `^
EXTOPOD: `<
EXTOPOE: `>
EXTOPOF: `?
EXTOPOG: `=
EXTOPOH: `*
EXTOPOI: `/
EXTOPOJ: `%
EXTOPOK: `!
EXTOPOL: `#
EXTOPOM: `&
EXTOPON: `\
EXTOPOO: ``
EXTOPOP: `'
EXTOPOQ: `@
EXTOPPC: '^
EXTOPPD: '<
EXTOPPE: '>
EXTOPPF: '?
EXTOPPG: '=
EXTOPPH: '*
EXTOPPI: '/
EXTOPPJ: '%
EXTOPPK: '!
EXTOPPL: '#
EXTOPPM: '&
EXTOPPN: '\
EXTOPPO: '`
EXTOPPP: ''
EXTOPPQ: '@
EXTOPQC: @^
EXTOPQD: @<
EXTOPQE: @>
EXTOPQF: @?
EXTOPQG: @=
EXTOPQH: @*
EXTOPQI: @/
EXTOPQJ: @%
EXTOPQK: @!
EXTOPQL: @#
EXTOPQM: @&
EXTOPQN: @\
EXTOPQO: @`
EXTOPQP: @'
EXTOPQQ: @@
EXTOPF: ?
EXTOPK: !
EXTOPL: #
EXTOPO: `
EXTOPQ: @
%PRECEDENCE
%PRECEDENCE
MULT: *
DIV: /
IDIV: \
MOD: %
%PRECEDENCE
CONCATENATE: &
%PRECEDENCE
EQ: =
LT: <
LE: <=
GT: >
GE: >=
NE: <>
%PRECEDENCE
OR: or
XOR: xor
# built-in functions: name, min args, max args
%FUNCTIONS
SIN: sin 1 1
ASIN: asin 1 1
COS: cos 1 1
ACOS: acos 1 1
SGN: sgn 1 1
ODD: odd 1 1
GCD: gcd 2 100000
LCM: lcm 2 100000
EVEN: even 1 1
SQR: sqr 1 1
RND: rnd 0 0
ABS: abs 1 1
VAL: val 1 1
PI: pi 0 0
MAXINT: maxint 0 0
MININT: minint 0 0
TRUE: true 0 0
FALSE: false 0 0
FIX: fix 1 1
INT: int 1 1
INT: cint 1 1
FRAC: frac 1 1
CVD: cvd 1 1
CVI: cvi 1 1
CVL: cvl 1 1
CVS: cvs 1 1
MKD: mkd 1 1
MKD: mkd@$ 1 1
MKI: mki 1 1
MKI: mki@$ 1 1
MKS: mks 1 1
MKS: mks@$ 1 1
MKL: mkl 1 1
MKL: mkl@$ 1 1
UNDEF: undef 0 0
ROUND: round 1 2
LOG: log 1 1
LOG10: log10 1 1
POW: pow 1 1
EXP: exp 1 1
LEN: len 1 1
ASC: asc 1 1
LBOUND: lbound 1 1
UBOUND: ubound 1 1
ACOSECANT: acosecant 1 1
ACTAN: actan 1 1
ASECANT: asecant 1 1
ATAN: atan 1 1
ATN: atn 1 1
COSECANT: cosecant 1 1
COTAN: cotan 1 1
COTAN2: cotan2 2 2
HCOS: hcos 1 1
HCOSECANT: hcosecant 1 1
HCTAN: hctan 1 1
HSECANT: hsecant 1 1
HSIN: hsin 1 1
HTAN: htan 1 1
SECANT: secant 1 1
TAN: tan 1 1
TAN2: tan2 2 2
BIN: bin 1 1
OPTIONF: option 1 1
LOC: loc 1 1
LOF: lof 1 1
FILELEN: filelen 1 1
FREEFILE: freefile 0 1
INPUTFUN: input 1 2
EOFFUN: eof 1 1
EODFUN: eod 1 1
FTACCESS: fileaccesstime 1 1
FTMODIFY: filemodifytime 1 1
FTCREATED: filecreatetime 1 1
FOWNER: fileowner 1 1
ISDIR: isdirectory 1 1
ISREG: isfile 1 1
FILEXISTS: fileexists 1 1
NEXTFILE: nextfile 1 1
ENVIRON: environ 1 1
ENVIRON: environ@$ 1 1
CURDIR: curdir 0 0
COMMANDF: command 0 0
ADDRESSF: address 1 1
KILL: kill 1 1
ICALLFUN: icall 1 2000000
FCRYPT: crypt 2 2
CREATEPROCESS: system 1 1
CREATEPROCESSEX: execute 3 3
WAITPID: waitpid 2 2
FORK: fork 0 0

[Contents]

7.3. source.ziplist

List of files and extensions to include into the source distribution of ScriptBasic WIN32 distribution.

The souce code of the file `source.ziplist' is:

[Contents]

7.4. source.exziplist

List of files and extensions to exclude from the source distribution of ScriptBasic WIN32 distribution.

The souce code of the file `source.exziplist' is:

[Contents]

8. Perl files

The Perl program used to automate the code maintenance are listed in this chapter.

[Contents]

8.1. ssplit.pl

This file splits the file `html/source.txt' into several Jamal files. This file is called from mkweb.pl

The souce code of the file `ssplit.pl' is:

if( @$#ARGV == 0 && @$ARGV[0] eq '-h' ){
  print <<END__HELP;
Source Splitter @$version
Usage:
This program splits a text file. The primary
purpose of this tool was to maintain many small HTML files as a one
somewhat larger jamal source, compile it using jamal and then split
to small html files. The source file should contain lines
to start a new file. The default directory is .
            http://www.isys.hu/c/verhas/progs/perl/ssplit
END__HELP
  exit;
  }
open(F,@$file) or die "Can not open @$file\n";
while( <F> ){
  if( /^\s*%\s*dir\s+(.*?)\s*@$/ ){
    @$subdir = @$1;
    next;
    }
sub save_buffer {
  my @$file = shift;
  if( open(OUT,"<@$file") ){
    my @$os = @$/; undef @$/;
    my @$sbuffer = <OUT>;
    @$/ = @$os;
    close OUT;
    return if @$buffer eq @$sbuffer;
    }
  &make_dir(@$file);
  open(OUT,">@$file") or die "Can not output @$file";
  print OUT @$buffer;
  close OUT;
  }
  @$root = '';
  for( @dlist ){
    @$root .= '/' if @$root;
    @$root .= @$_; # take the next subdirectory
    mkdir @$root, 0777 unless -d @$root
    }
  }

[Contents]

8.2. mkweb.pl

This Perl script is invoked by mkweb.cmd and it executes several Jamal processes for the web jamal files.

The souce code of the file `mkweb.pl' is:

[Contents]

8.3. convert.pl

This small utility opens all files in the current directory and below recursively and converts the files to contain UNIX line-feeds. This is needed when the files are copied from a DOS development station to UNIX via SMB.

The souce code of the file `convert.pl' is:

#
# convert.pl
# This small utility opens all files in the current directory and below recirsively and
# converts the files to contain UNIX line-feeds. This is needed when the files are
# copied from a DOS development station to to UNIX via SMB.
#
# The conversion does not harm files that are already UNIX LF.
#
%BADS = [];
  if(  @$fn !~ /\./ ){
    #if there is no extension in the file name at all
    return 0 if @$fn =~ /^Makefile@$/;
    open(F,@$fn) or die "cannot open \n@$fn\n for reading to decide file type";
    my @$l = <F>;
    close F;
    chomp @$l;
    if( @$l =~ /^\#\!\s*\// ){
      return 0;
      }
    return 1;
    }
opendir(D,'.');
@f = readdir(D);
closedir(D);
@DirsLeft = ();
@$qdir = '';
while(1){
  @$qdir = @$qdir . '/' if @$qdir;
  for( @f ){
    if( -d "@$qdir@$_" ){
      push @DirsLeft , "@$qdir@$_" unless @$_ eq '.' || @$_ eq '..';
      }else{
      push @filist , "@$qdir@$_";
      }
    }
  last if @$#DirsLeft == -1;
  @$qdir = pop @DirsLeft;
  opendir(D,"@$qdir");
  @f = readdir(D);
  closedir(D);
  }
for @$i ( @filist ){
  if( ! isbinary(@$i) ){
    # get the file time (mtime)
    my (@$dev,@$ino,@$mode,@$nlink,@$uid,@$gid,@$rdev,@$size,@$atime,@$mtime,@$ctime,@$blksize,@$blocks) = stat(@$i);
    open(F,@$i) or die "cannot read @$i for converting\n";
    @$ofile = '';
    @$file = '';
    while( <F> ){
      @$ofile .= @$_;
      while( /\r@$/ || /\n@$/ ){chop;}
      @$file .= "@$_\n";
      }
    if( @$ofile ne @$file ){
      open(F,">@$i") or die "cannot write the file @$i for converting\n";
      print F @$file;
      close F;
      utime @$atime,@$mtime,@$i;
      chmod 0400,@$i;
      }
    }
  }
my (@$dev,@$ino,@$mode,@$nlink,@$uid,@$gid,@$rdev,@$size,@$atime,@$mtime,@$ctime,@$blksize,@$blocks) = stat('../convert.pl');
utime @$atime,@$mtime,'convert.pl';
chmod 0500,'setup';
exit 0;

[Contents]

8.4. esd2html.pl

Create on-line documentation based on SDD files. This program was NOT developed for ScriptBasic. This is a general purpose source documentation package that was developed first for the Perl language but turned out to be useful for other languages like C.

This tool is not going to be used anymore for the documentation of ScriptBasic. However you can still find the old definition files in the source tree and some source code may still contain old esd formatted documentation.

The source code of the file is not included in this documentation because the file itself is too long for the purpose.

[Contents]

8.5. generrh.pl

This script reads the files `errors.def', `build.txt' and creates the files `errcodes.c' and `include/error.bas'

The file `errors.def' contains the used error symbols in an easy to maintain text format.

The souce code of the file `generrh.pl' is:

open(OUT,">errcodes.c") or die "Can not output errcodes.c";
open(BAS,">include/error.bas") or die "Can nor output include/error.bas";
print BAS <<BASEND;
' This file was automatically generated by the program generrh.pl
' using the error code definition file errors.def from the
' ScriptBasic distribution
'
' This file is part of the ScriptBasic distribution and is
' specific to the actual build it was shipped. Do not use
' this file for any version or build of the ScriptBasic
' interpreter other than the one this file was shipped.
'
' THIS FILE IS FOR V1.0 BUILD @$BUILD
'
Global Const sbErrorOK = 0
Global Const sbErrorMemory = 1
print OUT <<END;
/* 
FILE: errcodes.c
HEADER: errcodes.h
TO_HEADER:
@$module = '';
@$CurrentErrorCode = 2;
@$LastErrorCode = 0;
@$TextHashes = {};
@$ErrorType = 0; # 0 is compile type, 1 is run time error
  next if /^\s*\#/;
  if( /\%CT\s*@$/ ){
    @$ErrorType = 0;
    next;
    }
  }
close F;
print OUT "typedef struct { char *language; char **array; } tErrorMessageArray;\n";
print OUT "extern tErrorMessageArray ErrorMessageArray[];\n";
print OUT "*/\n";
while( (@$language,@$array) = each %{@$TextHashes} ){
  @$TextHashes->{@$language}->[0] = "SUCCESS";
  print OUT "char *@${language}_error_messages[] ={\n";
  for( @$i = 0 ; @$i < @$CurrentErrorCode ; @$i++ ){
    print OUT '"',@$TextHashes->{@$language}->[@$i],'"',",\n";
    }
  print OUT "NULL\n};\n";
  }

[Contents]

8.6. headerer.pl

This Perl script reads the C source files one-by-one that are given on the command line and extracts the header information from the C file and creates the `.h' files.

Note that in case the C file was not changed and thus the new header file is the same as the old one the program does not touch the header file and this way it does not force and make utility to recompile the source useless.

The souce code of the file `headerer.pl' is:

START_HERE:
@$file = shift;
exit unless defined @$file;
@$header_file_name   = '';
@$header_file_opened = 0;
@$header_file        = undef;
@$podon = 0;
while( defined( @$_ = <F>) ){
  chomp;
  if( /^\s*HEADER\s*:\s*(\S+)/ ){
    @$header_file_name = @$1;
    next;
    }
  if( /^\s*TO_HEADER\s*:/ ){
    &open_header_file;
    @$podon = 0;               # no =POD is on by default
    while( <F> ){
      chomp;
      if( m{^\s*=POD\s*@$} ){ # start POD
        @$podon = 1;
        next;
        }
      if( m{^\s*=CUT\s*@$} ){ # finish POD
        @$podon = 0;
        next;
        }
      last if m{^\s*\*/\s*@$}; # finish copiing when the */ is reached
      if( m{^(.*?)//(.*)} ){   # chop off // comments
        @$_ = @$1;
        }
      s/\\\s*@$/\\/;           # delete trailing space after \
      @$header_content .= "@$_\n" unless @$podon;
      }
    next;
    }
  if( m{^\s*\.function\s+(\w+)\s*@$} ){
    @$basic_function_name = @$1;
    next;
    }
  if( m{^\s*besCOMMAND\((\w+)\)\s*@$} ){
    @$module_function_name = @$1;
    &open_bas_file;
    push @bas_coms , [ "@$basic_function_name" , "@$module_function_name" ];
    next;
    }
@$header_content .= <<END;
#ifdef __cplusplus
}
#endif
#endif
END
@$max_bas_function_name_len = 0;
@$max_c_function_name_len   = 0;
for @$sub ( @bas_coms ){
  @$max_bas_function_name_len = length( @$sub->[0] ) if length( @$sub->[0] ) > @$max_bas_function_name_len;
  @$max_c_function_name_len   = length( @$sub->[1] ) if length( @$sub->[1] ) > @$max_c_function_name_len;
  }
for @$sub ( @bas_subs ){
  #                 declare command xxx
  @$bas_declares .= "declare sub     ::" .
                         @$sub->[0] .       ' ' x (@$max_bas_function_name_len - length(@$sub->[0])) .
                   " alias " .
                   '"' . @$sub->[1] . '"' . ' ' x (@$max_c_function_name_len   - length(@$sub->[1])) .
                   " lib \"@$module_name\"\n";
  }
for @$sub ( @bas_coms ){
  @$bas_declares .= "declare command ::" .
                         @$sub->[0] .       ' ' x (@$max_bas_function_name_len - length(@$sub->[0])) .
                   " alias " .
                   '"' . @$sub->[1] . '"' . ' ' x (@$max_c_function_name_len   - length(@$sub->[1])) .
                   " lib \"@$module_name\"\n";
  }
@$bas_content .= "\nend module\n";
if( @$bas_file_opened ){
  if( open(H,"<@$open_bas_file_name") ){
    # check if the file is identical
    my @$oldsep = @$/; undef @$/;
    @$q = <H>;
    close H;
    @$/ = @$oldsep;
    }
  if( @$q ne @$bas_content && @$open_bas_file_name ){
    open(H,">@$open_bas_file_name") or die "Can not open bas file @$open_bas_file_name";
    print H @$bas_content;
    close H;
    }
  }
sub open_header_file {
  @$header_file_opened = 1;
  # modify the header name so that it is created in the same directory as the source
  my @$dir = @$file;
  @$dir =~ s/\\/\//g; # leaning toothpicks effect :-) (convert \ to / for Win32 users)
  if( @$dir =~ s/\/[^\/]+@$// ){
    @$open_header_file_name = "@$dir/@$header_file_name";
    }else{
    @$open_header_file_name = @$header_file_name;
    }
  @$header_symbol = uc @$header_file_name;
  @$header_symbol =~ s{^.*/}{};
  @$header_symbol = '__'.@$header_symbol.'__';
  @$header_symbol =~ s/\./_/g;
  @$header_content .= <<END;
/*
@$header_file_name
*/
#ifndef @$header_symbol
#define @$header_symbol 1
#ifdef  __cplusplus
extern "C" {
#endif
END
  }
  return if @$bas_file_opened;
  return if ! @$bas_file_name ;
  @$bas_content .= <<END;
' """
FILE: @$bas_file_name
This file was generated by headerer.pl from the file @$input_file_name
Do not edit this file, rather edit the file @$input_file_name and use
headerer.pl to regenerate this file.
"""
END
  }

[Contents]

8.7. heber.pl

Html Embedded Basic sample preprocessor.

The souce code of the file `heber.pl' is:

# we want to read the whole file into memory
@$/ = undef;
# open the file or exit 0 telling ScriptBasic that it has failed
open(F,"<@$inputfile") or exit(0);
@$input = <F>;
close F;
@$output = '';
if( length(@$input) > 0 ){
  @$input =~ s/\"/\\\"/g;
  @$output .= 'print """' . @$input . '"""' . "\n";
  }
# open the output file or exit 0 telling ScriptBasic that it has failed
open(F,">@$outputfile") or exit(0);
print F @$output;
close F;
exit(0);

[Contents]

8.8. mkcdoc.pl

Extract the BASIC command reference documentation from the C source files that are in the C source file in the directory `commands'

The souce code of the file `mkcdoc.pl' is:

my %SECTION;
my %COMMAND;
my %TITLE; # the title line of the command
my %SUBTITLE; # the subtitle of the command
my %DISPLAY; # the display of the command in the TOC
my @files;
my @$SourceFile;
for @$SourceFile ( @files ){
  &ProcessFile( @$SourceFile );
  }
&CreateOutput;
&CreateTexiOutput;
exit;
  return unless open(F,"commands/@$file");
  while( defined(@$line = <F>) ){
    if( @$line =~ /^\/\*\*(.*)\s*@$/ ){
      if( defined(@$ActualCommand) ){
        warn "The command @$ActualCommand was not closed. Closing implicitly.";
        @$ActualCommand = undef;
        }
      @$ActualCommand = @$1;
      next;
      }
    if( @$line =~ /^\*\// ){
      @$ActualCommand = undef;
      next;
      }
    if( @$line =~ /^=section\s+(.*)/ ){
      my @sections = split /\s+/ , @$1;
      for @$section ( @sections ){
        push @{@$SECTION{@$section}},@$ActualCommand;
        }
      next;
      }
    if( @$line =~ /^=title\s+(.*)/ ){
      if( defined(@$TITLE{@$ActualCommand}) ){
        my @$err;
        @$err = "Title is double defined for @$ActualCommand\n" .
               "   " . @$TITLE{@$ActualCommand} . "\n" .
               "   " . @$1 . "\n" ;
        warn @$err;
        }
      @$TITLE{@$ActualCommand} = @$1;
      next;
      }
    if( @$line =~ /^=subtitle\s+(.*)/ ){
      if( defined(@$SUBTITLE{@$ActualCommand}) ){
        warn "Subtitle is double defined for @$ActualCommand";
        }
      @$SUBTITLE{@$ActualCommand} = @$1;
      next;
      }
    if( @$line =~ /^=display\s+(.*)/ ){
      if( defined(@$DISPLAY{@$ActualCommand}) ){
        warn "Title is double defined for @$ActualCommand";
        }
      @$DISPLAY{@$ActualCommand} = @$1;
      next;
      }
sub CreateOutput {
  my @$command;
  my @$lines;
  my @commands;
  my @$section;
  my @sections;
  mkdir "../html";
  open(F,">../html/commands.html") or die "Can not open output file.";
  print F <<END;
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY>
<H1>ScriptBasic commands and functions reference</H1>
  for @$section ( @sections ){
    print F "<a href=\"#section_@$section\">@$section</A>\n";
    }
  for @$command ( @commands ){
    my @$display;
    @$display = @$command;
    @$display = @$DISPLAY{@$command} if defined @$DISPLAY{@$command};
    print F "<a href=\"#command_@$command\">@$display</A>\n";
    }
  for @$section ( @sections ){
    print F "<H3><a name=\"section_@$section\">@$section</A></H3>\n";
	print F "<FONT SIZE=\"1\">\n";
    my @scommands = sort @{@$SECTION{@$section}};
    my @$scommand;
    for @$scommand (@scommands){
      my @$display;
      @$display = @$scommand;
      @$display = @$DISPLAY{@$scommand} if defined @$DISPLAY{@$scommand};
      print F "<a href=\"#command_@$scommand\">@$display</A>\n";
      }
    print F "</FONT\>\n";
    }
  for @$command ( @commands ){
    my @$title = @$command;
    my @$line;
    my @$verbatim = 0;
    my @$subtitle;
    my @$FH;
    #
    # print lines that start a command
    #
      if( @$line =~ /^\s*=itemize\s*@$/ ){
  	if( @$FH ){
          print DF "<UL>\n";
  	  }else{
          print F "<UL>\n";
  	  }
        next;
        }
      if( @$line =~ /^\s*=noitemize\s*@$/ ){
  	if( @$FH ){
          print DF "</UL>\n";
  	  }else{
          print F "</UL>\n";
  	  }
        next;
        }
      my @$l_line = @$line;
      while( @$l_line =~ /R\<(\w+?)\>/ ){
        my @$d = @$1;
        @$d = @$DISPLAY{@$d} if defined @$DISPLAY{@$d};
        @$l_line =~ s/R\<(\w+?)\>/\001a href=\"#command_@$1\">@$d\001\/a>/;
        }
      @$l_line =~ s/T\<(.+?)\>/\001tt>@$1\001\/tt>/g;
      @$l_line =~ s/B\<(.+?)\>/\001B>@$1\001\/B>/g;
      @$l_line =~ s/I\<(.+?)\>/\001I>@$1\001\/I>/g;
      @$l_line =~ tr{\001}{<};
      if( @$FH ){
        print DF @$l_line;
      }else{
        print F @$l_line;
        }
      }
    #
    # print lines that close a command
    #
    print F "</BLOCKQUOTE>\n";
    if( @$FH ){
	  print DF <<END;
<P><a href="../commands.html#command_@$command">BACK</a>
</BODY>
</HTML>
END
	  close DF; # if it was opened
	  }
    }
#################################################
  @commands = sort keys %COMMAND;
  @sections = sort keys %SECTION;
  print F "\@chapter Command reference\n";
    @$title = @$TITLE{@$command} if defined @$TITLE{@$command};
    @$subtitle = undef;
    @$subtitle = @$SUBTITLE{@$command} if defined @$SUBTITLE{@$command};
    print F "\n\@section @$title\n\n";
    print F "\@b{@$subtitle}\n" if defined @$subtitle;
    for @$line ( @{@$COMMAND{@$command}} ){
      if( @$line =~ /^\s*=details\s*@$/ ){
        print F "\@subsection @$command Details\n";
        next;
        }
      if( @$line =~ /^\s*=verbatim\s*@$/ ){
        @$verbatim++;
        print F "\@example\n";
        next;
        }
      if( @$line =~ /^\s*=noverbatim\s*@$/ ){
        @$verbatim--;
        print F "\@end example\n";
        next;
        }
      if( @$verbatim ){
        print F @$line;
        next;
        }
      if( @$line =~ /^\s*@$/ ){
        print F "\n\n";
        next;
        }
      @$l_line =~ s/\@/\@\@/g;
      @$l_line =~ s/\@$/\@\@$/g;
      @$l_line =~ s/\{/\@\{/g;
      @$l_line =~ s/\}/\@\}/g;
      @$l_line =~ s[<a href=".*?">(.*?)</a>][\@xref{@$1}]gi;
      @$l_line =~ s/R\<(.+?)\>/\@xref\{@$1\}/g;
      @$l_line =~ s/T\<(.+?)\>/\@code\{@$1\}/g;
      @$l_line =~ s/B\<(.+?)\>/\@b\{@$1\}>/g;
      @$l_line =~ s/I\<(.+?)\>/\@emph\{@$1\}>/g;
      print F @$l_line;
      }
    }

[Contents]

8.9. syntaxer.pl

Read the file `syntax.def' and create the file `syntax.c' converting the syntax definition from an easy to read and maintain format to C source file.

The source code of the file is not included in this documentation because the file itself is too long for the purpose.

[Contents]

8.10. preparedeb.pl

This Perl script alters the `deb/DEBIAN/control' file so that it contains the actual build version.

The souce code of the file `preparedeb.pl' is:

open(F,"deb/DEBIAN/control") or die;
undef @$/;
@$control_file = <F>;
close F;
open(F,"build.txt") or die;
@$build = <F>;
close F;
@$build = @$build +0;
@$control_file =~ s/(Version\:\s+\d+\.\d+\.)\d+(\-\d+)/@$1@$build@$2/;
open(F,">deb/DEBIAN/control") or die;
print F @$control_file;
close F;

[Contents]

8.11. lmt_make.pl

This perl script reads a file named `lmt_XXX.def' and creates the file `lmt_XXX.c' to help the linking of the external modules into ScriptBasic static.

The souce code of the file `lmt_make.pl' is:

#
# Use this program to automatically create the C table that lists the modules that are going to be
# linked statically to ScriptBasic. Do not edit the created C file, rather maintain one or more
# linkedmodules.def file and create one or more linkedmodules.c file
#
exit 0 unless defined(@$InputFile = shift);
@$OutputFile = @$InputFile;
This file was automatically created by the program lmt_make.pl
Rather edit the file @$InputFile that is the source 
END
unless( open(F,@$InputFile) ){
  print "Cannot open @$InputFile\n";
  exit 1;
  }
@$OUTL .= "MODLIST StaticallyLinkedModules[] ={\n";
for @$module (@ModuleList ){
  @$OUTL .= "  {\"@$module\" , (void *)" . uc(@$module) . "_SLFST },\n"
  }
@$OutputFile =~ s{def@$}{c};
open(OUT,">@$OutputFile") or die "Cannot open output file @$OutputFile";
print OUT @$OUTL;
close OUT;

[Contents]

8.12. t2h.pl

A special purpose texi-to-html converter used to document ScriptBasic.

The source code of the file is not included in this documentation because the file itself is too long for the purpose.

[Contents]

8.13. jamal.pl

The jamal preprocessor.

The source code of the file is not included in this documentation because the file itself is too long for the purpose.

[Contents]

9. UNIX Shell scripts

This chapter lists the UNIX shell scripts that are used to automate the code maintenance under the UNIX version of ScriptBasic.

[Contents]

9.1. install.sh

This script copies the compiled files to the installation directory and sets the various permissions. You have to be root to run this script. This is used by `Makefile'

The souce code of the file `install.sh' is:

[Contents]

9.2. convert.sh

Converts `convert.pl' to the UNIX CR/LF convention and then runs it to convert all the files. You have to execute this script after you have uploaded to source files froma Win32 workstation to a UNIX machine and have all the files with the wrong CR/LF line termination.

The souce code of the file `convert.sh' is:

[Contents]

9.3. uncr

A simple Perl script that converts stdin to stdout CR/LF to UNIX LF. This file is a one liner thus there is no CR/LF issue when this file is transferred.

Actually convert.sh converts `convert.pl' using this Perl script and then `convert.pl' converts the uploaded files safely.

The souce code of the file `uncr' is:

[Contents]

9.4. mkdeb.sh

This shell script (used by `Makefile') cleans the directory `deb' and then copies all neccessary files, sets permissions and starts dpkg to create a Debian package of ScriptBasic.

The souce code of the file `mkdeb.sh' is:

[Contents]

9.5. Makefile

Well, the Debian Linux Makefile to create ScriptBasic binaries.

Use, like:

The souce code of the file `Makefile' is:

install : all install.sh
	./install.sh
all : *.c
	./setup