/Develop/Projects/Vcc/ |
|
k1.spdns.de / Develop / Projects / Vcc / |
intro | invocation | preprocessor | types | functions | operators | instructions
List of known functions.
Note: 'T' is frequently used to represent multiple types.
'[' .. ']' enclose optional arguments. (Caveat: Sometimes they stand for itself, e.g. in array types.)
All integer functions are defined for int8 to int64 and uint8 to uint64 except if stated otherwise.
Numeric sign of signed int.
Absolute value of a signed int. The returned value is an unsigned int of the same size.
Minimum value of 2 or 3 values;
Maximum value of 2 or 3 values;
Revert bytes of an integer number. Obviously not for int8 or uint8.
Reorder bytes of an integer number from or to hi-to-low byte order.
This is NOP on a Big-Endian machine (PPC, 68k) and swap on Little Endian (i386).
The 'hilo' byte order is the 'internet byte order'.
Use 'hilo' if you read from / write to files or streams or arrays which will be written to / read from streams or arrays which use this byte order.
Obviously not for int8 or uint8.
Reorder bytes of an integer number from or to low-to-high byte order.
This is NOP on a Little Endian machine (i386) and swap on Big-Endian (PPC, 68k).
Use 'lohi' if you read from / write to files or streams or arrays which will be written to / read from streams or arrays which use this byte order.
Obviously not for int8 or uint8.
Flip bits in unsigned integers.
Raise a 32 or 64bit integer to the power of n.
Retrieve a random number in range [0 .. [n.
This function is defined for uint32 and uint64.
All functions are defined for float32, float64 and float128.
Numeric sign of float value.
Absolute (positive) value of float value.
Minimum value of 2 or 3 values;
Maximum value of 2 or 3 values;
Round to nearest.
Round down.
Round up.
Integer portion of value. (The part before the decimal dot.)
Fractional portion of value. (The part after the decimal dot.)
Random Number in range [0 .. [1.
Random Number in range [0 .. [n.
Mathematical function.
Mathematical function.
Mathematical function.
Mathematical function.
Mathematical function.
Mathematical function.
Mathematical function.
Mathematical function.
Mathematical function.
10 raised to the power of n. n may be fractional.
2 raised to the power of n. n may be fractional.
ec (Euler's constant) raised to the power of n. n may be fractional.
Note: Const float ec is defined in stdc.h.
base raised to the power of n. n may be fractional.
Logarithm of n for base 10. This is the reverse function to exp10.
Logarithm of n for base 2. This is the reverse function to exp10.
Logarithm of n for base ec (Euler's constant). This is the reverse function to exp10.
Logarithm of n for base base. This is the reverse function to exp10.
Same as exp(base,n) except that n is an integer value. Present to complement the integer pow() functions.
Square root of value. Same as exp(n,0.5).
Binary mantissa of floating point number. This is a value in range [0.5 .. [1.0.
n = n.mant() << n.exp().
Binary exponent of floating point number.
n = n.mant() << n.exp().
Create substring.
Create substring.
Create substring.
Create a string entirely filled with char c. If c is omitted, space 0x20 is assumed.
Note: Strings are created like all other arrays filled with char 0x00!
Create a string which consists only of character c.
Convert n modulo 16 into a hexadecimal character.
Convert integer number into a hexadecimal representation.
Convert integer or floating point number into a decimal representation. The exact format of the resulting string depends on the numeric type.
Convert string into a number. The string is parsed until a void character is encountered or the end is reached.
Note that you must define the required result type in the call, e.g.:
float f = (float)numval(mystring)
Return the lexically smaller string.
Note: The string is returned 'by ident'.
Find the lexically smallest string in an array.
Note: The string is returned 'by ident'.
Return the lexically larger string.
Note: The string is returned 'by ident'.
Find the lexically largest string in an array.
Note: The string is returned 'by ident'.
Get the user-readable text for a system error code.
Get the user-readable text for the system error code in errno.
The following functions are defined for
int8[] == utf8str
uint8[] == ucs1str
uint16[] == ucs2str
uint32[] == ucs4str
The standard str is probably an int8[].
Join array of strings into a single string concatenating them with character c.
Join array of strings into a single string concatenating them with string s.
Split string at every occurance of character c into an array of strings. If the character c occurs n times then the resulting array will contain n+1 strings.
Split string at every occurance of string s into an array of strings. If the string s occurs n times then the resulting array will contain n+1 strings.
Convert source string to utf8str.
Convert source string to ucs1str.
Convert source string to ucs1str.
Convert source string to ucs1str.
Convert source string to uppercase.
Convert source string to lowercase.
Escape control codes and special characters. The rightquote character is escaped too. Set to 0x00 if not needed.
Unescape an escaped string.
File access functions use a file descriptor FD:
enum FD = { stdin,stdout,stderr }
Test whether string matches a filesystem-wildchar-style pattern.
enum{
fnm_pathname = 0x02, // directory separators must match directly
fnm_nohidden = 0x04, // match starting dots only with explicit dots in pattern
fnm_casefold = 0x10 // compare case-insensitive
}
Convert user-supplied path into a fully normalized path. Sets misc. errors.
enum{
f_follow_symlink = 1, // don't deref symlink in last path component
f_create_path = 2 // auto create path as you go
}
Determine file type of a file system entry.
enum int8 s_type =
{
s_none = -1,
s_unkn = 0, // DT_UNKNOWN
s_any = 0, // used for selecting files by type
s_pipe = 1, // DT_FIFO
s_tty = 2, // DT_CHR
s_dir = 4, // DT_DIR
s_block = 6, // DT_BLK
s_file = 8, // DT_REG
s_link = 10, // DT_LNK
s_sock = 12, // DT_SOCK
s_null = 14 // DT_WHT
}
Convenience function to test whether a file is a regular file. Resolves symlink.
Convenience function to test whether a file is a directory. Resolves symlink.
Convenience function to test whether a file is a symbolic link.
Retrieve struct with info about a file.
Read directory. Returns an array of file infos. The supplied path may contain wildcards for the file names. (not for the path to the directory.)
type FileInfo =
{
int8* filename; // "file_or_subdirectory_name"
uint16 filetype; // mode_t: file type
uint16 permissions;// mode_t: permissions
uint16 user; // uid_t: user id
uint16 group; // gid_t: group id
uint64 count; // file length or num files in dir
float64 ctime; // t_time last modification of meta data
float64 mtime; // t_time last modification of contents
float64 atime; // t_time last access
};
Rename or move a file within a file system. Set replace to yes to overwrite any file at the destination location.
Swap two files which must be on the same physical file system.
Create a path for a file which can be renamed to the supplied destination file.
Create and open a temp file. The file is automatically removed when closed.
Read file into a int8 array.
Read link.
Create file from int8 array. Default for how is 'w' (write/overwrite). Default for mode is 6<<6+6<<3 (r/w for owner and group).
Create a symbolic link at path pointing to destination.
Create directory. Default for mode is 7<<6+7<<3 (r/w/x for owner and group).
Remove regular file, empty directory or any special file, except links. Resolves symlink.
Nothing is done if errno is set!
Remove symlink.
Nothing is done if errno is set!
Remove a directory and all files inside. If fulltree=yes then subdirectories are removed recursively.
If files or directories cannot be removed rmvdir resumes but will fail to remove the final directory.
Nothing is done if errno is set!
Open regular file or special file. Resolves symlink.
Values for mode are:
'r' - file is opened for reading, must exist
'w' - file is opened for writing, created if n.ex.
'rw' - file is opened for reading and writing, created if n.ex.
'a' - file is opened for writing in 'append' mode, created if n.ex.
'n' - file is created and opened for writing, must not exist
close the file.
Get the current read/write position.
Get the current file length.
Move read/write position.
Truncate file at current read/write position.
Print string to file. Numeric values are converted to string.
Write a single character to file or stream.
Read a single character from file or stream.
Write Numeric value in it's binary representation to file. Use functions HiLo() or LoHi() if required.
Write string to file.
Read Numeric value in it's binary representation from file. Use functions HiLo() or LoHi() if required.
Read string from file. strings are delimited by 0x00, '\n' or '\r'. The delimiter is not included in the string.
Test whether UCS4 character is a letter.
Test whether UCS4 character is a digit.
Test whether UCS4 character is a decimal digit.
Test whether UCS4 character is a hexadecimal digit.
Calculate the digit value of a digit charatcer. No checking. Trash in - trash out. Up to base 36.
Copy raw memory.
Clear raw memory with filler.
Clear raw memory with 0x00.
Allocate memory for struct or array. The memory is cleared with 0x00. Does not call init().
Allocate & copy memory of struct or array. Flat copy, does not call copy().
Deallocate memory of struct or array and set variable to null. Does not call kill().
Abort with "Abort:" + message. Implemented in lib/stdc.cpp.
Abort with message "TODO". Implemented in lib/stdc.cpp.
Abort with "Panic:" + message. Implemented in lib/stdc.cpp.
Test condition and resume if true.
Else abort with an error message indication file, line and failed condition.
asserts are only compiled in if the macro DEBUG is defined and not defined as 0. This is typically done on the command line with the option -DDEBUG. Else no code is generated.
It is an error to put code with side effects (like 'i++') in an assert.
until next event
Name | Letzte Änderung | Länge | |||
---|---|---|---|---|---|
lib-Z80-Rop/ | 2020-11-30 15:50 | 21 | |||
lib-Z80-Vss/ | 2017-11-12 09:55 | 452 | |||
lib/ | 2019-10-30 17:02 | 3 | |||
Libraries/ | 2019-10-30 17:11 | 6 | |||
OSX-Qt40/ | 2019-10-30 17:02 | 5 | |||
OSX/ | 2020-09-05 12:54 | 6 | |||
Source/ | 2019-10-30 17:02 | 11 | |||
Tests/ | 2019-10-30 17:02 | 9 | |||
LICENSE | 2019-10-30 17:25 | 1323 | |||
README.md | 2019-10-30 17:25 | 288 | |||
TODO.txt | 2020-10-18 12:42 | 340 |