Adaptive Framework  0.9.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Functions | Variables

Functions

const afw_value_tafw_function_execute_close (afw_function_execute_t *x)
 Adaptive Function close More...
 
const afw_value_tafw_function_execute_flush (afw_function_execute_t *x)
 Adaptive Function flush More...
 
const afw_value_tafw_function_execute_get_stream_error (afw_function_execute_t *x)
 Adaptive Function get_stream_error More...
 
const afw_value_tafw_function_execute_open_file (afw_function_execute_t *x)
 Adaptive Function open_file More...
 
const afw_value_tafw_function_execute_open_response (afw_function_execute_t *x)
 Adaptive Function open_response More...
 
const afw_value_tafw_function_execute_open_uri (afw_function_execute_t *x)
 Adaptive Function open_uri More...
 
const afw_value_tafw_function_execute_print (afw_function_execute_t *x)
 Adaptive Function print More...
 
const afw_value_tafw_function_execute_println (afw_function_execute_t *x)
 Adaptive Function println More...
 
const afw_value_tafw_function_execute_read (afw_function_execute_t *x)
 Adaptive Function read More...
 
const afw_value_tafw_function_execute_read_to_base64Binary (afw_function_execute_t *x)
 Adaptive Function read_to_base64Binary More...
 
const afw_value_tafw_function_execute_read_to_hexBinary (afw_function_execute_t *x)
 Adaptive Function read_to_hexBinary More...
 
const afw_value_tafw_function_execute_readln (afw_function_execute_t *x)
 Adaptive Function readln More...
 
const afw_value_tafw_function_execute_stream (afw_function_execute_t *x)
 Adaptive Function stream More...
 
const afw_value_tafw_function_execute_write (afw_function_execute_t *x)
 Adaptive Function write More...
 
const afw_value_tafw_function_execute_write_internal (afw_function_execute_t *x)
 Adaptive Function write_internal More...
 
const afw_value_tafw_function_execute_writeln (afw_function_execute_t *x)
 Adaptive Function writeln More...
 

Variables

 afw_function_definition_close
 Function definition close.
 
 afw_function_definition_flush
 Function definition flush.
 
 afw_function_definition_get_stream_error
 Function definition get_stream_error.
 
 afw_function_definition_open_file
 Function definition open_file.
 
 afw_function_definition_open_response
 Function definition open_response.
 
 afw_function_definition_open_uri
 Function definition open_uri.
 
 afw_function_definition_print
 Function definition print.
 
 afw_function_definition_println
 Function definition println.
 
 afw_function_definition_read
 Function definition read.
 
 afw_function_definition_read_to_base64Binary
 Function definition read_to_base64Binary.
 
 afw_function_definition_read_to_hexBinary
 Function definition read_to_hexBinary.
 
 afw_function_definition_readln
 Function definition readln.
 
 afw_function_definition_stream
 Function definition stream.
 
 afw_function_definition_write
 Function definition write.
 
 afw_function_definition_write_internal
 Function definition write_internal.
 
 afw_function_definition_writeln
 Function definition writeln.
 

Detailed Description

stream adaptive functions.

Function Documentation

◆ afw_function_execute_close()

const afw_value_t* afw_function_execute_close ( afw_function_execute_t x)

Adaptive Function close

Parameters
xfunction execute parameter.

This will close an open stream

This function is not pure, so it may return a different result given exactly the same parameters and has side effects.

Declaration:

function close(
streamNumber: integer
): null;

Parameters:

streamNumber - (integer) The streamNumber for the stream to close.

Returns:

(null)

Todo:
FIXME: Haven't decided what to do about bad number.

Definition at line 354 of file afw_function_stream.c.

◆ afw_function_execute_flush()

const afw_value_t* afw_function_execute_flush ( afw_function_execute_t x)

Adaptive Function flush

Parameters
xfunction execute parameter.

Write the content of the stream's buffers to its destination.

This function is not pure, so it may return a different result given exactly the same parameters and has side effects.

Declaration:

function flush(
streamNumber: integer
): null;

Parameters:

streamNumber - (integer) The streamNumber for the stream to flush.

Returns:

(null)

Todo:
FIXME: Haven't decided what to do about bad number.

Definition at line 47 of file afw_function_stream.c.

◆ afw_function_execute_get_stream_error()

const afw_value_t* afw_function_execute_get_stream_error ( afw_function_execute_t x)

Adaptive Function get_stream_error

Parameters
xfunction execute parameter.

Get the most recent stream error.

This function is not pure, so it may return a different result given exactly the same parameters.

Declaration:

function get_stream_error(
): string;

Parameters:

Returns:

(string) The most recent stream error.

Definition at line 401 of file afw_function_stream.c.

◆ afw_function_execute_open_file()

const afw_value_t* afw_function_execute_open_file ( afw_function_execute_t x)

Adaptive Function open_file

Parameters
xfunction execute parameter.

This will open a file stream.

