The core component provides the basic facilities that are required for all other components to work. It primarily addresses three things:
- C runtime/host system interface (printf, exit)
- Visualization framework, where appropriate
- Testing API for creating unit tests
|
void | PTK_init (PTK_CRT *crt) |
| This function initializes the library with the given list of function pointers to functions that provide the C runtime library functions. The most basic requirement is that exit be available, but the remaining members are optional. More...
|
|
void | PTK_exit (int status) |
| This performs an immediate exit of the entire task, which typically will also kill all other threads running. It should only be used when an unrecoverable error has been detected. The status code may or may not be useful on all systems, but it is required per the C standard library specification. More...
|
|
void | PTK_printf (const char *fmt,...) |
| If printf was configured, this formats the given string and prints it appropriately. Otherwise, it does nothing. More...
|
|
uint64_t | PTK_getTime () |
| If available, this obtains the real time in microseconds since a some reference point in the past. This reference point may not change during a single program's execution, but it may be reset, e.g. to 0 or another constant, whenever the program is restarted. More...
|
|
◆ PTK_init()
This function initializes the library with the given list of function pointers to functions that provide the C runtime library functions. The most basic requirement is that exit be available, but the remaining members are optional.
- Parameters
-
[in] | crt | Contains a list of function pointers for available C runtime behavior |
◆ PTK_exit()
void PTK_exit |
( |
int |
status | ) |
|
This performs an immediate exit of the entire task, which typically will also kill all other threads running. It should only be used when an unrecoverable error has been detected. The status code may or may not be useful on all systems, but it is required per the C standard library specification.
- Parameters
-
[in] | status | Status code indicating reason for exit |
◆ PTK_printf()
void PTK_printf |
( |
const char * |
fmt, |
|
|
|
... |
|
) |
| |
If printf was configured, this formats the given string and prints it appropriately. Otherwise, it does nothing.
- Parameters
-
[in] | fmt | Format string for printing |
[in] | ... | Variable arguments for values to be printed in the format string |
◆ PTK_getTime()
If available, this obtains the real time in microseconds since a some reference point in the past. This reference point may not change during a single program's execution, but it may be reset, e.g. to 0 or another constant, whenever the program is restarted.
- Returns
- Time in microseconds