This is the portable version of the TeaScript (Standard) Host Application for Windows (64 bit). (Minimum: Windows 10 19H2)
The purpose is to run and execute script files written in the TeaScript language.

Please, read also the LICENSE.TXT and COPYRIGHT.TXT for usage conditions and permissions.

You don't need to install the software before usage. 
But for convenience reasons an installation instruction is provided below.


Table of Contents
==================================
- Usage without installation
- Manual installation
- Windows and Unicode
- TeaScript programming
- Contact / Support
- Core Library
- Known Issues
- Breaking changes and deprecation



=== Usage without installation ===
----------------------------------

First you must unpack all files (the complete package) to any destination. Then

a) Invoke TeaScript.exe either from the Explorer (double click) or from the command line for launch the interactive shell.
   Ctrl+C will quit the application, or when type :q and pressing enter.
   
   :help <enter> will show a list of internal commands, e.g., use :ls vars for list all 
   variables and functions available in the current present scopes.
   Internal commands for the TeaScript shell always starts with a colon.
   
   Entered text without a starting colon will be interpreted as TeaScript syntax and will be parsed + evaluated.
   
b) Open a command line, change into the directory where TeaScript.exe is located and invoke it with a filename which shall 
   be executed, e.g.:
   TeaScript.exe examples\corelibrary_test01.tea
   
   HINT: You can also use the "open_command_line.cmd" file to open a command line window at the correct place.
   Just double click it from the Explorer window.
   
   You can pass arguments to the script like this:
   TeaScript.exe examples\gcd.tea 18 42
   

   TeaScript.exe --help will show the available modes and options.
   E.g., use -T for time measurement of bootstrap, parsing (, compile) and evaluation|execution time.
   or use -i for enter the interactive shell after the script file has been executed or it is suspended.

   Use --compile <file>.tea for compile a TeaScript file for the integrated TeaStackVM and save it as <file>.tea.tsb.
   .tsb files (TeaScript Binary files) can be executed directly with TeaScript.exe.
   Use --info <file>.tsb for print the header information of a TeaScript Binary.
   Use --printTSVM <file>.tsb|tea for get a listing ot the instructions for the TeaStackVM.



=== Manual installation ===
---------------------------

When doing a manual installation you are able to run and execute TeaScript files (*.tea) via double click
as well as to pass arbitrary parameters to TeaScript files.

1. Copy the complete unpacked TeaScript folder to "C:\Program Files\"
2. Browse to an .tea file (e.g. in the provided example folder), right click on it and choose "open with". 
   Then browse to the TeaScript.exe under "C:\Program Files\TeaScript\" and select "TeaScript.exe".
3. Add the following key to the Windows registry:
   HKEY_CURRENT_USER\SOFTWARE\Classes\Applications\TeaScript.exe\shell\open\command
   (Default): "C:\Program Files\TeaScript\TeaScript.exe" "%1" %*
  
   NOTE: the missing double quotes around %* are intended. It must be exactly like that. If you change it, it will not work!
   You can use the provided "add_tea_files_to_registry.reg" to add the registry key.
   
After that you can invoke TeaScript files like the following example (passing 2 parameters to the script):

examples\gcd.tea 42 18

If you see the output 6 everything is working correctly.


=== Windows and Unicode ===
------------------------------

Some notes to Windows and Unicode support.

TeaScript itself is fully supporting the complete range of Unicode and uses only UTF-8 encoded strings.

All the Windows Terminal Applications still have some trouble when it comes to Unicode support.

The best experience possible is to use the "Windows Terminal" by Microsoft from the MS Store.
Inside the "Windows Terminal" either the PowerShell or the classical CommandPrompt can be used.
I recommend to use the classical CommandPrompt inside the "Windows Terminal" for the best experience.