This function is not pure, so it may return a different result given exactly the same parameters and has side effects.

Declaration:

function open_file(
streamId: string,
path: string,
mode: string,
autoFlush?: boolean
): integer;

Parameters:

streamId - (string) This is the streamId that will be associated with this open file stream.

path - (string) This is the path to the file to open. The rootDirectory of the path is defined in the application object.

mode - (string) This is the access mode string. Values can be: r - Open an existing file text file for read. w - Open a text file for writing. If the file does not exist, it will be created. a - Open a text file for writing additional data to the end. If the file does not exist, it will be created. r+ - Open a text file for both reading and writing. w+ - Open a text file for both reading and writing. If the file exists, it will be overwritten. If the file does not exist, it will be created. a+ - Open a text file for both reading and writing. Reading will begin at the start of the file while writing will be appended to the end.

All of these modes expect data type string. If you are using data type base64Binary or hexBinary you can use corresponding binary modes, "rb", "wb", "ab", "rb+", "r+b", "wb+", "w+b", "ab+", and "a+b".

autoFlush - (optional boolean) If specified and true, this will automatically flush the stream's buffers after every write.

Returns:

(integer) The streamNumber for the streamId or -1 if there was an error. Use get_stream_error() for error information.

Definition at line 473 of file afw_function_stream.c.

◆ afw_function_execute_open_response()

const afw_value_t* afw_function_execute_open_response ( afw_function_execute_t x)

Adaptive Function open_response

Parameters
xfunction execute parameter.

This will open a response text write-only stream that will be written to the http response.

This function is not pure, so it may return a different result given exactly the same parameters and has side effects.

Declaration:

function open_response(
streamId: string,
autoFlush?: boolean
): integer;

Parameters:

streamId - (string) This is the streamId that will be associated with this open response stream.

autoFlush - (optional boolean) If specified and true, this will automatically flush the stream's buffers after every write.

Returns:

(integer) The streamNumber for the streamId or -1 if there was an error. Use get_stream_error() for error information.

Definition at line 552 of file afw_function_stream.c.

◆ afw_function_execute_open_uri()

const afw_value_t* afw_function_execute_open_uri ( afw_function_execute_t x)

Adaptive Function open_uri

Parameters
xfunction execute parameter.

This will open a read or write stream for a URI.

This function is not pure, so it may return a different result given exactly the same parameters and has side effects.

Declaration:

function open_uri(
streamId: string,
uri: string,
mode: string,
autoFlush?: boolean
): integer;

Parameters:

streamId - (string) This is the streamId that will be associated with this open URI stream.

uri - (string) This is the URI of the stream to open.

mode - (string) This is the access mode string. Values can be "r" for read or "w" for write.

autoFlush - (optional boolean) If specified and true, this will automatically flush the stream's buffers after every write.

Returns:

(integer) The streamNumber for the streamId or -1 if there was an error. Use get_stream_error() for error information.

Todo:
FIXME: Add code.

Definition at line 624 of file afw_function_stream.c.

◆ afw_function_execute_print()

const afw_value_t* afw_function_execute_print ( afw_function_execute_t x)

Adaptive Function print

Parameters
xfunction execute parameter.

Evaluate and convert 0 or more values to its string value, then write them to stdout. An undefined value is represented by <undefined>.

This function is not pure, so it may return a different result given exactly the same parameters and has side effects.

Declaration:

function print(
...values: (list of any)
): null;

Parameters:

values - (0 or more any dataType) Values to print.

Returns:

(null)

Definition at line 98 of file afw_function_stream.c.

◆ afw_function_execute_println()

const afw_value_t* afw_function_execute_println ( afw_function_execute_t x)

Adaptive Function println

Parameters
xfunction execute parameter.

