Reload Script
Table of contents
yt_run_ReloadScript
int yt_run_ReloadScript(const char* flag_file_name, const char* reload_file_name, const char* script_name);
- Usage: Start reloading script phase when
<flag_file_name>file is detected, or an error occurred when running inline functions.libytstarts reloading the script<script_name>if<reload_file_name>file is detected, and it exits the API if<reload_file_name>_EXITfile is detected. Outputs will be printed in<reload_file_name>_SUCCESSor<reload_file_name>_FAILED. - Return:
YT_SUCCESS-
YT_FAIL: Whenlibytis not compiled with-DINTERACTIVE_MODE, it returnsYT_FAIL.
Must compile
libytwith-DINTERACTIVE_MODE.
Example
The code will stop and enter reloading script phase, if LIBYT_STOP is detected or an inline function failed. It will reload test_reload.py when detected RELOAD, and it will exit the API once RELOAD_EXIT is detected. Output results will be printed in <reload_file_name>_SUCCESS or <reload_file_name>_FAILED. See Reloading Script for details.
#include "libyt.h"
...
if (yt_run_ReloadScript("LIBYT_STOP", "RELOAD", "test_reload.py") != YT_SUCCESS) {
fprintf(stderr, "ERROR: yt_run_ReloadScript failed!\n");
exit(EXIT_FAILURE);
}