The PowerShell might be needed to tweaked prior using Unicode with the following command:
$OutputEncoding = [console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding

For the unlucky case you are using the old CommandPrompt (cmd.exe) combined with the old terminal (conhost.exe),
you must ensure to use a proper font, e.g. "SimSun-ExtB". But nevertheless, even then not all Unicode glyphs can be displayed.

You can test unicode support with TeaScript on your system with the example script files:
utf8_test.tea
argout_test.tea


=== TeaScript programming === 
-----------------------------

Information about how to program TeaScript can be found on the webpage:
https://tea-age.solutions

Also you may have a look at the provided example script files.


=== Contact / Support ===
-------------------------

This software is a pre-release.
The behavior, API/ABI, command line arguments, contents of the package,
usage conditions + permissions and any other aspects of the software and the package may change 
in a non backwards compatible or a non upgradeable way without prior notice with any new (pre-)release.

If you encounter bugs or problems, have feature wishes or any other question you may contact:

contact |at| tea-age.solutions


New versions, the source code of the TeaScript C++ Library, the TeaScript Host Application as well as 
eventually used other (A)GPL software are made available here:
https://tea-age.solutions/downloads/


=== Core Library ===
--------------------

Some (maybe incomplete) documentation about the provided standard Core Library.

HINT: in interactive shell use command ':ls vars' for get a complete list of all present toplevel 
      variables and functions.
      Or use ':search str' for search any variable and function containing 'str'.

Variable Name           : Type              --> docu
-------------------------------------------------------------------------------------------
_version_major          :  i64              --> major version of TeaScript
_version_minor          :  i64              --> minor version of TeaScript
_version_patch          :  i64              --> patch version of TeaScript
_version_combined_number:  i64              --> combined version number for easily compare versions.
_version_build_date_time:  String           --> build date and time as string
_api_version            :  i64              --> version of Core Library API.
features                :  Tuple            --> with elements format, color, toml: Bool, and json: i64
                                                indicating whether the Library/Host Application was compiled with the features.
                                                element json_adapter: String indicating the used JsonAdapter.
_init_core_stamp        :  f64              --> time stamp in fractional seconds from an unspecified time point during program start.
_core_config            :  i64              --> combined enum teascript::config::eConfig value used for boostrap the CoreLibrary.
_exit_success           :  i64              --> exit code for indicating success (used especially for _exit)
_exit_failure           :  i64              --> exit code for indicating failure (used especially for _exit)
void                    : NaV (Not a Value) --> Convenience for can write 'return void' if function shall return nothing.
PI                      :  f64              --> The constant number PI


Func Name               : Signature         --> docu
-------------------------------------------------------------------------------------------
_out                    : void ( String )   --> prints param1 (String) to stdout
_err                    : void ( String )   --> prints param1 (String) to stderr
print                   : void ( Any )      --> prints param to stdout, will do to-string conversion of the parameter.
println                 : void ( Any )      --> prints param + line feed to stdout, will do to-string conversion of the parameter.
readline                : String ( void )   --> read line from stdin (and blocks until line finished), 
                                                returns the read line without line feed.
_exit                   : void ( Any )      --> exits the script (with stack unwinding/scope cleanup) with param1 as return value.
                                                (this function never returns!)
_strtonum               : i64|Error ( String ) --> converts a String to i64. Returns Error on error. 
                                                This works only with real String parameters. alternative for '+str'.
_strtonumex             : i64|u8|u64|f64|Error ( String ) --> converts a String to i64,u8,u64 or f64. Returns Error on error.
                                                This works only with real String objects.
_numtostr               : String ( i64 )    --> converts a i64 to String. this works only with real i64 parameters. 
                                                Alternative for 'num % ""'
_f64toi64               : i64 ( f64 )       --> converts a f64 to i64. same effect as trunc() but yields a i64. 
                                                DEPRECATED, use a cast instead!
to_string               : String (val: Any) --> converts val to string (note: if val is an integer _numtostr is an alternative)
to_number               : i64|u8|u64|f64|Error (Any) --> converts val to a Number. Returns Error on error. 
                                                (note: if val is a String _strtonum / _strtonumex is an alternative)
_eval                   : Any ( String )    --> parses and evaluates the string as TeaScript code and returns its result.
eval_file               : Any ( String )    --> parses and evaluates the content of the file and returns its result. 
                                                All defined functions and variables in the top level scope will stay available.
print_error             : void ( e: Any )   --> prints e + line feed to stderr.
                                                will do to string conversion of e (usually e should be String or Error)
fail                    : void ( void )     --> exits the script (with stack unwinding/scope cleanup) with 
                                                error_code _exit_failure (this function never returns!)
fail_with_error         : void ( i64 )      --> exits the script (with stack unwinding/scope cleanup) with the i64 error_code. 
                                                (this function never returns!)
fail_with_message       : void ( err: Any, i64 )  --> prints err to stderr (usually err should be String or Error),
                                                exits the script (with stack unwinding/scope cleanup) with the i64 error_code.
                                                (this function never returns!)
clock                   : f64 ( void )      --> gets the local wall clock time of the current day in (fractional) seconds as f64.
clock_utc               : f64 ( void )      --> gets the UTC time of the current day in (fractional) seconds as f64.
_timestamp              : f64 ( void )      --> gets the elapsed time in (fractional) seconds as f64 from an unspecified 
                                                time point during program start. Time is monotonic increasing.
sleep                   : void ( i64 )      --> sleeps (at least) for given amount of seconds.
random                  : i64 ( i64, i64 )  --> creates a random number in between [start,end]. start, end must be >= 0 and <= UINT_MAX.

min                     : Any ( Any, Any )  --> returns the minimum of a and b
max                     : Any ( Any, Any )  --> returns the maximum of a and b
clamp                   : Any ( val: Any, low: Any, high: Any ) --> returns low if val is less than low, high if val is greater
                                                than high, otherwise val. garbage in, garbage out.
swap                    : Any ( Any, Any )  --> swaps the values of a and b (a and b are passed via shared assign)
abs                     : Number ( Number ) --> returns the absolute value of n (as same type as n). n must be a Number.
trunc                   : f64 ( Number )    --> rounds the given Number towards zero as f64. 
                                                e.g. 1.9 will yield 1.0, -2.9 will yield -2.0.
floor                   : f64 ( Number )    --> rounds down the given Number to next smaller integer as f64. 
                                                e.g. 1.9 will yield 1.0, -2.1 will yield -3.0
ceil                    : f64 ( Number )    --> rounds up the given Number to next greater integer as f64. 
                                                e.g. 1.1 will yield 2.0, -1.9 will yield -1.0
round                   : f64 ( Number )    --> rounds up or down the given Number to nearest integer as f64.
                                                e.g. 1.1 will yield 1.0, 1.6 as well as 1.5 will yield 2.0
pow                     : f64 ( Any, i64 )  --> computes power of input with integer exponent. if exp is a float it will get truncated. 
                                                returns a f64. (will do to-number conversion on input)
sqrt                    : f64 ( Any )       --> computes the square root of given input (will do to-number conversion on input).
timevals                : Bool ( t: f64, HH: i64, MM: i64, S: i64, ms: i64 ) --> computes the hour, minute, second 
                                                and (optionally) millisecond part of given time in seconds (e.g. from clock())
                                                note: hours can be greater than 23/24, it will not be cut at day boundary!
timetostr               : Bool|String ( t, with_ms: Bool ) --> builds a 24 hour wall clock string with the 
                                                format HH:MM:SS.mmm (milliseconds are optional)
                                                note: if t is greater than 24 hours it will not be cut.
rolldice                : i64 ( eyes: i64 ) --> randomly rolls the dice and returns the result.
inc                     : Number ( Number (in/out), step: Number ) --> increments given Number by step (default 1)
dec                     : Number ( Number (in/out), step: Number ) --> decrements given Number by step (default 1)
_seq                    : Sequence (start, end, step: i64 )  --> creates an IntegerSequence of [start,end] with given step.
                                                                 If end is smaller start, step must be negative.
                                                                 A sequence starts at start and the next value is the result
                                                                 of current + step. If end cannot be reached by step exactly
                                                                 the value remains at the last current, e.g, _seq( 1, 10, 2 )
                                                                 will be 1, 3, 5, 7, 9.
                                                                 Sequences can be used in forall loops.
_error_get_code         : i64 ( Error )     --> returns the code of the Error as i64.
_error_get_name         : String ( Error )  --> returns the name of the Error as String.
_error_get_message      : String ( Error )  --> returns the message of the Error as String.
make_runtime_error      : Error ( message: String ) --> creates a Runtime Error with given message. alternative for: "str" as Error.


=== Tuple helper functions ===
_tuple_create           : Tuple ( ... )     --> creates a tuple from the passed parameters. 
                                                parameter count is variable and type Any.
_tuple_named_create     : Tuple ( ... )     --> creates a named Tuple from the given parameters.
                                                The parameter must be of a 2 element sized Tuple whereby the first element
                                                must be of type String and the second element can be Any.
                                                example: _tuple_named_create( ("name", "John"), ("age", 31) )
_tuple_size             : i64 ( Tuple )     --> returns the element count of the Tuple
_tuple_same_types       : Bool ( Tuple, Tuple ) --> checks whether the 2 tuples have the same types in exactly the same order 
                                                (and with same names).
_tuple_val              : Any ( Tuple, i64 ) --> returns the value at given index.
_tuple_named_val        : Any ( Tuple, String ) --> returns the value with given name (or throws).
_tuple_set              : void ( Tuple, i64, Any ) --> sets the value at given index or throws if index not exist.
_tuple_named_set        : void ( Tuple, String, Any ) --> set the value with given name (or throws).
_tuple_append           : void ( Tuple, Any ) --> appends new value to the end as new element.
_tuple_named_append     : Bool ( Tuple, String, Any ) --> appends new value with given name to the end as new element 
                                                if the name not exist yet.
_tuple_insert           : void ( Tuple, i64, Any ) --> inserts new value at given index.
_tuple_named_insert     : void ( Tuple, i64, String, Any ) --> inserts a value with given name at given index.
_tuple_remove           : Bool ( Tuple, i64 ) --> removes element at given index, returns whether an element has been removed.
_tuple_named_remove     : Bool ( Tuple, String ) --> removes element with given name, returns whether an element has been removed.
_tuple_index_of         : i64 ( Tuple, String ) --> returns the index of the element with given name or -1
_tuple_name_of          : String ( Tuple, i64 ) --> returns the name of the element with given idx (or throws)
_tuple_swap             : void ( Tuple, i64, i64 ) --> swaps elements of given indices
tuple_print             : void ( Tuple, String, i64 ) --> prints (recursively) all (named) elements, for debugging 
                                                (String param is the "root" name, last param is for max nesting level)

=== "minimalistic string support" ===
_strlen                 : i64 ( String )    --> returns the length of the string in bytes (excluding the ending 0).
_strglyphs              : i64 ( String )    --> returns the utf-8 (Unicode) glyph count of the string (excluding the ending 0).
_strglyphtobytepos      : i64 ( String, i64 ) --> returns the byte position of the given glyph in given string, or -1 if out of range.
_strat                  : String ( String, i64 ) --> returns a substring of one complete UTF-8 code point where position points into.
                                                empty string if out of range.
_substr                 : String ( String, from: i64, count: i64 ) --> returns a substring [from, from+count). 
                                                count -1 means until end of string. returns empty string on invalid arguments.
_strfind                : i64 ( String, substring: String, offset: i64 ) --> searches for substring from offset and 
                                                returns found pos of first occurrence. -1 if not found.
_strfindreverse         : i64 ( String, substring: String, offset: i64 ) --> searches for substring from behind from offset and 
                                                returns found pos of first occurrence. -1 if not found.
_strreplacepos          : Bool ( str: String, start: i64, count: i64, new: String ) --> replaces the section [start, start+count) 
                                                in str with new. returns false on error, e.g. start is out of range.
strreplacefirst         : Bool ( str: String, what: String, new: String, offset: i64 := 0 ) --> replaces first occurrence of what
                                                with new starting from offset. returns true if a replacement happen.
strreplacelast          : Bool ( str: String, what: String, new: String, offset: i64 := 0 ) --> replaces last occurrence of what 
                                                with new starting from offset. returns true if a replacement happen.
strtrim                 : Bool ( str: String, set: String, leading: Bool, trailing: Bool ) --> trims the string if it starts or ends 
                                                with characters in given set.
strsplit                : Tuple (str: String, sep: String, skip_empty : Bool := false ) --> splits the given string at every
                                                occurring separator and returns a tuple wth the elements.
strjoin                 : String ( Tuple, sep: String, add_leading: Bool := false, add_trailing: Bool := false ) 
                                            --> joins all elements of a tuple to a string with given separator.
_strfromascii           : String|Error ( char: Number ) --> returns a String build from the ascii char.
                                                For invalid chars (>127) Error will be returned.
utf8_begin              : UTF8_Iterator ( String ) --> creates an utf-8 iterator for the given string and 
                                                sets .cur to first utf-8 glyph.
utf8_end                : Bool ( UTF8_Iterator ) --> returns whether the given utf-8 iterator is at end already.
utf8_next               : UTF8_Iterator ( UTF8_Iterator ) --> sets the utf-8 iterator (.cur) to next utf-8 glyph or end of string.


=== "minimalistic (text) file io support" ===
NOTE: text files must be UTF-8 encoded. Pathes can be relative to "cwd" or absolute.

cwd                     : String ( void )   --> returns the current working directory as String
change_cwd              : Bool ( String )   --> changes the current working dir
tempdir                 : String ( void )   --> returns configured temp directory as String
path_exists             : Bool ( String )   --> returns whether path in String exists as directory or file.
file_exists             : Bool ( String )   --> returns whether the given file exists.
file_size               : i64 ( String )    --> returns file size in bytes. -1 on error / file not exists / is not a file.
last_modified           : String ( String ) --> returns the last modified time as String for the given path or empty string 
                                                if not exists/error.
create_dir              : Bool ( String, Bool )  --> creates directories for path in String. Bool == true means recursively.
path_delete             : Bool ( String )   --> deletes(!) file or (empty) directory.
file_copy               : Bool ( file: String, dest_dir: String, overwrite: Bool ) --> copies file to dest_dir if not exist 
                                                or overwrite is true.
file_copy_newer         : Bool ( file: String, dest_dir: String ) --> copies file to dest_dir if not exist 
                                                or file is newer as the file in dest_dir.
readtextfile            : String|Error ( String ) --> reads the content of an UTF-8 text file and returns it in a String. 
                                                An optional BOM is removed.
writetextfile           : Bool ( file: String, str: String, overwrite: Bool, bom: Bool )  --> writes the content of String to 
                                                text file. An optional UTF-8 BOM can be written (last Bool param). 
                                                overwrite indicates if a prior existing file shall be overwritten (old content destroyed!)
readfile                : Buffer|Error ( String ) --> reads the binary content of the file into a buffer. returns Error on error.
writefile               : Bool ( file: String, content: Buffer, overwrite: Bool ) --> writes the content of the Buffer to the file.
                                               overwrite indicates if a prior existing file shall be overwritten (old content destroyed!)

readdirfirst            : Tuple ( String )  --> returns the first direntry of given path (see direntry for details)
readdirnext             : Tuple ( Tuple )   --> returns the next direntry of given direntry (see direntry for details)

=== the direntry tuple ===
On Error or if directory is empty or if there are no more entries to iterate over the tuple has the following elements:
valid                   : Bool              --> here false always.
error                   : i64               --> if greater 0 it is the reported error code from std::filesystem / the OS.
path                    : String            --> the path which was investigated / tried to investigate.

In all other states the tuple has the following elements:
valid                   : Bool              --> here true always.
name                    : String            --> the name of the entry.
size                    : i64               --> the file size (for directories always 0)
last_modified           : String            --> last modified date/time as String with format "%F %T" (perfectly sortable)
is_file                 : Bool              --> true if entry is file, false otherwise.
is_dir                  : Bool              --> true if entry is directory, false otherwise.
path                    : String            --> the absolute and canonical path of the entry.
_handle                 : Passthrough       --> instance of std::filesystem::directory_iterator as Passthrough value.


=== JSON Support ===
readjsonstring          : Any ( String )    --> creates a corresponding object from the given JSON formatted string.
                                                Returns an Error on error.
readjsonfile            : Any ( String )    --> creates a corresponding object from the given JSON formatted file.
                                                Returns an Error on error.
writejsonstring         : String|Error ( Any ) --> creates a JSON formatted string from the object (or Error on error).
writejsonfile           : Bool ( Any )      --> writes a JSON formatted file from the object. returns true on success.
json_is_object          : Bool ( Any )      --> checks if given parameter is an Json compatible object.
json_is_array           : Bool ( Any )      --> checks if given parameter is an Json compatible array.
json_object_size        : i64 ( Tuple )     --> returns the element count of the object.
json_array_size         : i64 ( Tuple )     --> returns the element count of the array.
json_make_object        : Tuple ( ... )     --> creates a compatible Json object from the passed parameters.
json_make_array         : Tuple ( ... )     --> creates a compatible Json array from the passed parameters.
                                                parameter count is variable and type Any.
json_array_empty        : Bool ( Tuple )    --> checks if given Tuple is an empty Json array.
json_array_append       : void ( Tuple, Any ) --> appends value to Json comaptible array 
                                                  (the Tuple must be compatible, e.g., json_is_array returned true!)
json_array_insert       : Bool ( Tuple, I64, Any ) --> inserts value at idx to Json comaptible array 
                                                       (the Tuple must be compatible, e.g., json_is_array returned true!)
json_array_remove       : Bool ( Tuple, I64 ) --> removes value at idx from Json comaptible array 
                                                  (the Tuple must be compatible, e.g., json_is_array returned true!)
readbsonbuffer          : Any ( Buffer )    --> creates a value of appropriate type from the given BSON buffer (or Error on error).
writebsonbuffer         : Buffer|Error ( Any ) --> creates a Bson buffer (or Error on error).


=== TOML Support ===
readtomlstring          : Tuple|Error ( String )  --> creates a named tuple from the given TOML formatted string (or Error on error).
readtomlfile            : Tuple|Error ( String )  --> creates a named tuple from the given TOML formatted file (or Error on error).
writetomlstring         : String|Error ( Tuple )  --> creates a TOML formatted string from the named tuple (or Error on error).
writetomlfile           : Bool ( Tuple )    --> writea a TOML formatted file from the named tuple. returns true on success.
toml_is_table           : Bool ( Any )      --> checks if given parameter is an Toml compatible table.
toml_is_array           : Bool ( Any )      --> checks if given parameter is an Toml compatible array.
toml_table_size         : i64 ( Tuple )     --> returns the element count of the table.
toml_array_size         : i64 ( Tuple )     --> returns the element count of the array.
toml_make_table         : Tuple ( ... )     --> creates a compatible toml table from the passed parameters.
toml_make_array         : Tuple ( ... )     --> creates a compatible toml array from the passed parameters.
                                                parameter count is variable and type Any.
toml_array_empty        : Bool ( Tuple )    --> checks if given Tuple is an empty Toml array.
toml_array_append       : void ( Tuple, Any ) --> appends value to Toml comaptible array 
                                                  (the Tuple must be compatible, e.g., toml_is_array returned true!)
toml_array_insert       : Bool ( Tuple, I64, Any ) --> inserts value at idx to Toml comaptible array 
                                                       (the Tuple must be compatible, e.g., toml_is_array returned true!)
toml_array_remove       : Bool ( Tuple, I64 ) --> removes value at idx from Toml comaptible array
                                                  (the Tuple must be compatible, e.g., toml_is_array returned true!)

=== Color Output Support ===
make_rgb                : i64 (r: i64, g: i64, b: i64)  --> makes a 32 bit rgb color (garbage in, garbage out)
cprint                  : void (i64, String)  --> prints the text in the given rgb color (only available with libfmt)
cprintln                : void (i64, String)  --> same as cprint but adds a new line to the end.

=== Format String Support === 
format                  : String ( format: String, ... )  --> formats the string with libfmt the same way as known from C++.

=== Buffer Support ===
General information:
Buffers are represented as contiguous memory and can be accessed and modified bytewise at byte boundaries (1 byte = 8 bit).
It is not possible to share assign from a single byte of a buffer.

The Subscript operator can be used for access and modify an existing byte.

Buffers will not grow behind its original capacity automatically (use _buf_resize), but its size will grow up to its capacity.

Memory will be freed automatically if last reference goes out of scope or being undef'ed.

Because TeaScript has only one signed integral type, I64, all setter and getter for signed types are operating with I64.
Because TeaScript has only U8 and U64 as unsigned integral types, all getter and setter using a bigger type than U8
are operating with U64 as type.

All getters and setters are operating in host byte order.

_buf                    : Buffer ( size: Number )  --> creates an empty Buffer (size == 0) with capacity 'size'.
_buf_size               : U64 ( Buffer )           --> returns the actual amount of used/filled bytes in the buffer.
_buf_capacity           : U64 ( Buffer )           --> returns the amount of allocated memory in bytes for the buffer.
buf_zero                : void ( Buffer )          --> fills the complete capacity of the buffer with zeroes. post: size == capacity
_buf_fill               : Bool ( Buffer, pos: Number, count: Number, val: U8 )  --> fills the buffer from pos up to pos + count with val.
_buf_fill32             : Bool ( Buffer, pos: Number, count: Number, val: U64 ) --> fills the buffer from pos up to pos + count 
                                                       with val as u32. The passed range must be dividable by 4 (sizeof u32).
_buf_resize             : Bool ( Buffer, size: Number )  --> resizes the buffer (shrink or grow). new values are added as zero. 
                                                       see _buf_fill also.
_buf_copy               : Bool ( dst: Buffer, dst_off: Number, src: Buffer, src_off: Number, len: Number )  
                                                   --> copies src buffer into dst buffer.
_buf_at                 : U8 ( Buffer, pos: Number )  --> returns byte at given position, throws on out of range.
_buf_get_u8             : U8|Error ( Buffer, pos: Number )  --> gets an U8 from buffer at given position, returns Error on failure.
_buf_get_u16            : U64|Error ( Buffer, pos: Number ) --> gets an U16 as U64 from buffer at given position, returns Error on failure.
_buf_get_u32            : U64|Error ( Buffer, pos: Number ) --> gets an U32 as U64 from buffer at given position, returns Error on failure.
_buf_get_u64            : U64|Error ( Buffer, pos: Number ) --> gets an U64 from buffer at given position, returns Error on failure.
_buf_get_i8             : I64|Error ( Buffer, pos: Number ) --> gets an I8 as I64 from buffer at given position, returns Error on failure.
_buf_get_i16            : I64|Error ( Buffer, pos: Number ) --> gets an I16 as I64 from buffer at given position, returns Error on failure.
_buf_get_i32            : I64|Error ( Buffer, pos: Number ) --> gets an I32 as I64 from buffer at given position, returns Error on failure.
_buf_get_i64            : I64|Error ( Buffer, pos: Number ) --> gets an I64 from buffer at given position, returns Error on failure.

For all setters apply: if pos == size the buffer will grow if the capacity is big enough.

_buf_set_u8             : Bool ( Buffer, pos: Number, val: U8 )  --> sets val as U8 in buffer at given position, returns true on success.
_buf_set_u16            : Bool ( Buffer, pos: Number, val: U64 ) --> sets val as U16 in buffer at given position, returns true on success.
_buf_set_u32            : Bool ( Buffer, pos: Number, val: U64 ) --> sets val as U32 in buffer at given position, returns true on success.
_buf_set_u64            : Bool ( Buffer, pos: Number, val: U64 ) --> sets val as U64 in buffer at given position, returns true on success.
_buf_set_i8             : Bool ( Buffer, pos: Number, val: I64 ) --> sets val as I8 in buffer at given position, returns true on success.
_buf_set_i16            : Bool ( Buffer, pos: Number, val: I64 ) --> sets val as I16 in buffer at given position, returns true on success.
_buf_set_i32            : Bool ( Buffer, pos: Number, val: I64 ) --> sets val as I32 in buffer at given position, returns true on success.
_buf_set_i64            : Bool ( Buffer, pos: Number, val: I64 ) --> sets val as I64 in buffer at given position, returns true on success.
_buf_set_string         : Bool ( Buffer, pos: Number, val: String )  --> writes the String (_without_ trailing 0!) val into the buffer 
                                                                     at given position, returns true on success.
_buf_get_string         : String|Error ( Buffer, pos: Number, len: Number )  --> gets a String from buffer at given position, 
                                                                     must be valid UTF-8, returns Error on failure.
_buf_get_ascii          : String|Error ( Buffer, pos: Number, len: Number )  --> gets a String from buffer at given position, 
                                                                     all values must be in range [0,127], returns Error on failure.


=== Known Issues ===
--------------------

Please see Known_Issues.txt

=== Breaking changes and deprecation ===

Please see Deprecation_and_Breaking_Changes.txt