Evaluate and convert 0 or more values to their string value, then write them to stdout. A newline character ('
') is written after the last value. An undefined value is represented by <undefined>.

This function is not pure, so it may return a different result given exactly the same parameters and has side effects.

Declaration:

function println(
...value: (list of any)
): null;

Parameters:

value - (0 or more any dataType) Values to print.

Returns:

(null)

Definition at line 157 of file afw_function_stream.c.

◆ afw_function_execute_read()

const afw_value_t* afw_function_execute_read ( afw_function_execute_t x)

Adaptive Function read

Parameters
xfunction execute parameter.

Read a UTF-8 text stream up to a specified number of octets. The stream must contain valid UTF-8 or an error is thrown.

This function is not pure, so it may return a different result given exactly the same parameters and has side effects.

Declaration:

function read(
streamNumber: integer,
n: any
): string;

Parameters:

streamNumber - (integer) Stream number.

n - (any dataType) The maximum number of octets to read.

Returns:

(string) The UTF-8 string read. Check the size of this value to determine the actual number of octets read.

Todo:
FIXME: Add code.

Definition at line 667 of file afw_function_stream.c.

◆ afw_function_execute_read_to_base64Binary()

const afw_value_t* afw_function_execute_read_to_base64Binary ( afw_function_execute_t x)

Adaptive Function read_to_base64Binary

Parameters
xfunction execute parameter.

Read a stream up to a specified number of octets. The result will be the internal memory of a base64Binary value.

This function is not pure, so it may return a different result given exactly the same parameters and has side effects.

Declaration:

function read_to_base64Binary(
streamNumber: integer,
n: any
): base64Binary;

Parameters:

streamNumber - (integer) Stream number.

n - (any dataType) The maximum number of octets to read.

Returns:

(base64Binary) The base64Binary value read. Check the size of this value to determine the actual number of octets read.

Todo:
FIXME: Add code.

Definition at line 710 of file afw_function_stream.c.

◆ afw_function_execute_read_to_hexBinary()

const afw_value_t* afw_function_execute_read_to_hexBinary ( afw_function_execute_t x)

Adaptive Function read_to_hexBinary

Parameters
xfunction execute parameter.

Read a stream up to a specified number of octets. The result will be the internal memory of a hexBinary value.

This function is not pure, so it may return a different result given exactly the same parameters and has side effects.

Declaration:

function read_to_hexBinary(
streamNumber: integer,
n: any
): hexBinary;

Parameters:

streamNumber - (integer) Stream number.

n - (any dataType) The maximum number of octets to read.

Returns:

(hexBinary) The hexBinary value read. Check the size of this value to determine the actual number of octets read.

Todo:
FIXME: Add code.

Definition at line 753 of file afw_function_stream.c.

◆ afw_function_execute_readln()

const afw_value_t* afw_function_execute_readln ( afw_function_execute_t x)

Adaptive Function readln

Parameters
xfunction execute parameter.

Read a UTF-8 text stream line. The stream must contain valid UTF-8 or an error is thrown.

This function is not pure, so it may return a different result given exactly the same parameters and has side effects.

Declaration:

function readln(
streamNumber: integer
): string;

Parameters:

streamNumber - (integer) Stream number.

Returns:

(string) The UTF-8 string read.

Todo:
FIXME: Add code.

Definition at line 792 of file afw_function_stream.c.

◆ afw_function_execute_stream()

const afw_value_t* afw_function_execute_stream ( afw_function_execute_t x)

Adaptive Function stream

Parameters
xfunction execute parameter.

This will return the streamNumber for a streamId. This function useful to obtain the number of the automatically opened standard streams "console", "stderr" and "stdout" as well and any other open stream.

This function is not pure, so it may return a different result given exactly the same parameters.

Declaration:

function stream(
streamId: string
): integer;

Parameters:

streamId - (string) The id of a stream.

Returns:

(integer) The streamNumber for the streamId or -1 if there was an error. Use get_stream_error() for error information.

Definition at line 833 of file afw_function_stream.c.

◆ afw_function_execute_write()

const afw_value_t* afw_function_execute_write ( afw_function_execute_t x)

Adaptive Function write

Parameters
xfunction execute parameter.

Evaluate and convert 0 or more values to its string value, then write them to stream. An value with an undefined value is represented by <undefined>.

This function is not pure, so it may return a different result given exactly the same parameters and has side effects.

Declaration:

function write(
streamNumber: integer,
...value: (list of any)
): null;

Parameters:

streamNumber - (integer) The streamNumber for the stream to write.

value - (0 or more any) Values to write as their string value.

Returns:

(null)

Todo:
FIXME: Haven't decided what to do about bad number.

Definition at line 219 of file afw_function_stream.c.

◆ afw_function_execute_write_internal()

const afw_value_t* afw_function_execute_write_internal ( afw_function_execute_t x)

Adaptive Function write_internal

Parameters
xfunction execute parameter.

Write a value's internal memory. This is especially useful for writing data type base64Binary and hexBinary.

This function is not pure, so it may return a different result given exactly the same parameters and has side effects.

Declaration:

function write_internal(
streamNumber: integer,
value: any
): null;

Parameters:

streamNumber - (integer) The streamNumber for the stream to write.

value - (any) The internal memory of this value is written.

Returns:

(null)

Todo:
FIXME: Add code.

Definition at line 889 of file afw_function_stream.c.

◆ afw_function_execute_writeln()

const afw_value_t* afw_function_execute_writeln ( afw_function_execute_t x)

Adaptive Function writeln

Parameters
xfunction execute parameter.

Evaluate and convert 0 or more values to its string value, then write them to stream. A newline character ('
') is written after the last value. An undefined value is represented by <undefined>.

This function is not pure, so it may return a different result given exactly the same parameters and has side effects.

Declaration:

function writeln(
streamNumber: integer,
...value: (list of any)
): null;

Parameters:

streamNumber - (integer) The streamNumber for the stream to write.

value - (0 or more any dataType) Values to write.

Returns:

(null)

Todo:
FIXME: Haven't decided what to do about bad number.

Definition at line 289 of file afw_function_stream.c.