From 274a3d7668d5c01ca82c9055300b3a5213d04d4d Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Thu, 28 Mar 2024 23:14:39 -0500 Subject: [PATCH] Progress: Synchronize changes with recent develpments and remove accidentally committed build data. --- .gitignore | 1 + bootstrap.sh | 583 +++++++++++---------- build/documentation/man/man1/controller.1 | 102 ---- build/documentation/man/man5/controller-actions.5 | 89 ---- build/documentation/man/man5/controller-entry.5 | 352 ------------- build/documentation/man/man5/controller-exit.5 | 283 ---------- build/documentation/man/man5/controller-packet.5 | 140 ----- build/documentation/man/man5/controller-rule.5 | 245 --------- build/includes/program/controller/main/common.h | 48 -- .../program/controller/main/common/define.h | 55 -- .../program/controller/main/common/enumeration.h | 100 ---- .../program/controller/main/common/print.h | 53 -- .../program/controller/main/common/string.h | 83 --- .../includes/program/controller/main/common/type.h | 138 ----- .../includes/program/controller/main/controller.h | 73 --- .../includes/program/controller/main/print/data.h | 23 - .../includes/program/controller/main/print/debug.h | 23 - .../includes/program/controller/main/print/error.h | 45 -- .../program/controller/main/print/message.h | 51 -- .../program/controller/main/print/verbose.h | 23 - .../program/controller/main/print/warning.h | 23 - build/includes/program/controller/main/signal.h | 86 --- build/includes/program/controller/main/thread.h | 46 -- build/stage/skeleton-settings.built | 0 build/stage/sources_documentation-settings.built | 0 build/stage/sources_headers-settings.built | 0 build/stage/sources_settings-settings.built | 0 27 files changed, 313 insertions(+), 2352 deletions(-) delete mode 100644 build/documentation/man/man1/controller.1 delete mode 100644 build/documentation/man/man5/controller-actions.5 delete mode 100644 build/documentation/man/man5/controller-entry.5 delete mode 100644 build/documentation/man/man5/controller-exit.5 delete mode 100644 build/documentation/man/man5/controller-packet.5 delete mode 100644 build/documentation/man/man5/controller-rule.5 delete mode 100644 build/includes/program/controller/main/common.h delete mode 100644 build/includes/program/controller/main/common/define.h delete mode 100644 build/includes/program/controller/main/common/enumeration.h delete mode 100644 build/includes/program/controller/main/common/print.h delete mode 100644 build/includes/program/controller/main/common/string.h delete mode 100644 build/includes/program/controller/main/common/type.h delete mode 100644 build/includes/program/controller/main/controller.h delete mode 100644 build/includes/program/controller/main/print/data.h delete mode 100644 build/includes/program/controller/main/print/debug.h delete mode 100644 build/includes/program/controller/main/print/error.h delete mode 100644 build/includes/program/controller/main/print/message.h delete mode 100644 build/includes/program/controller/main/print/verbose.h delete mode 100644 build/includes/program/controller/main/print/warning.h delete mode 100644 build/includes/program/controller/main/signal.h delete mode 100644 build/includes/program/controller/main/thread.h delete mode 100644 build/stage/skeleton-settings.built delete mode 100644 build/stage/sources_documentation-settings.built delete mode 100644 build/stage/sources_headers-settings.built delete mode 100644 build/stage/sources_settings-settings.built diff --git a/.gitignore b/.gitignore index 84c048a..9179c91 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /build/ +/build/* diff --git a/bootstrap.sh b/bootstrap.sh index a5c7550..5d18f42 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -461,7 +461,7 @@ bootstrap_main() { echo -e "${c_highlight}Building:${c_reset} ${c_notice}${project_label}${c_highlight} with modes: ${c_notice}${modes}${c_highlight}.${c_reset}" fi - if [[ ! -f ${project_built}.prepared ]] ; then + if [[ ! -f ${project_built}-${settings_name}.prepared ]] ; then bootstrap_prepare_build if [[ ${?} -ne 0 ]] ; then @@ -679,159 +679,175 @@ bootstrap_id() { "path_program_shared") let key=69;; "path_program_static") let key=70;; "path_sources") let key=71;; - "path_sources_object") let key=72;; - "preserve_path_headers") let key=73;; - "process_post") let key=74;; - "process_pre") let key=75;; - "search_exclusive") let key=76;; - "search_shared") let key=77;; - "search_static") let key=78;; - "version_file") let key=79;; - "version_major") let key=80;; - "version_major_prefix") let key=81;; - "version_micro") let key=82;; - "version_micro_prefix") let key=83;; - "version_minor") let key=84;; - "version_minor_prefix") let key=85;; - "version_nano") let key=86;; - "version_nano_prefix") let key=87;; - "version_target") let key=88;; - - "build_compiler-mode") let key=89;; - "build_indexer-mode") let key=90;; - "build_indexer_arguments-mode") let key=91;; - "build_language-mode") let key=92;; - "build_libraries-mode") let key=93;; - "build_libraries_shared-mode") let key=94;; - "build_libraries_static-mode") let key=95;; - "build_name-mode") let key=96;; - "build_objects_library-mode") let key=97;; - "build_objects_library_shared-mode") let key=98;; - "build_objects_library_static-mode") let key=99;; - "build_objects_program-mode") let key=100;; - "build_objects_program_shared-mode") let key=101;; - "build_objects_program_static-mode") let key=102;; - "build_script-mode") let key=103;; - "build_shared-mode") let key=104;; - "build_sources_documentation-mode") let key=105;; - "build_sources_headers-mode") let key=106;; - "build_sources_headers_shared-mode") let key=107;; - "build_sources_headers_static-mode") let key=108;; - "build_sources_library-mode") let key=109;; - "build_sources_library_shared-mode") let key=110;; - "build_sources_library_static-mode") let key=111;; - "build_sources_object-mode") let key=112;; - "build_sources_object_shared-mode") let key=113;; - "build_sources_object_static-mode") let key=114;; - "build_sources_program-mode") let key=115;; - "build_sources_program_shared-mode") let key=116;; - "build_sources_program_static-mode") let key=117;; - "build_sources_script-mode") let key=118;; - "build_sources_setting-mode") let key=119;; - "build_static-mode") let key=120;; - "defines-mode") let key=121;; - "defines_library-mode") let key=122;; - "defines_library_shared-mode") let key=123;; - "defines_library_static-mode") let key=124;; - "defines_object-mode") let key=125;; - "defines_object_shared-mode") let key=126;; - "defines_object_static-mode") let key=127;; - "defines_program-mode") let key=128;; - "defines_program_shared-mode") let key=129;; - "defines_program_static-mode") let key=130;; - "defines_shared-mode") let key=131;; - "defines_static-mode") let key=132;; - "environment-mode") let key=133;; - "flags-mode") let key=134;; - "flags_library-mode") let key=135;; - "flags_library_shared-mode") let key=136;; - "flags_library_static-mode") let key=137;; - "flags_object-mode") let key=138;; - "flags_object_shared-mode") let key=139;; - "flags_object_static-mode") let key=140;; - "flags_program-mode") let key=141;; - "flags_program_shared-mode") let key=142;; - "flags_program_static-mode") let key=143;; - "flags_shared-mode") let key=144;; - "flags_static-mode") let key=145;; - "has_path_standard-mode") let key=146;; - "path_headers-mode") let key=147;; - "path_language-mode") let key=148;; - "path_library_script-mode") let key=149;; - "path_library_shared-mode") let key=150;; - "path_library_static-mode") let key=151;; - "path_object_script-mode") let key=152;; - "path_object_shared-mode") let key=153;; - "path_object_static-mode") let key=154;; - "path_program_script-mode") let key=155;; - "path_program_shared-mode") let key=156;; - "path_program_static-mode") let key=157;; - "path_sources-mode") let key=158;; - "path_sources_object-mode") let key=159;; - "preserve_path_headers-mode") let key=160;; - "process_post-mode") let key=161;; - "process_pre-mode") let key=162;; - "search_exclusive-mode") let key=163;; - "search_shared-mode") let key=164;; - "search_static-mode") let key=165;; - "version_file-mode") let key=166;; - "version_major-mode") let key=167;; - "version_major_prefix-mode") let key=168;; - "version_micro-mode") let key=169;; - "version_micro_prefix-mode") let key=170;; - "version_minor-mode") let key=171;; - "version_minor_prefix-mode") let key=172;; - "version_nano-mode") let key=173;; - "version_nano_prefix-mode") let key=174;; - "version_target-mode") let key=175;; - - "has-build_compiler") let key=176;; - "has-build_indexer") let key=177;; - "has-build_indexer_arguments") let key=178;; - "has-build_name") let key=179;; - "has-has_path_standard") let key=180;; - "has-path_library_script") let key=181;; - "has-path_library_shared") let key=182;; - "has-path_library_static") let key=183;; - "has-path_object_script") let key=184;; - "has-path_object_shared") let key=185;; - "has-path_object_static") let key=186;; - "has-path_program_script") let key=187;; - "has-path_program_shared") let key=188;; - "has-path_program_static") let key=189;; - "has-path_sources") let key=190;; - "has-path_sources_object") let key=191;; - "has-search_exclusive") let key=192;; - "has-search_shared") let key=193;; - "has-search_static") let key=194;; - "has-version_major_prefix") let key=195;; - "has-version_micro_prefix") let key=196;; - "has-version_minor_prefix") let key=197;; - "has-version_nano_prefix") let key=198;; - - "has-build_compiler-mode") let key=199;; - "has-build_indexer-mode") let key=200;; - "has-build_indexer_arguments-mode") let key=201;; - "has-build_name-mode") let key=202;; - "has-has_path_standard-mode") let key=203;; - "has-path_library_script-mode") let key=204;; - "has-path_library_shared-mode") let key=205;; - "has-path_library_static-mode") let key=206;; - "has-path_object_script-mode") let key=207;; - "has-path_object_shared-mode") let key=208;; - "has-path_object_static-mode") let key=209;; - "has-path_program_script-mode") let key=210;; - "has-path_program_shared-mode") let key=211;; - "has-path_program_static-mode") let key=212;; - "has-path_sources-mode") let key=213;; - "has-path_sources_object-mode") let key=214;; - "has-search_exclusive-mode") let key=215;; - "has-search_shared-mode") let key=216;; - "has-search_static-mode") let key=217;; - "has-version_major_prefix-mode") let key=218;; - "has-version_micro_prefix-mode") let key=219;; - "has-version_minor_prefix-mode") let key=220;; - "has-version_nano_prefix-mode") let key=221;; + "path_sources_headers") let key=72;; + "path_sources_library") let key=73;; + "path_sources_object") let key=74;; + "path_sources_program") let key=75;; + "path_sources_script") let key=76;; + "preserve_path_headers") let key=77;; + "process_post") let key=78;; + "process_pre") let key=79;; + "search_exclusive") let key=80;; + "search_shared") let key=81;; + "search_static") let key=82;; + "version_file") let key=83;; + "version_major") let key=84;; + "version_major_prefix") let key=85;; + "version_micro") let key=86;; + "version_micro_prefix") let key=87;; + "version_minor") let key=88;; + "version_minor_prefix") let key=89;; + "version_nano") let key=90;; + "version_nano_prefix") let key=91;; + "version_target") let key=92;; + + "build_compiler-mode") let key=93;; + "build_indexer-mode") let key=94;; + "build_indexer_arguments-mode") let key=95;; + "build_language-mode") let key=96;; + "build_libraries-mode") let key=97;; + "build_libraries_shared-mode") let key=98;; + "build_libraries_static-mode") let key=99;; + "build_name-mode") let key=100;; + "build_objects_library-mode") let key=101;; + "build_objects_library_shared-mode") let key=102;; + "build_objects_library_static-mode") let key=103;; + "build_objects_program-mode") let key=104;; + "build_objects_program_shared-mode") let key=105;; + "build_objects_program_static-mode") let key=106;; + "build_script-mode") let key=107;; + "build_shared-mode") let key=108;; + "build_sources_documentation-mode") let key=109;; + "build_sources_headers-mode") let key=110;; + "build_sources_headers_shared-mode") let key=111;; + "build_sources_headers_static-mode") let key=112;; + "build_sources_library-mode") let key=113;; + "build_sources_library_shared-mode") let key=114;; + "build_sources_library_static-mode") let key=115;; + "build_sources_object-mode") let key=116;; + "build_sources_object_shared-mode") let key=117;; + "build_sources_object_static-mode") let key=118;; + "build_sources_program-mode") let key=119;; + "build_sources_program_shared-mode") let key=120;; + "build_sources_program_static-mode") let key=121;; + "build_sources_script-mode") let key=122;; + "build_sources_setting-mode") let key=123;; + "build_static-mode") let key=124;; + "defines-mode") let key=125;; + "defines_library-mode") let key=126;; + "defines_library_shared-mode") let key=127;; + "defines_library_static-mode") let key=128;; + "defines_object-mode") let key=129;; + "defines_object_shared-mode") let key=130;; + "defines_object_static-mode") let key=131;; + "defines_program-mode") let key=132;; + "defines_program_shared-mode") let key=133;; + "defines_program_static-mode") let key=134;; + "defines_shared-mode") let key=135;; + "defines_static-mode") let key=136;; + "environment-mode") let key=137;; + "flags-mode") let key=138;; + "flags_library-mode") let key=139;; + "flags_library_shared-mode") let key=140;; + "flags_library_static-mode") let key=141;; + "flags_object-mode") let key=142;; + "flags_object_shared-mode") let key=143;; + "flags_object_static-mode") let key=144;; + "flags_program-mode") let key=145;; + "flags_program_shared-mode") let key=146;; + "flags_program_static-mode") let key=147;; + "flags_shared-mode") let key=148;; + "flags_static-mode") let key=149;; + "has_path_standard-mode") let key=150;; + "path_headers-mode") let key=151;; + "path_language-mode") let key=152;; + "path_library_script-mode") let key=153;; + "path_library_shared-mode") let key=154;; + "path_library_static-mode") let key=155;; + "path_object_script-mode") let key=156;; + "path_object_shared-mode") let key=157;; + "path_object_static-mode") let key=158;; + "path_program_script-mode") let key=159;; + "path_program_shared-mode") let key=160;; + "path_program_static-mode") let key=161;; + "path_sources-mode") let key=162;; + "path_sources_headers-mode") let key=163;; + "path_sources_library-mode") let key=164;; + "path_sources_object-mode") let key=165;; + "path_sources_program-mode") let key=166;; + "path_sources_script-mode") let key=167;; + "preserve_path_headers-mode") let key=168;; + "process_post-mode") let key=169;; + "process_pre-mode") let key=170;; + "search_exclusive-mode") let key=171;; + "search_shared-mode") let key=172;; + "search_static-mode") let key=173;; + "version_file-mode") let key=174;; + "version_major-mode") let key=175;; + "version_major_prefix-mode") let key=176;; + "version_micro-mode") let key=177;; + "version_micro_prefix-mode") let key=178;; + "version_minor-mode") let key=179;; + "version_minor_prefix-mode") let key=180;; + "version_nano-mode") let key=181;; + "version_nano_prefix-mode") let key=182;; + "version_target-mode") let key=183;; + + "has-build_compiler") let key=184;; + "has-build_indexer") let key=185;; + "has-build_indexer_arguments") let key=186;; + "has-build_name") let key=187;; + "has-has_path_standard") let key=188;; + "has-path_library_script") let key=189;; + "has-path_library_shared") let key=190;; + "has-path_library_static") let key=191;; + "has-path_object_script") let key=192;; + "has-path_object_shared") let key=193;; + "has-path_object_static") let key=194;; + "has-path_program_script") let key=195;; + "has-path_program_shared") let key=196;; + "has-path_program_static") let key=197;; + "has-path_sources") let key=198;; + "has-path_sources_headers") let key=199;; + "has-path_sources_library") let key=200;; + "has-path_sources_object") let key=201;; + "has-path_sources_program") let key=202;; + "has-path_sources_script") let key=203;; + "has-search_exclusive") let key=204;; + "has-search_shared") let key=205;; + "has-search_static") let key=206;; + "has-version_major_prefix") let key=207;; + "has-version_micro_prefix") let key=208;; + "has-version_minor_prefix") let key=209;; + "has-version_nano_prefix") let key=210;; + + "has-build_compiler-mode") let key=207;; + "has-build_indexer-mode") let key=208;; + "has-build_indexer_arguments-mode") let key=209;; + "has-build_name-mode") let key=210;; + "has-has_path_standard-mode") let key=211;; + "has-path_library_script-mode") let key=212;; + "has-path_library_shared-mode") let key=213;; + "has-path_library_static-mode") let key=214;; + "has-path_object_script-mode") let key=215;; + "has-path_object_shared-mode") let key=216;; + "has-path_object_static-mode") let key=217;; + "has-path_program_script-mode") let key=218;; + "has-path_program_shared-mode") let key=219;; + "has-path_program_static-mode") let key=220;; + "has-path_sources-mode") let key=221;; + "has-path_sources_headers-mode") let key=222;; + "has-path_sources_library-mode") let key=223;; + "has-path_sources_object-mode") let key=224;; + "has-path_sources_program-mode") let key=225;; + "has-path_sources_script-mode") let key=226;; + "has-search_exclusive-mode") let key=227;; + "has-search_shared-mode") let key=228;; + "has-search_static-mode") let key=229;; + "has-version_major_prefix-mode") let key=230;; + "has-version_micro_prefix-mode") let key=231;; + "has-version_minor_prefix-mode") let key=232;; + "has-version_nano_prefix-mode") let key=233;; esac } @@ -876,7 +892,7 @@ bootstrap_load_settings() { fi # Single value Objects. - for i in build_compiler build_indexer build_language build_name build_script build_shared build_sources_object build_sources_object_shared build_sources_object_static build_static has_path_standard path_headers path_language path_library_script path_library_shared path_library_static path_object_script path_object_shared path_object_static path_program_script path_program_shared path_program_static path_sources path_sources_object preserve_path_headers process_post process_pre search_exclusive search_shared search_static version_file version_major version_major_prefix version_micro version_micro_prefix version_minor version_minor_prefix version_nano version_nano_prefix version_target ; do + for i in build_compiler build_indexer build_language build_name build_script build_shared build_sources_object build_sources_object_shared build_sources_object_static build_static has_path_standard path_headers path_language path_library_script path_library_shared path_library_static path_object_script path_object_shared path_object_static path_program_script path_program_shared path_program_static path_sources path_sources_headers path_sources_library path_sources_object path_sources_program path_sources_script preserve_path_headers process_post process_pre search_exclusive search_shared search_static version_file version_major version_major_prefix version_micro version_micro_prefix version_minor version_minor_prefix version_nano version_nano_prefix version_target ; do bootstrap_id "${i}" @@ -971,7 +987,7 @@ bootstrap_load_settings_mode() { for m in ${modes} ; do # Single value Objects. - for i in build_compiler build_indexer build_language build_name build_script build_shared build_sources_object build_sources_object_shared build_sources_object_static build_static has_path_standard path_headers path_language path_library_script path_library_shared path_library_static path_object_script path_object_shared path_object_static path_program_script path_program_shared path_program_static path_sources path_sources_object preserve_path_headers process_post process_pre search_exclusive search_shared search_static version_file version_major version_major_prefix version_micro version_micro_prefix version_minor version_minor_prefix version_nano version_nano_prefix version_target ; do + for i in build_compiler build_indexer build_language build_name build_script build_shared build_sources_object build_sources_object_shared build_sources_object_static build_static has_path_standard path_headers path_language path_library_script path_library_shared path_library_static path_object_script path_object_shared path_object_static path_program_script path_program_shared path_program_static path_sources path_sources_headers path_sources_library path_sources_object path_sources_program path_sources_script preserve_path_headers process_post process_pre search_exclusive search_shared search_static version_file version_major version_major_prefix version_micro version_micro_prefix version_minor version_minor_prefix version_nano version_nano_prefix version_target ; do bootstrap_id "${i}-mode" @@ -1260,6 +1276,21 @@ bootstrap_operation_build() { bootstrap_id "path_program_static" local path_program_static=${variables[${key}]} + bootstrap_id "path_sources_headers" + local path_sources_headers=${variables[${key}]} + + bootstrap_id "path_sources_library" + local path_sources_library=${variables[${key}]} + + bootstrap_id "path_sources_object" + local path_sources_object=${variables[${key}]} + + bootstrap_id "path_sources_program" + local path_sources_program=${variables[${key}]} + + bootstrap_id "path_sources_script" + local path_sources_script=${variables[${key}]} + bootstrap_id "has_path_standard" local has_path_standard=${variables[${key}]} @@ -1370,14 +1401,6 @@ bootstrap_operation_build() { bootstrap_operation_build_prepare_remaining - if [[ ${build_shared} == "yes" && -f ${project_built_shared}.built || ${build_static} == "yes" && -f ${project_built_static}.built ]] ; then - if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then - echo -e "${c_warning}WARNING: This project has already been built.${c_reset}" - fi - - return 0 - fi - local arguments_include="-I${path_build}includes/" local arguments_shared="-L${path_build}libraries/${path_library_shared}" local arguments_static="-L${path_build}libraries/${path_library_static}" @@ -1404,7 +1427,13 @@ bootstrap_operation_build() { if [[ ${sources_documentation} != "" ]] ; then for i in ${sources_documentation} ; do + directory=$(dirname ${i}) + if [[ ${directory} == "." ]] ; then + directory= + elif [[ ${directory} != "" ]] ; then + directory="${directory}/" + fi if [[ ! -e ${path_documentation}${i} ]] ; then if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then @@ -1415,30 +1444,32 @@ bootstrap_operation_build() { continue; fi - if [[ ${directory} == "." ]] ; then - cp ${verbose_common} -R ${path_documentation}${i} ${path_build}documentation/ || failure=1 - else + if [[ ! -d ${path_build}documentation/${directory} ]] ; then mkdir ${verbose_common} -p ${path_build}documentation/${directory} || failure=1 + fi - if [[ ${failure} -eq 0 ]] ; then - cp ${verbose_common} -R ${path_documentation}${i} ${path_build}documentation/${directory}/ || failure=1 - fi + if [[ ${failure} -eq 0 ]] ; then + cp ${verbose_common} -R ${path_documentation}${i} ${path_build}documentation/${directory} || failure=1 fi done fi if [[ ${sources_setting} != "" ]] ; then for i in ${sources_setting} ; do - directory=$(dirname ${i}) + directory=$(dirname ${i}) if [[ ${directory} == "." ]] ; then - cp ${verbose_common} -R ${path_settings}${i} ${path_build}settings/ || failure=1 - else + directory= + elif [[ ${directory} != "" ]] ; then + directory="${directory}/" + fi + + if [[ ! -d ${path_build}settings/${directory} ]] ; then mkdir ${verbose_common} -p ${path_build}settings/${directory} || failure=1 + fi - if [[ ${failure} -eq 0 ]] ; then - cp ${verbose_common} -R ${path_settings}${i} ${path_build}settings/${directory}/ || failure=1 - fi + if [[ ${failure} -eq 0 ]] ; then + cp ${verbose_common} -R ${path_settings}${i} ${path_build}settings/${directory} || failure=1 fi done fi @@ -1446,75 +1477,60 @@ bootstrap_operation_build() { if [[ ${failure} -eq 0 && ${sources_headers} != "" ]] ; then if [[ ${preserve_path_headers} == "yes" ]] ; then for i in ${sources_headers} ; do - directory=$(dirname ${i}) + directory=$(dirname ${i}) if [[ ${directory} == "." ]] ; then - cp ${verbose_common} -f ${path_sources}${path_language}${i} ${path_build}includes/${path_headers} || failure=1 - else - if [[ ! -d ${path_build}includes/${path_headers}${directory} ]] ; then - mkdir ${verbose_common} -p ${path_build}includes/${path_headers}${directory} || failure=1 - fi + directory= + elif [[ ${directory} != "" ]] ; then + directory="${directory}/" + fi - if [[ ${failure} -eq 0 ]] ; then - cp ${verbose_common} -f ${path_sources}${path_language}${i} ${path_build}includes/${path_headers}${i} || failure=1 - fi + if [[ ! -d ${path_build}includes/${path_headers}${directory} ]] ; then + mkdir ${verbose_common} -p ${path_build}includes/${path_headers}${directory} || failure=1 + fi + + if [[ ${failure} -eq 0 ]] ; then + cp ${verbose_common} -f ${path_sources_headers}${path_language}${i} ${path_build}includes/${path_headers}${directory} || failure=1 fi done else for i in ${sources_headers} ; do - cp ${verbose_common} -f ${path_sources}${path_language}${i} ${path_build}includes/${path_headers} || failure=1 + cp ${verbose_common} -f ${path_sources_headers}${path_language}${i} ${path_build}includes/${path_headers} || failure=1 done fi fi - if [[ ${failure} -eq 0 && ${build_shared} == "yes" && ! -f ${project_built_shared}.built ]] ; then + if [[ ${failure} -eq 0 && ${build_shared} == "yes" && ! -f ${project_built_shared}-${settings_name}.built ]] ; then if [[ ${sources_object} != "" || ${sources_object_shared} != "" ]] ; then - sources= - let count=0 - - # Sources object only allows for a single value. - if [[ ${sources_object_shared} != "" ]] ; then - for i in ${sources_object_shared} ; do - let count++ - done + for i in ${sources_object} ${sources_object_shared} ; do - if [[ ${count} -gt 1 ]] ; then - if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then - echo -e "${c_warning}WARNING: Multiple '${c_notice}sources_object_shared${c_warning}' found, only using the first one found is going to be used.${c_reset}" - fi + directory=$(dirname ${i}) + if [[ ${directory} == "." ]] ; then + directory= + elif [[ ${directory} != "" ]] ; then + directory="${directory}/" fi - for i in ${sources_object_shared} ; do - sources="${path_sources_object}${path_language}${i} " + if [[ ! -d ${path_build}objects/${path_object_shared}${directory} ]] ; then + mkdir ${verbose_common} -p ${path_build}objects/${path_object_shared}${directory} || failure=1 + fi - break - done - else - for i in ${sources_object} ; do - let count++ - done + sources="${path_sources_object}${path_language}${i} " + n=$(echo $i | sed -e 's|\.[^\.]*$||') - if [[ ${count} -gt 1 ]] ; then - if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then - echo -e "${c_warning}WARNING: Multiple '${c_notice}sources_object${c_warning}' found, only using the first one found is going to be used.${c_reset}" - fi + if [[ ${verbosity} == "verbose" ]] ; then + echo ${build_compiler} ${sources} -c -o ${path_build}objects/${path_object_shared}${n}.o ${arguments_shared} ${arguments_include} ${libraries} ${libraries_shared} ${flags} ${flags_shared} ${flags_object} ${flags_object_shared} ${defines} ${defines_shared} ${defines_object} ${defines_object_shared} ${define_extra} fi - for i in ${sources_object} ; do - sources="${path_sources_object}${path_language}${i} " + ${build_compiler} ${sources} -c -o ${path_build}objects/${path_object_shared}${n}.o ${arguments_shared} ${arguments_include} ${libraries} ${libraries_shared} ${flags} ${flags_shared} ${flags_object} ${flags_object_shared} ${defines} ${defines_shared} ${defines_object} ${defines_object_shared} ${define_extra} || failure=1 + if [[ ${failure} -ne 0 ]] ; then break - done - fi - - if [[ ${verbosity} == "verbose" ]] ; then - echo ${build_compiler} ${sources} -c -o ${path_build}objects/${path_object_shared}${build_name}.o ${arguments_shared} ${arguments_include} ${libraries} ${libraries_shared} ${flags} ${flags_shared} ${flags_object} ${flags_object_shared} ${defines} ${defines_shared} ${defines_object} ${defines_object_shared} ${define_extra} - fi - - ${build_compiler} ${sources} -c -o ${path_build}objects/${path_object_shared}${build_name}.o ${arguments_shared} ${arguments_include} ${libraries} ${libraries_shared} ${flags} ${flags_shared} ${flags_object} ${flags_object_shared} ${defines} ${defines_shared} ${defines_object} ${defines_object_shared} ${define_extra} || failure=1 + fi + done fi - if [[ ${sources_library} != "" || ${sources_library_shared} != "" ]] ; then + if [[ ${failure} -eq 0 && (${sources_library} != "" || ${sources_library_shared} != "") ]] ; then sources= if [[ ${objects_library} != "" || ${objects_library_shared} != "" ]] ; then @@ -1524,7 +1540,7 @@ bootstrap_operation_build() { fi for i in ${sources_library} ${sources_library_shared} ; do - sources="${sources}${path_sources}${path_language}${i} " + sources="${sources}${path_sources_library}${path_language}${i} " done if [[ ${verbosity} == "verbose" ]] ; then @@ -1560,7 +1576,7 @@ bootstrap_operation_build() { fi fi - if [[ ${failure} -eq 0 && ${sources_program} != "" ]] ; then + if [[ ${failure} -eq 0 && (${sources_program} != "" || ${sources_program_shared} != "") ]] ; then sources= links= @@ -1575,7 +1591,7 @@ bootstrap_operation_build() { fi for i in ${sources_program} ${sources_program_shared} ; do - sources="${sources}${path_sources}${path_language}${i} " + sources="${sources}${path_sources_program}${path_language}${i} " done if [[ ${verbosity} == "verbose" ]] ; then @@ -1590,50 +1606,34 @@ bootstrap_operation_build() { fi fi - if [[ ${failure} -eq 0 && ${build_static} == "yes" && ! -f ${project_built_static}.built ]] ; then + if [[ ${failure} -eq 0 && ${build_static} == "yes" && ! -f ${project_built_static}-${settings_name}.built ]] ; then if [[ ${sources_object} != "" || ${sources_object_static} != "" ]] ; then - let count=0 + for i in ${sources_object} ${sources_object_static} ; do - # Sources object only allows for a single value. - if [[ ${sources_object_static} != "" ]] ; then - for i in ${sources_object_static} ; do - let count++ - done + directory=$(dirname ${i}) + if [[ ${directory} == "." ]] ; then + directory= + elif [[ ${directory} != "" ]] ; then + directory="${directory}/" + fi - if [[ ${count} -gt 1 ]] ; then - if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then - echo -e "${c_warning}WARNING: Multiple '${c_notice}sources_object_static${c_warning}' found, only using the first one found is going to be used.${c_reset}" - fi + if [[ ! -d ${path_build}objects/${path_object_shared}${directory} ]] ; then + mkdir ${verbose_common} -p ${path_build}objects/${path_object_shared}${directory} || failure=1 fi - for i in ${sources_object_static} ; do - sources="${path_sources_object}${path_language}${i} " + sources="${path_sources_object}${path_language}${i} " + n=$(echo $i | sed -e 's|\.[^\.]*$||') - break - done - else - for i in ${sources_object} ; do - let count++ - done - - if [[ ${count} -gt 1 ]] ; then - if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then - echo -e "${c_warning}WARNING: Multiple '${c_notice}sources_object${c_warning}' found, only using the first one found is going to be used.${c_reset}" - fi + if [[ ${verbosity} == "verbose" ]] ; then + echo ${build_compiler} ${sources} -c -o ${path_build}objects/${path_object_static}${n}.o ${arguments_static} ${arguments_include} ${libraries} ${libraries_static} ${flags} ${flags_static} ${flags_object} ${flags_object_static} ${defines} ${defines_static} ${defines_object} ${defines_object_static} ${define_extra} fi - for i in ${sources_object} ; do - sources="${path_sources_object}${path_language}${i} " + ${build_compiler} ${sources} -c -o ${path_build}objects/${path_object_static}${n}.o ${arguments_static} ${arguments_include} ${libraries} ${libraries_static} ${flags} ${flags_static} ${flags_object} ${flags_object_static} ${defines} ${defines_static} ${defines_object} ${defines_object_static} ${define_extra} || failure=1 + if [[ ${failure} -ne 0 ]] ; then break - done - fi - - if [[ ${verbosity} == "verbose" ]] ; then - echo ${build_compiler} ${sources} -c -o ${path_build}objects/${path_object_static}${build_name}.o ${arguments_static} ${arguments_include} ${libraries} ${libraries_static} ${flags} ${flags_static} ${flags_object} ${flags_object_static} ${defines} ${defines_static} ${defines_object} ${defines_object_static} ${define_extra} - fi - - ${build_compiler} ${sources} -c -o ${path_build}objects/${path_object_static}${build_name}.o ${arguments_static} ${arguments_include} ${libraries} ${libraries_static} ${flags} ${flags_static} ${flags_object} ${flags_object_static} ${defines} ${defines_static} ${defines_object} ${defines_object_static} ${define_extra} || failure=1 + fi + done fi if [[ ${sources_library} != "" || ${sources_library_static} != "" ]] ; then @@ -1646,27 +1646,32 @@ bootstrap_operation_build() { fi for i in ${sources_library} ${sources_library_static} ; do + directory=$(dirname ${i}) - n=$(basename ${i} | sed -e 's|\.c$||') + if [[ ${directory} == "." ]] ; then + directory= + elif [[ ${directory} != "" ]] ; then + directory="${directory}/" + fi - if [[ ${directory} != "." && ! -d ${path_build}objects/${directory} ]] ; then - mkdir ${verbose_common} -p ${path_build}objects/${directory} + n=$(basename ${i} | sed -e 's|\.[^\.]*$||') - if [[ ${?} -ne 0 ]] ; then - let failure=1 + if [[ ! -d ${path_build}objects/${directory} ]] ; then + mkdir ${verbose_common} -p ${path_build}objects/${directory} || failure=1 + if [[ ${failure} -eq 1 ]] ; then break; fi fi # These are objects created by the static build step rather than objects created by the object build step. - sources="${sources}${path_build}objects/${directory}/${n}.o " + sources="${sources}${path_build}objects/${directory}${n}.o " if [[ ${verbosity} == "verbose" ]] ; then - echo ${build_compiler} ${path_sources}${path_language}${i} -c -static -o ${path_build}objects/${directory}/${n}.o ${arguments_static} ${arguments_include} ${libraries} ${libraries_static} ${flags} ${flags_static} ${flags_library} ${flags_library_static} ${defines} ${defines_static} ${defines_library} ${defines_library_static} ${define_extra} + echo ${build_compiler} ${path_sources_library}${path_language}${i} -c -static -o ${path_build}objects/${directory}${n}.o ${arguments_static} ${arguments_include} ${libraries} ${libraries_static} ${flags} ${flags_static} ${flags_library} ${flags_library_static} ${defines} ${defines_static} ${defines_library} ${defines_library_static} ${define_extra} fi - ${build_compiler} ${path_sources}${path_language}${i} -c -static -o ${path_build}objects/${directory}/${n}.o ${arguments_static} ${arguments_include} ${libraries} ${libraries_static} ${flags} ${flags_static} ${flags_library} ${flags_library_static} ${defines} ${defines_static} ${defines_library} ${defines_library_static} ${define_extra} || failure=1 + ${build_compiler} ${path_sources_library}${path_language}${i} -c -static -o ${path_build}objects/${directory}${n}.o ${arguments_static} ${arguments_include} ${libraries} ${libraries_static} ${flags} ${flags_static} ${flags_library} ${flags_library_static} ${defines} ${defines_static} ${defines_library} ${defines_library_static} ${define_extra} || failure=1 if [[ ${failure} -eq 1 ]] ; then break; @@ -1683,7 +1688,7 @@ bootstrap_operation_build() { fi fi - if [[ ${failure} -eq 0 && ${sources_program} != "" ]] ; then + if [[ ${failure} -eq 0 && (${sources_program} != "" || ${sources_program_static} != "") ]] ; then sources= links= @@ -1698,7 +1703,7 @@ bootstrap_operation_build() { fi for i in ${sources_program} ${sources_program_static} ; do - sources="${sources}${path_sources}${path_language}${i} " + sources="${sources}${path_sources_program}${path_language}${i} " done if [[ ${verbosity} == "verbose" ]] ; then @@ -1879,12 +1884,48 @@ bootstrap_operation_build_prepare_defaults() { fi fi + bootstrap_id "has-path_sources_headers-mode" + if [[ ${variables[${key}]} != "yes" ]] ; then + + bootstrap_id "has-path_sources_headers" + if [[ ${variables[${key}]} != "yes" ]] ; then + path_sources_headers=${path_sources} + fi + fi + + bootstrap_id "has-path_sources_library-mode" + if [[ ${variables[${key}]} != "yes" ]] ; then + + bootstrap_id "has-path_sources_library" + if [[ ${variables[${key}]} != "yes" ]] ; then + path_sources_library=${path_sources} + fi + fi + bootstrap_id "has-path_sources_object-mode" if [[ ${variables[${key}]} != "yes" ]] ; then bootstrap_id "has-path_sources_object" if [[ ${variables[${key}]} != "yes" ]] ; then - path_sources_object="sources/" + path_sources_object=${path_sources} + fi + fi + + bootstrap_id "has-path_sources_program-mode" + if [[ ${variables[${key}]} != "yes" ]] ; then + + bootstrap_id "has-path_sources_program" + if [[ ${variables[${key}]} != "yes" ]] ; then + path_sources_program=${path_sources} + fi + fi + + bootstrap_id "has-path_sources_script-mode" + if [[ ${variables[${key}]} != "yes" ]] ; then + + bootstrap_id "has-path_sources_script" + if [[ ${variables[${key}]} != "yes" ]] ; then + path_sources_script=${path_sources} fi fi @@ -3044,7 +3085,7 @@ bootstrap_operation_clean() { fi done - if [[ -f ${project_built}.prepared ]] ; then + if [[ -f ${project_built}-${settings_name}.prepared ]] ; then rm ${verbose_common} -f ${project_built}-${settings_name}.prepared fi diff --git a/build/documentation/man/man1/controller.1 b/build/documentation/man/man1/controller.1 deleted file mode 100644 index 80c49e5..0000000 --- a/build/documentation/man/man1/controller.1 +++ /dev/null @@ -1,102 +0,0 @@ -.TH CONTROLLER "1" "January 2023" "FLL - Controller 0.7.0" "User Commands" -.SH NAME -controller \- Perform a series of operations in a manner similar to that of an init program. -.SH SYNOPSIS -.B controller -[\fI\,OPTIONS\/\fR] [\fI\,ENTRY\/\fR] -.SH DESCRIPTION -.PP -This program performs a series of operations described by an \fBentry\fR file. -This includes error handling. - -The \fBentry\fR file consists of several rules defined in individual \fBrule\fR files. -Thee \fBrule\fR file allows for both programs and scripts to be executed. -Any scripting language whose program supports piping commands to it are effectively supported scripting languages. - -Upon completion, this program may optionally process an \fBexit\fR file whose name is identical to the \fBentry\fR used. - -When both the \fB\-\-simulate\fR parameter and the \fB\-\-validate\fR parameter are specified, then additional information on each would be executed rule is printed but no simulation is performed. - -The default interrupt behavior is to operate as if the \fB\-\-interruptible\fR parameter is passed. - -Specify an empty string for the \fB\-\-pid\fR parameter to disable pid file creation for this program. -.SH OPTIONS -.TP -\fB\{\-h, \-\-help\fR -Print the help message. -.TP -\fB+C, ++copyright\fR -Print the copyright. -.TP -\fB+d, ++dark\fR -Output using colors that show up better on dark backgrounds. -.TP -\fB+l, ++light\fR -Output using colors that show up better on light backgrounds. -.TP -\fB+n, ++no_color\fR -Do not print using color. -.TP -\fB+Q, ++quiet\fR -Decrease verbosity, silencing most output. -.TP -\fB+E, ++error\fR -Decrease verbosity, using only error output. -.TP -\fB+N, ++normal\fR -Set verbosity to normal. -.TP -\fB+V, ++verbose\fR -Increase verbosity beyond normal output. -.TP -\fB+D, ++debug\fR -Enable debugging, significantly increasing verbosity beyond normal output. -.TP -\fB+v, ++version\fR -Print only the version number. -.TP -\fB\-c, \-\-cgroup\fR -Specify a custom control group file path, such as '/sys/fs/cgroup/'. -.TP -\fB\-d, \-\-daemon\fR -Run in daemon only mode (do not process the entry). -.TP -\fB\-I, \-\-init\fR -The program will run as an init replacement. -.TP -\fB\-i, \-\-interruptible\fR -Designate that this program can be interrupted by a signal. -.TP -\fB\-p, \-\-pid\fR -Specify a custom pid file path, such as 'controller/run/default.pid'. -.TP -\fB\-s, \-\-settings\fR -Specify a custom settings path, such as 'controller/'. -.TP -\fB\-S, \-\-simulate\fR -Run as a simulation. -.TP -\fB\-k, \-\-socket\fR -Specify a custom socket file path, such as 'controller/run/default.socket'. -.TP -\fB\-U, \-\-uninterruptible\fR -Designate that this program cannot be interrupted by a signal. -.TP -\fB\-v, \-\-validate\fR -Validate the settings (entry and rules) without running (does not simulate). -.SH ENTRY -.TP -The name of an \fBentry\fR. -.SH SEE ALSO -.PP -\fBcontrol\fR(1), -\fBcontroller\-actions\fR(5), -\fBcontroller\-entry\fR(5), -\fBcontroller\-exit\fR(5), -\fBcontroller\-packet\fR(5), -\fBcontroller\-rule\fR(5) -.SH AUTHOR -Written by Kevin Day. -.SH COPYRIGHT -.PP -Copyright \(co 2007-2023 Kevin Day, GNU LGPL Version 2.1 or later. diff --git a/build/documentation/man/man5/controller-actions.5 b/build/documentation/man/man5/controller-actions.5 deleted file mode 100644 index eb79f8b..0000000 --- a/build/documentation/man/man5/controller-actions.5 +++ /dev/null @@ -1,89 +0,0 @@ -.TH controller-rule "5" "January 2023" "Controller 0.7.0" "File Formats" -.SH NAME -Controller \- "rule" file. -.SH SYNOPSIS -.B rule -.SH DESCRIPTION -.PP -This describes the intent and purpose of the actions provided for individual Rules (or things related to a Rule). - -Each Action represents a specific intent and purpose but many of these actions are customizable via the rule file. -One should expect an Action to operate as described here but the system administrator or distributor is fully capable of doing something different. -For those doing something different, appropriate documentation is suggested. - -These actions should be usable by any \fBcontrol\fR program that communicates with this \fBcontroller\fR program. -Should any \fBcontrol\fR or \fBcontroller\fR program implementation not support any particular Action for any reason, one should report that the Action is unsupported. - -\- \fBFreeze Action\fR: - The Freeze Action is an extension of a Control Group. - This is internal to the \fBcontroller\fR program and is not customizable via any Rule file. - For a customizable \fBfreeze\fR\-like capability, look into the Pause and Resume Actions. - This is the complement of the Thaw Action. - - This designates that a processes Control Group is to be frozen. - All Rules (or any process not controlled by the \fBcontroller\fR) that is within the same Control Group will be frozen. - (@todo consider instead designing this around the Control Groups instead of a \fBrule\fR.) - (This documentation will likely change with consideration to the above @todo once this gets implemented.) - - This must not attempt to freeze (or unfreeze) the Control Group that the \fBcontroller\fR belongs to. - Therefore, if a Rule does not specify a Control Group, then it is likely that the Freeze Action will be unsupported for that Rule/Control Group. - -\- \fBKill Action\fR: - Forcefully terminate some process controlled by the \fBcontroller\fR. - This action cannot be blocked and it is recommended to use a Stop Action instead for a more proper termination. - -\- \fBPause Action\fR: - The Pause Action will pause (or freeze) the process controlled by the Rule. - Although similar to the Freeze Action, this is intended to communicate to an individual process and inform to Pause. - This is complemented by the Resume Action. - -\- \fBRestart Action\fR: - The Restart Action will either perform a Stop Action and then a Restart Action or it will perform the Restart Action designated in some Rule file. - Ideally this should inform some process to perform its own restart routines. - -\- \fBResume Action\fR: - The Resume Action will unpause (or unfreeze) the process controlled by the Rule. - Although similar to the Thaw Action, this is intended to communicate to an individual process and inform to Resume. - This is complemented by the Pause Action. - -\- \fBReload Action\fR: - The Reload Action will perform the Reload Action designated in some Rule file. - Ideally this should inform some process to perform its own reload routines. - Many programs often differentiate the concept \fBreload\fR from the concept "restart" in that the program remains running during a \fBreload\fR. - -\- \fBStart Action\fR: - The Start Action will perform the Start Action designated in some Rule file. - This action should be used to start some program or script. - This is the action called by Entry file. - This is complemented by the Stop Action. - -\- \fBStop Action\fR: - The Stop Action will perform the Stop Action designated in some Rule file. - This action should be used to stop some program or script. - This is the action called for all running controlled processes on shutdown. - This is complemented by the Start Action. - -\- \fBThaw Action\fR: - The Thaw Action is an extension of a Control Group. - This is internal to the \fBcontroller\fR program and is not customizable via any Rule file. - For a customizable \fBthaw\fR\-like capability, look into the \fBpause\fR and \fBresume\fR Actions. - This is complemented by the Freeze Action. - - This designates that a processes Control Group is to be unfrozen. - All Rules (or any process not controlled by the \fBcontroller\fR) that is within the same Control Group will be unfrozen. - - This must not attempt to thaw (or unthaw) the Control Group that the \fBcontroller\fR belongs to. - Therefore, if a Rule does not specify a Control Group, then it is likely that the Thaw Action will be unsupported for that Rule/Control Group. -.SH SEE ALSO -.PP -\fBcontrol\fR(1), -\fBcontroller\fR(1), -\fBcontroller\-entry\fR(5), -\fBcontroller\-exit\fR(5), -\fBcontroller\-packet\fR(5), -\fBcontroller\-rule\fR(5) -.SH AUTHOR -Written by Kevin Day. -.SH COPYRIGHT -.PP -Copyright \(co 2007-2023 Kevin Day, Open Standard License 1.0 or later. diff --git a/build/documentation/man/man5/controller-entry.5 b/build/documentation/man/man5/controller-entry.5 deleted file mode 100644 index 976bcf3..0000000 --- a/build/documentation/man/man5/controller-entry.5 +++ /dev/null @@ -1,352 +0,0 @@ -.TH controller-entry "5" "January 2023" "Controller 0.7.0" "File Formats" -.SH NAME -Controller \- "entry" file. -.SH SYNOPSIS -.B entry -.SH DESCRIPTION -.PP -This describes the intent and purpose of an Entry file. - -An Entry file, such as \fBdefault.entry\fR, is intended to store a set of rules in which the controller will process on execution. -These are used to run some set of commands, such as booting a system. - -The \fBmain\fR Item Object is always executed first (Therefore \fBmain\fR is both reserved and required). -All other Basic List Objects are not executed unless either an \fBitem\fR or a \fBfailsafe\fR specifies a valid Item name. -Execution of all Items is top\-down. - -\- The \fBsettings\fR item Object: - Represents Entry settings and is not an \fBitem\fR that can be executed. - A number of settings are supported, but if this Item Object is not specified, then defaults are used. - The following settings are available: \fBcontrol\fR, \fBcontrol_group\fR, \fBcontrol_mode\fR, \fBcontrol_user\fR, \fBdefine\fR, \fBmode\fR, \fBparameter\fR, \fBpid\fR, \fBpid_file\fR, \fBsession\fR, \fBshow\fR. - - \- The \fBcontrol\fR setting: - Represents the path to the socket file in which the Controller uses to communicate over with clients such as a Control program. - A relative path is relative to the Controller PID directory. - An absolute path is treated exactly as the path given. - If no socket setting is specified, then no socket will be made available. - This socket file is only created once \fBready\fR mode is achieved. - - Providing \fBreadonly\fR after the socket path instructs the Controller program not to create or delete the Socket file because the file system is assumed to be readonly. - The socket file itself must therefore already exist. - This should be possible in the cases of file systems that have pre\-created a socket file at the designated path. - When \fBreadonly\fR, the group, mode, and user are also not processed effectively resulting in the \fBcontrol_group\fR, \fBcontrol_mode\fR, and \fBcontrol_user\fR settings being ignored. - - Future versions might expand this into supporting network addresses in addition to socket files. - - \- The \fBcontrol_group\fR setting: - Represents the group name or group ID to assign to the socket file as the group. - - \- The \fBcontrol_mode\fR setting: - Represents the file mode assigned to the socket file. - This could either be the string version that might look like \fBu+rw\-x,g+r\-wx,o\-rwx\fR or a numeric value like \fB0750\fR. - - \- The \fBcontrol_user\fR setting: - Represents the user name or user ID to assign to the socket file as the owner. - - \- The \fBdefine\fR setting: - Use this to define an environment variable (this overwrites any existing environment variable with this name). - A define is both exported as an environment variable as well as exposed as an IKI variable. - Example IKI variable substitution: for \fBdefine PATH /bin:/sbin\fR, the associated IKI variable would look like: PATH. - - All environment variables, including those defined using this, must be in the \fBenvironment\fR list in any given Rule to be exported to the executed process. - Environment variables added here that are not added to the environment are still exposed as an IKI variable. - - This is only expanded within any Rule operated on by this Entry. - - \- The \fBmode\fR setting: - Represents the mode in which the Entry is operating in. - The following modes are supported: \fBhelper\fR, \fBprogram\fR, and \fBservice\fR. - - - The \fBhelper\fR mode: - Designates that the Entry operates as a helper for starting programs or performing actions and exits when complete. - On exit, any background (asynchronous) processes are not cancelled. - If terminated, the foreground (synchronous) process is cancelled. - Will call the \fBexit\fR with the same name as this Entry, but with the extension \fBexit\fR, such as \fBdefault.exit\fR. - Supports the Item Action \fBexecute\fR to execute a program (switching the \fBcontroller\fR program entirely with the executed process). - - \- The \fBprogram\fR mode: - Designates that the Entry operates as a program and exits when complete. - On exit, any background (asynchronous) processes are also cancelled. - If terminated, the foreground (synchronous) process is cancelled. - Will call the \fBexit\fR with the same name as this Entry, but with the extension \fBexit\fR, such as \fBdefault.exit\fR. - Supports the Item Action \fBexecute\fR to execute a program (switching the \fBcontroller\fR program entirely with the executed process). - - \- The \fBservice\fR mode: - Designates that the Entry operates as a service and will sit and wait for control commands when complete. - Will call the \fBexit\fR with the same name as this Entry, but with the extension \fBexit\fR, such as \fBdefault.exit\fR. - Does not support the Item Action \fBexecute\fR. - This is the default mode. - - \- The \fBparameter\fR setting: - Use this to define an IKI variable name and value. - These do not conflict with environment variables and are not exposed as environment variables. - Example IKI variable substitution: for \fBparameter hello world\fR, the associated IKI variable would look like: hello. - - This is only expanded within any Rule operated on by this Entry. - - \- The \fBpid\fR setting: - Represents how the Entry PID file is generated or not. - The following modes are supported: \fBdisable\fR, \fBrequire\fR, and \fBready\fR. - For \fBdisable\fR, not PID file representing the Entry is created. - For \fBrequire\fR, check to see if the PID file exists for an Entry at startup and then when \fBready\fR create a PID file, display error on PID file already exists or on failure and then fail. - For \fBready\fR, when \fBready\fR create a PID file, display error on failure and then fail (does not check if PID file exists). - - \- The \fBpid_file\fR setting: - When \fBpid\fR is not disabled this represents the path to the PID file. - If \fB\-p\fR or \fB\-\-pid\fR is passed to the controller program, then this value is ignored in favor of the value passed along the command line. - - \- The \fBsession\fR setting: - Represents the default way in which child processes are executed. - This default can be overridden by individual Rules. - For \fBnew\fR, Execute Rule processes in a new session setting the process group to the executed process' id (making the executed process a \fBcontrolling terminal\fR). - For \fBsame\fR, Execute Rule processes in the same session where the process group is set to the parent process id. - - \- The \fBshow\fR setting: - Represents the way Entry processing presents information to the screen. - This applies only to the Entry and Rule processing itself and does not handle the output of programs and scripts being executed by some Entry or Rule. - The following show options are supported: \fBnormal\fR and \fBinit\fR. - For \fBnormal\fR, will not report the start or stop of some Entry or Rule execution but will report any errors or warnings as appropriate. - For \fBinit\fR, will report when starting programs and may include reporting success and failure status. - - \- The \fBtimeout\fR setting: - Represents the default timeouts for the Entry. - See the \fBtimeout\fR Action below for details. - -\- The \fBmain\fR item Object: - Each \fBitem\fR supports the following Action Names: \fBconsider\fR, \fBexecute\fR, \fBfailsafe\fR, \fBfreeze\fR, \fBitem\fR, \fBkill\fR, \fBpause\fR, \fBreload\fR, \fBrestart\fR, \fBready\fR, \fBresume\fR, \fBstart\fR, \fBstop\fR, and \fBtimeout\fR. - Of those types, the following are considered a \fBrule\fR Action: \fBfreeze\fR, \fBkill\fR, \fBpause\fR, \fBreload\fR, \fBrestart\fR, \fBresume\fR, \fBstart\fR, \fBstop\fR, and \fBthaw\fR. - - \- The \fBconsider\fR Item Action: - A special case of a \fBrule\fR Action. - All Action Parameters are the same as with the \fBrule\fR Action Parameters. - The difference is that \fBconsider\fR is only processed (instead of being processed and executed) and when some \fBrule\fR Action designates that this consideration is required (via \fBneed\fR), wanted (via \fBwant\fR), or wished for (via \fBwish\fR) from the within the Rule file. - If this is determined to be executed, then this is immediately executed when needed, wanted or wished for and applies all properties as appropriate (such as \fBasynchronous\fR, for example). - If this is determined not to be executed, then this \fBconsider\fR is ignored as if it was never there in the first place. - - \- The \fBexecute\fR Item Action: - Execute into the specified program. - On successful execution, the controller program will no longer be running and will be replaced with the designated program. - This Item Action is only supported when operating in \fBprogram\fR mode. - - \- The \fBfailsafe\fR Item Action: - Accepts only a valid Item Name in which will be executed when a failure is detected. - Only a single \fBfailsafe\fR Item Action may function at a time. - Each successive \fBfailsafe\fR Item Action specified replaces the previously defined \fBfailsafe\fR Item Action (in a top\-down manner). - When operating in \fBfailsafe\fR, the \fBrequire\fR Item Action is ignored (given that it is meaningless once operating in \fBfailsafe\fR mode). - - \- The \fBfreeze\fR Item Action: - A \fBrule\fR Action for freezing some Control Group. - This Item Action will process the \fBfreeze\fR inner Content of the named Rule. - This is specific to Control Groups and is not yet fully implemented. - Once implemented this documentation will need to be updated and clarified. - - \- The \fBitem\fR Item Action: - Accepts only a valid Item Name in which will be immediately executed. - Any valid Item Name, except for the reserved \fBmain\fR, may be used. - - \- The \fBkill\fR Item Action: - A \fBrule\fR Action for forcibly terminating some process. - This Item Action will process the \fBkill\fR inner Content of the named Rule. - - \- The \fBpause\fR Item Action: - A \fBrule\fR Action for pausing some process. - This Item Action will process the \fBpause\fR inner Content of the named Rule. - - \- The \fBreload\fR Item Action: - A \fBrule\fR Action for pausing some process. - This Item Action will process the \fBreload\fR inner Content of the named Rule. - - \- The \fBrestart\fR Item Action: - A \fBrule\fR Action for pausing some process. - This Item Action will process the \fBrestart\fR inner Content of the named Rule. - - \- The \fBresume\fR Item Action: - A \fBrule\fR Action for pausing some process. - This Item Action will process the \fBresume\fR inner Content of the named Rule. - - \- The \fBready\fR Item Action: - Instructs the controller program when it is safe to perform normal tasks, such as creating the PID file. - When not specified, the state is always assumed to be ready. - For example, the controller program may be used as a full blown \fBinit\fR replacement and therefore may need to mount the /var/run/ directory. - If the PID file is created at program start, then the /var/run/controller.pid would be written before the /var/run/ directory is ready. - This could be a problem, such as on a read\-only file system the PID creation fails and controller bails out on error. - Adding \fBready\fR essentially specifies a point in time in the Entry in which things are expected to be safe for such basic operations. - When the optional \fBwait\fR is provided, then \fBready\fR will wait for all currently started asynchronous processes to complete before operating. - - \- The \fBstart\fR Item Action: - A \fBrule\fR Action for pausing some process. - This Item Action will process the \fBstart\fR inner Content of the named Rule. - - \- The \fBstop\fR Item Action: - A \fBrule\fR Action for pausing some process. - This Item Action will process the \fBstop\fR inner Content of the named Rule. - - \- The \fBthaw\fR Item Action: - A \fBrule\fR Action for unfreezing some Control Group. - This Item Action will process the \fBthaw\fR inner Content of the named Rule. - This is specific to Control Groups and is not yet fully implemented. - Once implemented this documentation will need to be updated and clarified. - - \- The \fBtimeout\fR Item Action: - (This is not currently fully implemented, only \fBexit\fR is implemented.) - Provides default global settings for each of the four special situations: \fBexit\fR, \fBkill\fR, \fBstart\fR, and \fBstop\fR. - Each of these may only have a single one exist at a time (one \fBexit\fR, one \fBkill\fR, one \fBstart\fR, and one \fBstop\fR). - Each successive \fBtimeout\fR Item Action, specific to each Action Name (such as \fBstart\fR), specified replaces the previously defined \fBtimeout\fR Action (in a top\-down manner). - The second Content for each of these, when specified, may be a 0 or greater whole number representing the number of MegaTime (MT) (equivalent to milliseconds). - For \fBkill\fR, this represents the number of MegaTime to wait after stopping some Rule and that Rule has not yet stopped to forcefully stop the Rule (aka kill the Rule). - For \fBstart\fR, this represents the number of MegaTime to wait after starting some Rule before assuming something went wrong and the Rule is returned as failed. - For \fBstop\fR, this represents the number of MegaTime to wait after stopping some Rule before assuming something went wrong and the Rule is returned as failed. - If the second Content is not specified, then this disables the type (prevents the specified timeout action). - For \fBexit\fR, this represents the number of MegaTime to wait when the Controller program is exiting (such as having received a terminate signal). - In this case, a terminate signal is sent to all child processes. - The \fBexit\fR timeout represents the amount of time to wait after sending the terminate signal before sending a kill signal to each child process still running. - When disabled, the program will not send a kill signal will continue running until all child processes to terminate. - The \fBexit\fR timeout does not get applied to any Rule. -.SH SPECIFICATION -.PP -The Entry files follow the \fBFSS\-0005 (Somewhat Basic List)\fR format. - -An Entry file name is expected to have the file extension \fB.entry\fR. - -For each Entry file: - \- The outer most part is a \fBFSS\-0002 (Basic List)\fR. - \- The Basic List Object is considered the \fBItem\fR. - \- The Basic List Content are considered the \fBActions\fR. - \- The \fBActions\fR are \fBFSS\-0001 (Extended)\fR. - \- Each Action Object is the \fBAction Name\fR. - \- Each Action Content are the \fBAction Parameters\fR. - -The Items: - \- \fBmain\fR: required. - - \- \fBsettings\fR: optional, Actions may be one of: - \- \fBcontrol\fR: One to two Content. - The first Content is a relative or absolute path to a socket file. - The second Content an optional \fBreadonly\fR. - \- \fBcontrol_group\fR: Exactly one Content that is a group name or group id. - \- \fBcontrol_mode\fR: Exactly one Content that is a valid file mode. - \- \fBcontrol_user\fR: Exactly one Content that is a user name or user id. - \- \fBdefine\fR: Two Content, the first Content must be a case\-sensitive valid environment variable name (alpha\-numeric or underscore, but no leading digits). - \- \fBmode\fR: Exactly one Content that is one of \fBprogram\fR or \fBservice\fR. - \- \fBparameter\fR: Two Content, the first Content must be a case\-sensitive valid IKI name and the second being an IKI value. - \- \fBpid\fR: Exactly one Content that is one of \fBdisable\fR, \fBrequire\fR, or \fBready\fR. - \- \fBpid_file\fR: Exactly one Content that is a relative or absolute path to a pid file. - \- \fBsession\fR: Exactly one Content that is one of \fBnew\fR or \fBsame\fR. - \- \fBshow\fR: Exactly one Content that is one of \fBnormal\fR or \fBinit\fR. - \- \fBtimeout\fR: One or two content with the first being one of \fBexit\fR, \fBstart\fR, \fBstop\fR, or \fBkill\fR and the (optional) second Content being a positive whole number or 0. - - The Entry file may have any other valid Item Objects, but only the above are reserved. - - The Actions: - \- \fBconsider\fR: One or more Content. - The first Content is the relative file path (without any leading/trailing slashes and without file extension). - The second Content is the basename for a rule file. - The third and beyond may only be one of: - \- \fBasynchronous\fR - \- \fBrequire\fR - \- \fBwait\fR - - \- \fBexecute\fR: One or more Content. - The first Content is the program name or full path to the program (the program may be a script). - All remaining Content are passed as parameters to the program being executed. - - \- \fBfailsafe\fR: One Content that is a valid Object name, except for the reserved \fBmain\fR. - - \- \fBfreeze\fR: Two or more Content. - The first Content that is the relative directory path (without any leading/trailing slashes). - The second Content that is the basename for a rule file. - The third and beyond may only be one of: - \- \fBasynchronous\fR - \- \fBrequire\fR - \- \fBwait\fR - - \- \fBitem\fR: One Content that is a valid Object name, except for the reserved \fBmain\fR. - - \- \fBkill\fR: Two or more Content. - The first Content that is the relative directory path (without any leading/trailing slashes). - The second Content that is the basename for a rule file. - The third and beyond may only be one of: - \- \fBasynchronous\fR - \- \fBrequire\fR - \- \fBwait\fR - - \- \fBpause\fR: Two or more Content. - The first Content that is the relative directory path (without any leading/trailing slashes). - The second Content that is the basename for a rule file. - The third and beyond may only be one of: - \- \fBasynchronous\fR - \- \fBrequire\fR - \- \fBwait\fR - - \- \fBready\fR: Zero or One Content. - The first may only be one of: - \- \fBwait\fR - - \- \fBreload\fR: Two or more Content. - The first Content that is the relative directory path (without any leading/trailing slashes). - The second Content that is the basename for a rule file. - The third and beyond may only be one of: - \- \fBasynchronous\fR - \- \fBrequire\fR - \- \fBwait\fR - - \- \fBrestart\fR: Two or more Content. - The first Content that is the relative directory path (without any leading/trailing slashes). - The second Content that is the basename for a rule file. - The third and beyond may only be one of: - \- \fBasynchronous\fR - \- \fBrequire\fR - \- \fBwait\fR - - \- \fBresume\fR: Two or more Content. - The first Content that is the relative directory path (without any leading/trailing slashes). - The second Content that is the basename for a rule file. - The third and beyond may only be one of: - \- \fBasynchronous\fR - \- \fBrequire\fR - \- \fBwait\fR - - \- \fBstart\fR: Two or more Content. - The first Content that is the relative directory path (without any leading/trailing slashes). - The second Content that is the basename for a rule file. - The third and beyond may only be one of: - \- \fBasynchronous\fR - \- \fBrequire\fR - \- \fBwait\fR - - \- \fBstop\fR: Two or more Content. - The first Content that is the relative directory path (without any leading/trailing slashes). - The second Content that is the basename for a rule file. - The third and beyond may only be one of: - \- \fBasynchronous\fR - \- \fBrequire\fR - \- \fBwait\fR - - \- \fBthaw\fR: Two or more Content. - The first Content that is the relative directory path (without any leading/trailing slashes). - The second Content that is the basename for a rule file. - The third and beyond may only be one of: - \- \fBasynchronous\fR - \- \fBrequire\fR - \- \fBwait\fR - - \- \fBtimeout\fR: One or two Content. - The first being one of: - \- \fBexit\fR - \- \fBstart\fR - \- \fBstop\fR - \- \fBkill\fR - The (optional) second Content being a positive whole number or 0. -.SH SEE ALSO -.PP -\fBcontrol\fR(1), -\fBcontroller\fR(1), -\fBcontroller\-actions\fR(5), -\fBcontroller\-exit\fR(5), -\fBcontroller\-packet\fR(5), -\fBcontroller\-rule\fR(5) -.SH AUTHOR -Written by Kevin Day. -.SH COPYRIGHT -.PP -Copyright \(co 2007-2023 Kevin Day, Open Standard License 1.0 or later. diff --git a/build/documentation/man/man5/controller-exit.5 b/build/documentation/man/man5/controller-exit.5 deleted file mode 100644 index a4969ea..0000000 --- a/build/documentation/man/man5/controller-exit.5 +++ /dev/null @@ -1,283 +0,0 @@ -.TH controller-rule "5" "January 2023" "Controller 0.7.0" "File Formats" -.SH NAME -Controller \- "rule" file. -.SH SYNOPSIS -.B rule -.SH DESCRIPTION -.PP -This describes the intent and purpose of an Exit file. - -An Exit file, such as \fBdefault.exit\fR, is intended to store a set of rules in which the controller will process on execution. -These are used to run some set of commands, such as shutting down a system. - -An Exit is a special variation or subset of an Entry. - -\- The \fBsettings\fR Item Object: - Represents Exit settings and is not an \fBitem\fR that can be executed. - A number of settings are supported, but if this Item Object is not specified, then defaults are used. - The following settings are available: \fBpid\fR and \fBshow\fR. - - \- The \fBdefine\fR setting: - Use this to define an environment variable (this overwrites any existing environment variable with this name). - A define is both exported as an environment variable as well as exposed as an IKI variable. - Example IKI variable substitution: for \fBdefine PATH /bin:/sbin\fR, the associated IKI variable would look like: PATH. - - All environment variables, including those defined using this, must be in the \fBenvironment\fR list in any given Rule to be exported to the executed process. - Environment variables added here that are not added to the environment are still exposed as an IKI variable. - - This is only expanded within any Rule operated on by this Exit. - - \- The \fBparameter\fR setting: - Use this to define an IKI variable name and value. - These do not conflict with environment variables and are not exposed as environment variables. - Example IKI variable substitution: for \fBparameter hello world\fR, the associated IKI variable would look like: hello. - - This is only expanded within any Rule operated on by this Exit. - - \- The \fBpid\fR setting: - Represents how the Exit PID file is generated or not. - The following modes are supported: \fBdisable\fR, \fBrequire\fR, and \fBready\fR. - For \fBdisable\fR, not PID file representing the Exit is created. - For \fBrequire\fR, check to see if the PID file exists for an Exit at startup and then when \fBready\fR create a PID file, display error on PID file already exists or on failure and then fail. - For \fBready\fR, when \fBready\fR create a PID file, display error on failure and then fail (does not check if PID file exists). - - \- The \fBshow\fR setting: - Represents the way Exit processing presents information to the screen. - This applies only to the Exit and Rule processing itself and does not handle the output of programs and scripts being executed by some Exit or Rule. - The following show options are supported: \fBnormal\fR and \fBinit\fR. - For \fBnormal\fR, will not report the start or stop of some Exit or Rule execution but will report any errors or warnings as appropriate. - For \fBinit\fR, will report when starting programs and may include reporting success and failure status. - - \- The \fBtimeout\fR setting: - Represents the default timeouts for the Exit. - See the \fBtimeout\fR Action below for details. - -\- The \fBmain\fR Item Object: - Is always executed first (Therefore \fBmain\fR is both reserved and required). - All other Basic List Objects are not executed unless either an \fBitem\fR or a \fBfailsafe\fR specifies a valid Item name. - Execution of all Items are top\-down. - - Each \fBitem\fR supports the following Action Names: \fBconsider\fR, \fBexecute\fR, \fBfailsafe\fR, \fBfreeze\fR, \fBitem\fR, \fBkill\fR, \fBpause\fR, \fBreload\fR, \fBrestart\fR, \fBready\fR, \fBresume\fR, \fBstart\fR, \fBstop\fR, and \fBtimeout\fR. - Of those types, the following are considered a \fBrule\fR Action: \fBfreeze\fR, \fBkill\fR, \fBpause\fR, \fBreload\fR, \fBrestart\fR, \fBresume\fR, \fBstart\fR, \fBstop\fR, and \fBthaw\fR. - - \- The \fBconsider\fR Item Action: - A special case of a \fBrule\fR Action. - All Action Parameters are the same as with the \fBrule\fR Action Parameters. - The difference is that \fBconsider\fR is only processed (instead of being processed and executed) and when some \fBrule\fR Action designates that this consideration is required (via \fBneed\fR), wanted (via \fBwant\fR), or wished for (via \fBwish\fR) from the within the Rule file. - If this is determined to be executed, then this is immediately executed when needed, wanted or wished for and applies all properties as appropriate (such as \fBasynchronous\fR, for example). - If this is determined not to be executed, then this \fBconsider\fR is ignored as if it was never there in the first place. - - \- The \fBexecute\fR Item Action: - Execute into the specified program. - On successful execution, the controller program will no longer be running and will be replaced with the designated program. - This Item Action is only supported when operating in \fBprogram\fR mode. - - \- The \fBfailsafe\fR Item Action: - Accepts only a valid Item Name in which will be executed when a failure is detected. - Only a single \fBfailsafe\fR Item Action may function at a time. - Each successive \fBfailsafe\fR Item Action specified replaces the previously defined \fBfailsafe\fR Item Action (in a top\-down manner). - When operating in \fBfailsafe\fR, the \fBrequire\fR Item Action is ignored (given that it is meaningless once operating in \fBfailsafe\fR mode). - - \- The \fBfreeze\fR Item Action: - A \fBrule\fR Action for freezing some Control Group. - This Item Action will process the \fBfreeze\fR inner Content of the named Rule. - This is specific to Control Groups and is not yet fully implemented. - Once implemented this documentation will need to be updated and clarified. - - \- The \fBitem\fR Item Action: - Accepts only a valid Item Name in which will be immediately executed. - Any valid Item Name, except for the reserved \fBmain\fR, may be used. - - \- The \fBkill\fR Item Action: - A \fBrule\fR Action for forcibly terminating some process. - This Item Action will process the \fBkill\fR inner Content of the named Rule. - - \- The \fBpause\fR Item Action: - A \fBrule\fR Action for pausing some process. - This Item Action will process the \fBpause\fR inner Content of the named Rule. - - \- The \fBreload\fR Item Action: - A \fBrule\fR Action for pausing some process. - This Item Action will process the \fBreload\fR inner Content of the named Rule. - - \- The \fBrestart\fR Item Action: - A \fBrule\fR Action for pausing some process. - This Item Action will process the \fBrestart\fR inner Content of the named Rule. - - \- The \fBresume\fR Item Action: - A \fBrule\fR Action for pausing some process. - This Item Action will process the \fBresume\fR inner Content of the named Rule. - - \- The \fBready\fR Action: - Instructs the controller program when it is safe to perform normal tasks, such as creating the PID file. - When not specified, the state is always assumed to be ready. - For example, the controller program may be used as a full blown \fBinit\fR replacement and therefore may need to mount the /var/run/ directory. - If the PID file is created at program start, then the /var/run/controller.pid would be written before the /var/run/ directory is ready. - This could be a problem, such as on a read\-only file system the PID creation fails and controller bails out on error. - Adding \fBready\fR essentially specifies a point in time in the Exit in which things are expected to be safe for such basic operations. - When the optional \fBwait\fR is provided, then \fBready\fR will wait for all currently started asynchronous processes to complete before operating. - - \- The \fBstart\fR Item Action: - A \fBrule\fR Action for pausing some process. - This Item Action will process the \fBstart\fR inner Content of the named Rule. - - \- The \fBstop\fR Item Action: - A \fBrule\fR Action for pausing some process. - This Item Action will process the \fBstop\fR inner Content of the named Rule. - - \- The \fBthaw\fR Item Action: - A \fBrule\fR Action for unfreezing some Control Group. - This Item Action will process the \fBthaw\fR inner Content of the named Rule. - This is specific to Control Groups and is not yet fully implemented. - Once implemented this documentation will need to be updated and clarified. - - \- The \fBtimeout\fR Item Action: - (This is not currently fully implemented, only \fBexit\fR is implemented.) - Provides default global settings for each of the four special situations: \fBexit\fR, \fBkill\fR, \fBstart\fR, and \fBstop\fR. - Each of these may only have a single one exist at a time (one \fBexit\fR, one \fBkill\fR, one \fBstart\fR, and one \fBstop\fR). - Each successive \fBtimeout\fR Item Action, specific to each Action Name (such as \fBstart\fR), specified replaces the previously defined \fBtimeout\fR Action (in a top\-down manner). - The second Content for each of these, when specified, may be a 0 or greater whole number representing the number of MegaTime (MT) (equivalent to milliseconds). - For \fBkill\fR, this represents the number of MegaTime to wait after stopping some Rule and that Rule has not yet stopped to forcefully stop the Rule (aka kill the Rule). - For \fBstart\fR, this represents the number of MegaTime to wait after starting some Rule before assuming something went wrong and the Rule is returned as failed. - For \fBstop\fR, this represents the number of MegaTime to wait after stopping some Rule before assuming something went wrong and the Rule is returned as failed. - If the second Content is not specified, then this disables the type (prevents the specified timeout action). - - For \fBexit\fR, this represents the number of MegaTime to wait when the Controller program is exiting (such as having received a terminate signal). - In this case, a terminate signal is sent to all child processes. - The \fBexit\fR timeout represents the amount of time to wait after sending the terminate signal before sending a kill signal to each child process still running. - When disabled, the program will not send a kill signal will continue running until all child processes to terminate. - The \fBexit\fR timeout does not get applied to any Rule. -.SH SPECIFICATION -.PP -The Exit files follow the \fBFSS\-0005 (Somewhat Basic List)\fR format. - -An Exit file name is expected to have the file extension \fB.exit\fR. - -For each Exit file: - \- The outer most part is a \fBFSS\-0002 (Basic List)\fR. - \- The Basic List Object is considered the \fBItem\fR. - \- The Basic List Content are considered the \fBActions\fR. - \- The \fBActions\fR are \fBFSS\-0001 (Extended)\fR. - \- Each Action Object is the \fBAction Name\fR. - \- Each Action Content are the \fBAction Parameters\fR. - -The Items: - \- \fBmain\fR: required. - - \- \fBsettings\fR: optional, Actions may be one of: - \- \fBpid\fR: Exactly one Content that is one of \fBdisable\fR, \fBrequire\fR, or \fBready\fR. - \- \fBsession\fR: Exactly one Content that is one of \fBnew\fR or \fBsame\fR. - \- \fBshow\fR: Exactly one Content that is one of \fBnormal\fR or \fBinit\fR. - \- \fBtimeout\fR: One or Two content with the first being one of \fBexit\fR, \fBstart\fR, \fBstop\fR, or \fBkill\fR and the (optional) second Content being a positive whole number or 0. - - The Exit file may have any other valid Item Objects, but only the above are reserved. - - The Actions: - \- \fBconsider\fR: One or more Content. - The first Content that is the relative file path (without any leading/trailing slashes and without file extension). - The second Content that is the basename for a rule file. - The third and beyond may only be one of: - \- \fBasynchronous\fR - \- \fBrequire\fR - \- \fBwait\fR - - \- \fBfailsafe\fR: One Content that is a valid Object name, except for the reserved \fBmain\fR. - - \- \fBfreeze\fR: Two or more Content. - The first Content that is the relative directory path (without any leading/trailing slashes). - The second Content that is the basename for a rule file. - The third and beyond may only be one of: - \- \fBasynchronous\fR - \- \fBrequire\fR - \- \fBwait\fR - - \- \fBitem\fR: One Content that is a valid Object name, except for the reserved \fBmain\fR. - - \- \fBkill\fR: Two or more Content. - The first Content that is the relative directory path (without any leading/trailing slashes). - The second Content that is the basename for a rule file. - The third and beyond may only be one of: - \- \fBasynchronous\fR - \- \fBrequire\fR - \- \fBwait\fR - - \- \fBpause\fR: Two or more Content. - The first Content that is the relative directory path (without any leading/trailing slashes). - The second Content that is the basename for a rule file. - The third and beyond may only be one of: - \- \fBasynchronous\fR - \- \fBrequire\fR - \- \fBwait\fR - - \- \fBready\fR: Zero or One Content. - The first may only be one of: - \- \fBwait\fR - - \- \fBreload\fR: Two or more Content. - The first Content that is the relative directory path (without any leading/trailing slashes). - The second Content that is the basename for a rule file. - The third and beyond may only be one of: - \- \fBasynchronous\fR - \- \fBrequire\fR - \- \fBwait\fR - - \- \fBrestart\fR: Two or more Content. - The first Content that is the relative directory path (without any leading/trailing slashes). - The second Content that is the basename for a rule file. - The third and beyond may only be one of: - \- \fBasynchronous\fR - \- \fBrequire\fR - \- \fBwait\fR - - \- \fBresume\fR: Two or more Content. - The first Content that is the relative directory path (without any leading/trailing slashes). - The second Content that is the basename for a rule file. - The third and beyond may only be one of: - \- \fBasynchronous\fR - \- \fBrequire\fR - \- \fBwait\fR - - \- \fBstart\fR: Two or more Content. - The first Content that is the relative directory path (without any leading/trailing slashes). - The second Content that is the basename for a rule file. - The third and beyond may only be one of: - \- \fBasynchronous\fR - \- \fBrequire\fR - \- \fBwait\fR - - \- \fBstop\fR: Two or more Content. - The first Content that is the relative directory path (without any leading/trailing slashes). - The second Content that is the basename for a rule file. - The third and beyond may only be one of: - \- \fBasynchronous\fR - \- \fBrequire\fR - \- \fBwait\fR - - \- \fBthaw\fR: Two or more Content. - The first Content that is the relative directory path (without any leading/trailing slashes). - The second Content that is the basename for a rule file. - The third and beyond may only be one of: - \- \fBasynchronous\fR - \- \fBrequire\fR - \- \fBwait\fR - - \- \fBtimeout\fR: Two Content. - The first being one of: - \- \fBexit\fR - \- \fBstart\fR - \- \fBstop\fR - \- \fBkill\fR - The (optional) second Content being a positive whole number or 0. -.SH SEE ALSO -.PP -\fBcontrol\fR(1), -\fBcontroller\fR(1), -\fBcontroller\-actions\fR(5), -\fBcontroller\-entry\fR(5), -\fBcontroller\-packet\fR(5), -\fBcontroller\-rule\fR(5) -.SH AUTHOR -Written by Kevin Day. -.SH COPYRIGHT -.PP -Copyright \(co 2007-2023 Kevin Day, Open Standard License 1.0 or later. diff --git a/build/documentation/man/man5/controller-packet.5 b/build/documentation/man/man5/controller-packet.5 deleted file mode 100644 index c62cc93..0000000 --- a/build/documentation/man/man5/controller-packet.5 +++ /dev/null @@ -1,140 +0,0 @@ -.TH controller-rule "5" "January 2023" "Controller 0.7.0" "File Formats" -.SH NAME -Controller \- "rule" file. -.SH SYNOPSIS -.B rule -.SH DESCRIPTION -.PP -Describes how a packet is designed and intended to be used. - -The \fBpacket\fR is the general category in which multiple types of packets belong. -This describes the different packets based on their \fBtype\fR. - -Each packet begins with a control block and a size block followed by a payload block. - - The control block: - The leading bit (starting from the left) designates the the format of the payload, which is 0 for string and 1 for binary. - The second bit (starting from the left) designates the the byte order for the rest of the packet, which 0 is for little endian and 1 is for big endian. - The remaining 6\-bits are reserved for future use. - - The size block: - The size block represents the size of the entire packet (the control block, the size blocks, and the payload block). - This number is a single 32\-bit unsigned integer. - - Example packet structure: - - [ Control Block ] [ Size Block ] [ Payload Block ] - [ 0b10000000 ] [ 0b00000000 0b00000000 0b00000100 0b11010010 ] [ size: 1229 (1234 \- 5) ] - - - The payload block: - This block is represented by the \fBFSS\-000E (Payload)\fR specification and its structure ad use is described in the next sections. - - The following types of payload are received or sent: - 1) controller payload. - 2) error payload. - 3) init payload. - -The controller payload: - Commands being sent to the controller and their respective responses utilize a \fBcontroller\fR payload. - These are pre\-defined commands to rules or the controller program itself. - Commands such as starting or stopping some rule, for example. - A controller payload is also sent in response to a controller payload request to represent a success. - - The \fBnow\fR condition designates that the kexec, reboot, or shutdown is to begin immediately. - The \fBat\fR condition designates that the kexec, reboot, or shutdown is to begin once a specific date and time is reached by the system clock. - The \fBin\fR condition designates that the kexec, reboot, or shutdown is to begin once a specific amount of time is passed by the system clock since the execution of this command started. - - For these \fBtime\fR conditions, different units of time should be supported, such as \fBseconds\fR, \fBdays\fR, \fByears\fR as standard time, Time, or UNIX Time (Epoch Time). - - The normal \fBcontroller\fR payload commands are any valid Rule Action that performs some action. - This does not include Actions that provide some setting or configuration (such as \fBwith_pid\fR). - Some of the supported commands are: \fBfreeze\fR, \fBkill\fR, \fBpause\fR, \fBreload\fR, \fBrerun\fR, \fBrestart\fR, \fBresume\fR, \fBstart\fR, \fBstop\fR, or \fBthaw\fR. - Multiple commands may be sent multiple \fBaction\fR headers. - The \fBaction\fR headers are order sensitive, executing from top to bottom, and one does not start until the previous successfully completes. - - Multiple \fBstatus\fR headers may exist in the response so long as they each match an \fBaction\fR in the request. - - The \fBpayload\fR is expected to be empty and have a length of 0 for a request. - The \fBpayload\fR may have an \fBFSS\-0000 (Basic)\fR format containing a single Object \fBmessage\fR to represent a message associated with an action. - Multiple \fBmessage\fR may exist in the response so long as they each match an \fBaction\fR in the request. - -The error payload: - The error payload is intended to communicate some sort of failure. - The error payload is only sent in response to some request (and not in response to another response). - The control (the client) is not expected to send error payloads and the controller (the service) should send an error in response to an error payload or ignore it entirely. - The \fBstatus\fR from the \fBheader\fR designates the status code as either a status code name string or a status code number (where a number may have error and warning bits). - The \fBpayload\fR will contain a NULL terminated string representing the message used to describe the error. - -The init payload: - The init payload is intended exclusively for the \fBinit\fR operation mode and is expected to only be available when running as \fBinit\fR. - This is used to provide special actions, namely \fBkexec\fR, \fBreboot\fR, and \fBshutdown\fR. - - The \fBkexec\fR is for booting into another kernel, which may effectively be the same as a \fBreboot\fR ("kexec" is currently neither supported nor implemented). - The \fBreboot\fR is for rebooting the machine (currently not implemented). - The \fBshutdown\fR is for shutting down the machine (currently not implemented). - These three commands are configurable to fire off based on conditions. -.SH SPECIFICATION -.PP -The controller program communicates use the \fBFSS\-000F (Packet)\fR. -This specification declares how the Payload Block, which is in \fBFSS\-000E (Payload)\fR format, is required to be used. - -Only a single \fBheader\fR is allowed. -Only a single \fBpayload\fR is allowed. - -Packet Structure: - Packet is grouped into the following blocks: - \- \fBcontrol\fR: A single 1\-byte block representing control codes. - \- \fBsize\fR: A single 4\-byte block representing the size of the entire packet, including the control block. - -The \fBheader\fR Object contains the following \fBFSS\-0001 (Extended)\fR Objects (depending on \fBtype\fR): - \- \fBaction\fR: A valid action type: \fBfreeze\fR, \fBkexec\fR, \fBkill\fR, \fBpause\fR, \fBreboot\fR, \fBreload\fR, \fBrerun\fR, \fBrestart\fR, \fBresume\fR, \fBshutdown\fR, \fBstart\fR, \fBstop\fR, or \fBthaw\fR. - \- \fBlength\fR: A positive whole number inclusively between 0 and 4294965248 representing the length of the \fBpayload\fR (may be in binary, octal, decimal, duodecimal, or hexidecimal). - \- \fBstatus\fR: The status code name or number representing an FSS status code, such as F_okay, F_failure, or 200 (where a number may have error and warning bits and may be in binary, octal, decimal, duodecimal, or hexidecimal). - \- \fBtype\fR: The packet type that is one of \fBcontroller\fR, \fBerror\fR, or \fBinit\fR. - -When there are multiple Objects of the same name inside the \fBheader\fR: - \- \fBaction\fR: The order represents the order in which the actions are performed. - \- \fBlength\fR: There may only be one length Object, all others after the first are ignored (may be in binary, octal, decimal, duodecimal, or hexidecimal). - \- \fBstatus\fR: A status for each action, in the same order as the order of the action, such as F_okay, F_failure, or 200 (where a number may have error and warning bits and may be in binary, octal, decimal, duodecimal, or hexidecimal). - \- \fBtype\fR: The first represent the type and all others represents a sub\-type. - -There are different headers and payload properties based on the \fBtype\fR. - -The \fBcontroller\fR type: - Supports the following headers: \fBaction\fR, \fBlength\fR, \fBstatus\fR, and \fBtype\fR. - - Only a single \fBaction\fR may be provided and must exist for request and response packets. - Only a single \fBstatus\fR may be provided and must exist for response packets. - - The \fBpayload\fR is dependent on the \fBaction\fR. - -The \fBerror\fR type: - Supports the following headers: \fBlength\fR, \fBstatus\fR, and \fBtype\fR. - - Only a single \fBstatus\fR may be provided and must exist for request and response packets. - - The \fBpayload\fR is a NULL terminated string whose length is defined by the \fBlength\fR \fBheader\fR Content. - -There are different headers and payload properties based on the \fBtype\fR. - -The \fBinit\fR type: - Supports the following headers: \fBaction\fR, \fBlength\fR, \fBstatus\fR, and \fBtype\fR. - - Only a single \fBaction\fR may be provided and must exist for request and response packets. - Only a single \fBstatus\fR may be provided and must exist for response packets. - - The \fBpayload\fR is dependent on the \fBaction\fR. -.SH SEE ALSO -.PP -\fBcontrol\fR(1), -\fBcontroller\fR(1), -\fBcontroller\-actions\fR(5), -\fBcontroller\-entry\fR(5), -\fBcontroller\-exit\fR(5), -\fBcontroller\-rule\fR(5) -.SH AUTHOR -Written by Kevin Day. -.SH COPYRIGHT -.PP -Copyright \(co 2007-2023 Kevin Day, Open Standard License 1.0 or later. diff --git a/build/documentation/man/man5/controller-rule.5 b/build/documentation/man/man5/controller-rule.5 deleted file mode 100644 index 47b81b5..0000000 --- a/build/documentation/man/man5/controller-rule.5 +++ /dev/null @@ -1,245 +0,0 @@ -.TH controller-rule "5" "January 2023" "Controller 0.7.0" "File Formats" -.SH NAME -Controller \- "rule" file. -.SH SYNOPSIS -.B rule -.SH DESCRIPTION -.PP -This describes the intent and purpose of a Rule file. - -A Rule file, such as \fBssh.rule\fR, is intended to designate what to execute. - -The rule file is read top\-down, except for the outer most list \fBsettings\fR, which is intended to store setting data for this rule. -Multiple outer most list Objects may be specified and they are executed as provided, in a top\-down manner. - -\- The \fBsettings\fR Rule Type has the following \fBFSS\-0001 (Extended)\fR Content: - \- \fBaffinity\fR: Define one or more processors to restrict this rule by with each number representing a specific processor by its id (starting at 0). - \- \fBcapability\fR: Define a set of capabilities in which to use, using the capability \fBtext\fR format (such as \fB= cap_chown+ep\fR). - \- \fBcgroup\fR: Define a cgroup (control group) in which everything within this rule executes under. - \- \fBdefine\fR: A single environment variable name and its associated value that is automatically exposed to processes executed within this rule. - \- \fBengine\fR: An executable name of a script, such as \fBbash\fR, to use for the \fBscript\fR Rule Type (which likely defaults to \fBbash\fR if not specified). - \- \fBenvironment\fR: A set of environment variables to expose to the processes executed within this rule (PATH is always exposed). - \- \fBgroup\fR: A set of group names or IDs to execute as with the first group being the primary group and all remaining being supplementary groups. - \- \fBlimit\fR: Define a resource limit to use (multiple limits may be specified, but only once for each type). - \- \fBname\fR: A name used to represent this rule, which is printed to the user, screen, logs, etc... - \- \fBnice\fR: A single niceness value to run all processes executed within this rule as (\-20 gets to be greediest in CPU usage and 19 being the nicest in CPU usage). - \- \fBon\fR: Define a Rule Action in which a specified dependency is needed, wanted, or wished for. - \- \fBparameter\fR: An IKI name and its associated value for use in this rule file. - \- \fBpath\fR: A single Content used to set a custom PATH environment variable value. - \- \fBscheduler\fR: A valid name of a scheduler to use followed by an optional priority number. - \- \fBtimeout\fR: A set of timeouts to wait for in which to perform a set action or to consider failure. - \- \fBuser\fR: A single user name or ID to execute as. - -\- The \fBcapability\fR setting: - If the user the controller program is run as does not have the desired capabilities already, they cannot be added. - This essentially maintains or reduces the capabilities already available. - Due to capabilities only being a draft in the POSIX standard, one may expect \fBcapabilities\fR support may not be available and in such a case this setting will do nothing. - If the dependent project (f_capability) does not have libcap support enabled, then capabilities will be unsupported by the compilation of this project. - -\- The \fBcontrol\fR setting: - The first argument is either \fBexisting\fR or \fBnew\fR, where for \fBexisting\fR the process is run inside the existing control used by the parent and when \fBnew\fR the process is executed within a new control group namespace entirely. - -\- The \fBdefine\fR setting: - Use this to define an environment variable (this overwrites any existing environment variable with this name). - A define is both exported as an environment variable as well as exposed as an IKI variable. - Example IKI variable substitution: for \fBdefine PATH /bin:/sbin\fR, the associated IKI variable would look like: PATH. - - All environment variables, including those defined using this, must be in the \fBenvironment\fR list to be exported to the executed process. - Environment variables added here that are not added to the environment are still exposed as an IKI variable. - -\- The \fBengine\fR setting: - This engine is used for both \fBscript\fR and \fButility\fR Rule Types. - The program that engine refers to must accept a standard input pipe to be supported. - Additional parameters may be passed to the engine. - -\- The \fBgroup\fR and \fBuser\fR settings: - Only users and groups that the user the controller program is being run as is allowed to use may be used. - -\- The \fBlimit\fR setting: - The first parameter must be one of: \fBas\fR, \fBcore\fR, \fBcpu\fR, \fBdata\fR, \fBfsize\fR, \fBlocks\fR, \fBmemlock\fR, \fBmsgqueue\fR, \fBnice\fR, \fBnofile\fR, \fBnproc\fR, \fBrss\fR, \fBrtprio\fR, \fBrttime\fR, \fBsigpending\fR, or \fBstack\fR. - The second parameter represents the soft limit. - The third parameter represents the hard limit. - This may be specified multiply times, but only once for each type. - -\- The \fBon\fR setting: - The first parameter represents the Action the dependency exists under and must be one of: \fBfreeze\fR, \fBkill\fR, \fBpause\fR, \fBreload\fR, \fBrestart\fR, \fBresume\fR, \fBstart\fR, \fBstop\fR, or \fBthaw\fR. - The second parameter represents how the dependency is required and must be one of: \fBneed\fR, \fBwant\fR, or \fBwish\fR. - The third parameter is a partial path to the rule file. - The fourth parameter represents the name of the rule file. - - \- In the case of the second parameter: - \- A \fBneed\fR designates that the dependent rule is required to be executed (must exist and must succeed). - \- A \fBwant\fR designates that the dependent rule is to be executed (may exist and if it does, then it must succeed). - \- A \fBwish\fR designates that the dependent rule is to be executed (may exist and if it does, but it does not need to succeed). - - In the case of \fBwant\fR and \fBwish\fR, if the desired rule is either not found or is otherwise disabled, then this will not fail or otherwise block the wanting or wishing rule. - -\- The \fBpath\fR setting: - When specified, the \fBPATH\fR environment variable is automatically added to the \fBenvironment\fR setting. - -\- The \fBparameter\fR setting: - Use this to define an IKI variable name and value. - These do not conflict with environment variables and are not exposed as environment variables. - Example IKI variable substitution: for \fBparameter hello world\fR, the associated IKI variable would look like: hello. - -\- The \fBscheduler\fR setting: - The valid range of the priority number is dependent on the scheduler. - For example, non\-real\-time schedulers (such as \fBidle\fR) only support a value of 0 whereas real\-time schedulers (such as \fBfifo\fR) only support an inclusive range of 1 to 99. - Supported non\-real\-time schedulers are: \fBbatch\fR, \fBidle\fR, and \fBother\fR (aka: normal/default). - Supported real\-time schedulers are: \fBdeadline\fR, \fBfifo\fR, \fBround_robin\fR. - -\- The \fBtimeout\fR setting: - (This is not currently implemented.) - Provides settings for each of the three special situations: \fBkill\fR, \fBstart\fR, and \fBstop\fR. - Each of these may only have a single one exist at a time (one \fBkill\fR, one \fBstart\fR, and one \fBstop\fR). - Each successive \fBtimeout\fR Item Action, specific to each Action Name (such as \fBstart\fR), specified replaces the previously defined \fBtimeout\fR Action (in a top\-down manner). - The second Content for each of these, when specified, may be a 0 or greater whole number representing the number of MegaTime (MT) (equivalent to milliseconds). - For \fBkill\fR, this represents the number of MegaTime to wait after stopping some Rule and that Rule has not yet stopped to forcefully stop the Rule (aka kill the Rule). - For \fBstart\fR, this represents the number of MegaTime to wait after starting some Rule before assuming something went wrong and the Rule is returned as failed. - For \fBstop\fR, this represents the number of MegaTime to wait after stopping some Rule before assuming something went wrong and the Rule is returned as failed. - If the second Content is not specified, then this disables the type (prevents the specified timeout action). - -There are four available Rule Types to choose from: \fBcommand\fR, \fBservice\fR, \fBscript\fR, and \fButility\fR. - -The \fBcommand\fR Rule Type provides a simple command to run under the different circumstances: \fBstart\fR, \fBstop\fR, \fBrestart\fR, and \fBreload\fR. -A \fBcommand\fR always operates in the foreground. - -The \fBservice\fR Rule Type provides a \fBcommand\fR accompanied with a PID file (Process Identifier file). - -The \fBscript\fR Rule Type provides a series of lines to be executed by some engine, such as GNU Bash. -This \fBscript\fR operates in the foreground, but individual things done within the script may operate in foreground or background. -The last return state is treated as an error, so be sure to finish the script with a return code of 0 to designate no error and any other whole number, such a 1, to designate an error. -Therefore passing \fBexit 1\fR would return as an error and passing \fBexit 0\fR would return as a success. -A \fBscript\fR is assumed to be in GNU Bash, which is the default expected behavior, but the specification does not explicitly require this. -Another scripting language can be used but changing this incurs the responsibility to ensure all rules are updated to the appropriate scripting language. - -The \fButility\fR Rule Type provides a \fBscript\fR accompanied with a PID file (Process Identifier file). - -There are nine Rule Actions used to execute ("freeze", \fBkill\fR, \fBpause\fR, \fBreload\fR, \fBrestart\fR, \fBresume\fR, \fBstart\fR, \fBstop\fR, and \fBthaw\fR): - When \fBrestart\fR Object's Content is not provided, then \fBstart\fR and \fBstop\fR is called when the rule is executed using the restart Action, if both \fBstart\fR and \fBstop\fR are provided. - When \fBreload\fR, \fBstart\fR, or \fBstop\fR Object's Content are not provided, then no respective Action is performed. - - Commands are conditionally available depending on the presence of these, such as if \fBstop\fR is not provided then \fBstop\fR (and \fBrestart\fR) will not be available for the \fBcontrol\fR program(s) to use. - -Thee are additional Rule Actions not used to execute ("pid_file", \fBrerun\fR, and \fBwith\fR): - \- The \fBpid_file\fR Object's Content designates the path to the PID file created by the called program. - - \- The \fBrerun\fR Object's Content designates how to re\-run a given execution Rule type. - \- The first Content represents the execution type, which may be one of: \fBfreeze\fR, \fBkill\fR, \fBpause\fR, \fBreload\fR, \fBrestart\fR, \fBresume\fR, \fBstart\fR, \fBstop\fR, and \fBthaw\fR. - - \- The second Content represents when to run this re\-run is triggered, which is either \fBsuccess\fR (return code of 0) or \fBfailure\fR (return code is not 0). - - \- The third Content and more represent additional options for fine tuning how the re\-run is Performed: - When \fBdelay\fR, followed by a number of MegaTime (MT) (equivalent to milliseconds) in which to wait before attempting the re\-run. - When \fBmax\fR, followed by a positive number or the number 0 designating the maximum number of re\-runs to perform. - When \fBreset\fR, the \fBmax\fR re\-run counter is reset for the opposite re\-run when this re\-run is triggered, such as: - A \fBrerun start success reset\fR and a \fBrerun failure max 10\fR, the failure counter would reset to 0 when the \fBsuccess\fR re\-run is performed and not when the \fBfailure\fR re\-run is performed. - - A \fBmax\fR of 0 designates that the re\-run will happen infinitely. - - \- The \fBwith\fR Object's Content designates special flags designating very specific behavior to be applied to any single Rule Type. -.SH SPECIFICATION -.PP -The Rule files follow the \fBFSS\-000D (Basic Rule)\fR format with IKI\-0000 (Unrestricted). - -A Rule file name is expected to have the file extension \fB.rule\fR. - -For each Rule file: - \- The outer most part is a \fBFSS\-0002 (Basic List)\fR. - \- The Basic List Object is considered the \fBRule Type\fR. - \- The Basic List Content is determined by the specific \fBRule Type\fR. - \- The Content for each \fBRule Type\fR is called the \fBItem\fR. - \- Each Item Object is the \fBItem Name\fR. - \- Each Item Content is either the \fBAction\fR or the \fBSetting\fR. - \- Each Action Object is the \fBAction Name\fR. - \- Each Action Content are the \fBAction Parameters\fR. - \- Each Setting Object is the \fBSetting Name\fR. - \- Each Setting Content are the \fBSetting Values\fR. - -The Rule Types: - \- \fBcommand\fR: Follows either \fBFSS\-0003 (Extended List)\fR or \fBFSS\-0001 (Extended)\fR. - \- \fBscript\fR: Follows either \fBFSS\-0003 (Extended List)\fR or \fBFSS\-0001 (Extended)\fR. - \- \fBservice\fR: Follows either \fBFSS\-0003 (Extended List)\fR or \fBFSS\-0001 (Extended)\fR. - \- \fBsettings\fR: Is required and follows either \fBFSS\-0001 (Extended)\fR. - \- \fButility\fR: Follows either \fBFSS\-0003 (Extended List)\fR or \fBFSS\-0001 (Extended)\fR. - -For the above Rule Types, \fBsettings\fR may be specified only once whereas the others may be specifed multiple times. -The \fBsettings\fR Rule Type is always processed first, regardless of position. -The other Rule Types are processed top\-down. - -The \fBsettings\fR Rule Type has the following \fBFSS\-0001 (Extended)\fR: - \- \fBaffinity\fR: One or more Content, each must be a 0 or greater whole number. - \- \fBcapability\fR: One Content representing capabilities. - \- \fBcgroup\fR: Two or more Content, the first Content being either \fBexisting\fR or \fBnew\fR and the remaining representing a valid cgroup (control group) name, must have at least 1 graph character (non white space printing character) (leading and trailing white space are trimmed off). - \- \fBdefine\fR: Two Content, the first Content must be a case\-sensitive valid environment variable name (alpha\-numeric or underscore, but no leading digits). - \- \fBengine\fR: One or more Content representing a valid program name or path (such as \fBbash\fR or \fB/bin/bash\fR) and any optional arguments. - \- \fBenvironment\fR: Zero or more Content, each must be a case\-sensitive valid environment variable name (alpha\-numeric or underscore, but no leading digits). - \- \fBgroup\fR: One or more Content representing group names or group ids. - \- \fBlimit\fR: Three Content, with the first representing a valid resource type and the second and third being a valid resource limit number (positive whole number or 0). - \- \fBname\fR: One Content, must have at least 1 graph character (non white space printing character) (leading and trailing white space are trimmed off). - \- \fBnice\fR: One Content, must be a valid number for process \fBniceness\fR (Any whole number inclusively between \-20 to 19). - \- \fBon\fR: Four Content, the first being a Rule Action, the second being \fBneed\fR, \fBwant\fR, or \fBwish\fR, the third being a partial path, and the fourth being a Rule file name without \fB.rule\fR extension. - \- \fBparameter\fR: Two Content, the first Content must be a case\-sensitive valid IKI name and the second being an IKI value. - \- \fBpath\fR: One Content representing a valid \fBPATH\fR environment string (such as \fB/bin:/sbin:/usr/bin\fR). - \- \fBscheduler\fR: One or two Content representing a scheduler name and the optional numeric priority (Any whole number inclusively between 0 and 99). - \- \fBtimeout\fR: One or two content with the first being one of \fBexit\fR, \fBstart\fR, \fBstop\fR, or \fBkill\fR and the (optional) second Content being a positive whole number or 0. - \- \fBuser\fR: One Content representing a user name or user id. - -The \fBcommand\fR and \fBscript\fR Rule Types allow the following the \fBFSS\-0001 (Extended)\fR: - \- \fBfreeze\fR: One or more Content representing a program being executed and its arguments. - \- \fBkill\fR: One or more Content representing a program being executed and its arguments. - \- \fBpause\fR: One or more Content representing a program being executed and its arguments. - \- \fBreload\fR: One or more Content representing a program being executed and its arguments. - \- \fBrerun\fR: Two or more Content representing a Rule type that executes and its properties. - \- \fBrestart\fR: One or more Content representing a program being executed and its arguments. - \- \fBresume\fR: One or more Content representing a program being executed and its arguments. - \- \fBstart\fR: One or more Content representing a program being executed and its arguments. - \- \fBstop\fR: One or more Content representing a program being executed and its arguments. - \- \fBthaw\fR: One or more Content representing a program being executed and its arguments. - \- \fBwith\fR: One or more Content representing special options for the Rule Type. - -The \fBservice\fR and \fButility\fR Rule Types allow the following the \fBFSS\-0001 (Extended)\fR: - \- \fBpid_file\fR: One Content representing the path to a PID file. - \- \fBrerun\fR: Two or more Content representing a Rule type that executes and its properties. - \- \fBwith\fR: One or more Content being one of \fBfull_path\fR, \fBsession_new\fR, or \fBsession_same\fR. - -The \fBcommand\fR and \fBservice\fR Rule Types allow the following the \fBFSS\-0003 (Extended List)\fR: - \- \fBfreeze\fR: A list repesenting multiple programs and their respective arguments to execute. - \- \fBkill\fR: A list repesenting multiple programs and their respective arguments to execute. - \- \fBpause\fR: A list repesenting multiple programs and their respective arguments to execute. - \- \fBreload\fR: A list repesenting multiple programs and their respective arguments to execute. - \- \fBrestart\fR: A list repesenting multiple programs and their respective arguments to execute. - \- \fBresume\fR: A list repesenting multiple programs and their respective arguments to execute. - \- \fBstart\fR: A list repesenting multiple programs and their respective arguments to execute. - \- \fBstop\fR: A list repesenting multiple programs and their respective arguments to execute. - \- \fBthaw\fR: A list repesenting multiple programs and their respective arguments to execute. - -The \fBscript\fR and \fButility\fR Rule Types allow the following the \fBFSS\-0003 (Extended List)\fR: - \- \fBfreeze\fR: A list repesenting the contents of a script, such as a GNU Bash shell. - \- \fBkill\fR: A list repesenting the contents of a script, such as a GNU Bash shell. - \- \fBpause\fR: A list repesenting the contents of a script, such as a GNU Bash shell. - \- \fBreload\fR: A list repesenting the contents of a script, such as a GNU Bash shell. - \- \fBrestart\fR: A list repesenting the contents of a script, such as a GNU Bash shell. - \- \fBresume\fR: A list repesenting the contents of a script, such as a GNU Bash shell. - \- \fBstart\fR: A list repesenting the contents of a script, such as a GNU Bash shell. - \- \fBstop\fR: A list repesenting the contents of a script, such as a GNU Bash shell. - \- \fBthaw\fR: A list repesenting the contents of a script, such as a GNU Bash shell. - -The \fBrerun\fR Rule Type Content has the following structure: - The first Content represents one of: \fBfreeze\fR, \fBkill\fR, \fBpause\fR, \fBreload\fR, \fBrestart\fR, \fBresume\fR, \fBstart\fR, \fBstop\fR, or \fBthaw\fR. - The second Content represents one of: \fBsuccess\fR or \fBfailure\fR. - The third and more Content represents one of: \fBdelay\fR, \fBmax\fR, or \fBreset\fR. - Where \fBdelay\fR and \fBmax\fR must be followed by a positive number or the number 0. -.SH SEE ALSO -.PP -\fBcontrol\fR(1), -\fBcontroller\fR(1), -\fBcontroller\-actions\fR(5), -\fBcontroller\-entry\fR(5), -\fBcontroller\-exit\fR(5), -\fBcontroller\-packet\fR(5) -.SH AUTHOR -Written by Kevin Day. -.SH COPYRIGHT -.PP -Copyright \(co 2007-2023 Kevin Day, Open Standard License 1.0 or later. diff --git a/build/includes/program/controller/main/common.h b/build/includes/program/controller/main/common.h deleted file mode 100644 index 9d1a594..0000000 --- a/build/includes/program/controller/main/common.h +++ /dev/null @@ -1,48 +0,0 @@ -/** - * FLL - Level 3 - * - * Project: Controller - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Provides the common functionality. - * - * This is auto-included and should not need to be explicitly included. - */ -#ifndef _controller_main_common_h -#define _controller_main_common_h - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Perform the standard program setting load process. - * - * This prints error messages as appropriate. - * - * If either main or setting is NULL, then this immediately returns without doing anything. - * - * @param arguments - * The parameters passed to the process (often referred to as command line arguments). - * @param main - * The program and settings data. - * - * This alters setting.state.status: - * F_okay on success. - * - * Errors (with error bit) from: f_console_parameter_process(). - * Errors (with error bit) from: fll_program_parameter_process_context(). - * - * @see f_console_parameter_process() - * @see fll_program_parameter_process_context() - */ -#ifndef _di_controller_main_setting_load_ - extern void controller_main_setting_load(const f_console_arguments_t arguments, controller_main_t * const main); -#endif // _di_controller_main_setting_load_ - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // _controller_main_common_h diff --git a/build/includes/program/controller/main/common/define.h b/build/includes/program/controller/main/common/define.h deleted file mode 100644 index 8bf7926..0000000 --- a/build/includes/program/controller/main/common/define.h +++ /dev/null @@ -1,55 +0,0 @@ -/** - * FLL - Level 3 - * - * Project: Controller - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Provides the common define types. - * - * This is auto-included and should not need to be explicitly included. - */ -#ifndef _controller_main_common_define_h -#define _controller_main_common_define_h - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * The program allocation defines. - * - * controller_allocation_*_d: - * - console: An allocation step used for small buffers specifically for console parameter. - * - large: An allocation step used for buffers that are anticipated to have large buffers. - * - pipe: A buffer size used for processing piped data. - * - small: An allocation step used for buffers that are anticipated to have small buffers. - */ -#ifndef _di_controller_allocation_d_ - #define controller_allocation_console_d 4 - #define controller_allocation_large_d 256 - #define controller_allocation_pipe_d 16384 - #define controller_allocation_small_d 16 -#endif // _di_controller_allocation_d_ - -/** - * The program signal defines. - * - * controller_signal_*_d: - * - check: Number of iterations before performing signal check in non-threaded signal handling. - * - check_failsafe: When using threads, how many consecutive failures to check signal before aborting (as a recursion failsafe). - * - check_tiny: The tiny check. - * - check_short: The short signal check. - */ -#ifndef _di_controller_signal_d_ - #define controller_signal_check_d 500000 - #define controller_signal_check_failsafe_d 20000 - #define controller_signal_check_tiny_d 4 - #define controller_signal_check_short_d 16 -#endif // _di_controller_signal_d_ - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // _controller_main_common_define_h diff --git a/build/includes/program/controller/main/common/enumeration.h b/build/includes/program/controller/main/common/enumeration.h deleted file mode 100644 index 19b272b..0000000 --- a/build/includes/program/controller/main/common/enumeration.h +++ /dev/null @@ -1,100 +0,0 @@ -/** - * FLL - Level 3 - * - * Project: Controller - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Provides the common enumeration types. - * - * This is auto-included and should not need to be explicitly included. - */ -#ifndef _controller_main_common_enumeration_h -#define _controller_main_common_enumeration_h - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Flags passed to the main function or program. - * - * When number mode is not specified, then mode is "string" mode (there is no flag for "string" mode). - * - * controller_main_flag_*_e: - * - none: No flags set. - * - copyright: Print copyright. - * - error: Check if status is "error". - * - fine: Check if status is "fine". - * - help: Print help. - * - pipe: Use the input pipe. - * - print_first: When set, print new line to message output on program begin after loading settings. - * - print_last: When set, print new line to message output on program end. - * - version: Print version. - * - version_copyright_help: A helper flag representing version, copyright, and help flag bits being set. - * - warning: Check if status is "warning". - */ -#ifndef _di_controller_main_flag_e_ - enum { - controller_main_flag_none_e = 0x0, - controller_main_flag_copyright_e = 0x1, - controller_main_flag_error_e = 0x2, - controller_main_flag_fine_e = 0x4, - controller_main_flag_help_e = 0x8, - controller_main_flag_pipe_e = 0x10, - controller_main_flag_print_first_e = 0x20, - controller_main_flag_print_last_e = 0x40, - controller_main_flag_version_e = 0x80, - controller_main_flag_version_copyright_help_e = 0x89, - controller_main_flag_warning_e = 0x100, - }; // enum -#endif // _di_controller_main_flag_e_ - -/** - * The main program parameters. - */ -#ifndef _di_controller_parameter_e_ - enum { - controller_parameter_controller_e = f_console_standard_parameter_last_e, - }; // enum - - #define controller_console_parameter_t_initialize \ - { \ - macro_fll_program_console_parameter_standard_initialize, \ - \ - macro_f_console_parameter_t_initialize_3(controller_short_controller_s, controller_long_controller_s, 0, f_console_flag_normal_e), \ - } - - #define controller_parameter_total_d (f_console_parameter_state_type_total_d + 1) -#endif // _di_controller_parameter_e_ - -/** - * Flags for fine-tuned print control. - * - * controller_print_flag_*_e: - * - none: No flags set. - * - debug: Stream is for debug printing. - * - error: Stream is for error printing. - * - in: Stream is a source file. - * - message: Stream is for message printing. - * - out: Stream is a destination file. - * - warning: Stream is for warning printing. - */ -#ifndef _di_controller_print_flag_e_ - enum { - controller_print_flag_none_e = 0x0, - controller_print_flag_debug_e = 0x1, - controller_print_flag_error_e = 0x2, - controller_print_flag_file_e = 0x4, - controller_print_flag_in_e = 0x8, - controller_print_flag_out_e = 0x10, - controller_print_flag_message_e = 0x20, - controller_print_flag_warning_e = 0x40, - }; // enum -#endif // _di_controller_print_flag_e_ - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // _controller_main_common_enumeration_h diff --git a/build/includes/program/controller/main/common/print.h b/build/includes/program/controller/main/common/print.h deleted file mode 100644 index 3d48967..0000000 --- a/build/includes/program/controller/main/common/print.h +++ /dev/null @@ -1,53 +0,0 @@ -/** - * FLL - Level 3 - * - * Project: Controller - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Provides the common print functionality. - * - * This is auto-included and should not need to be explicitly included. - */ -#ifndef _controller_main_common_print_h -#define _controller_main_common_print_h - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * A special array of strings intended for representing funciton names. - * - * These are primarily used for printing errors with the function names. - * - * The macro macro_controller_f() is used to reference the array index by the enum name. - * - * macro_controller_f(): - * - name: The name of the function. - */ -#ifndef _di_controller_f_a_ - extern const f_string_t controller_f_a[]; - - #define macro_controller_f(name) controller_f_a[controller_f_##name##_e] -#endif // _di_controller_f_a_ - -/** - * An enum representing specific indexes within the above array. - * - * This is a convenience enum used to make code slightly more readable. - */ -#ifndef _di_controller_f_e_ - enum { - controller_f_f_console_parameter_process_e, - controller_f_f_thread_create_e, - controller_f_fll_program_parameter_process_context_standard_e, - controller_f_fll_program_parameter_process_verbosity_standard_e, - }; // enum -#endif // _di_controller_f_e_ - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // _controller_main_common_print_h diff --git a/build/includes/program/controller/main/common/string.h b/build/includes/program/controller/main/common/string.h deleted file mode 100644 index fff2a1e..0000000 --- a/build/includes/program/controller/main/common/string.h +++ /dev/null @@ -1,83 +0,0 @@ -/** - * FLL - Level 3 - * - * Project: Controller - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Provides the common string structures. - * - * This is auto-included and should not need to be explicitly included. - */ -#ifndef _controller_main_common_string_h -#define _controller_main_common_string_h - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * The program version. - */ -#ifndef _di_controller_program_version_s_ - #define CONTROLLER_program_version_major_s F_string_ascii_0_s - #define CONTROLLER_program_version_minor_s F_string_ascii_7_s - #define CONTROLLER_program_version_micro_s F_string_ascii_0_s - - #define CONTROLLER_program_version_major_s_length F_string_ascii_0_s_length - #define CONTROLLER_program_version_minor_s_length F_string_ascii_7_s_length - #define CONTROLLER_program_version_micro_s_length F_string_ascii_0_s_length - - #if !(defined(CONTROLLER_program_version_nano_prefix_s) && defined(CONTROLLER_program_version_nano_prefix_s_length)) - #define CONTROLLER_program_version_nano_prefix_s - #define CONTROLLER_program_version_nano_prefix_s_length 0 - #endif // !(defined(CONTROLLER_program_version_nano_prefix_s) && defined(CONTROLLER_program_version_nano_prefix_s_length)) - - #if !(defined(CONTROLLER_program_version_nano_s) && defined(CONTROLLER_program_version_nano_s_length)) - #define CONTROLLER_program_version_nano_s - #define CONTROLLER_program_version_nano_s_length 0 - #endif // !(defined(CONTROLLER_program_version_nano_s) && defined(CONTROLLER_program_version_nano_s_length)) - - #define CONTROLLER_program_version_s CONTROLLER_program_version_major_s F_string_ascii_period_s CONTROLLER_program_version_minor_s F_string_ascii_period_s CONTROLLER_program_version_micro_s CONTROLLER_program_version_nano_prefix_s CONTROLLER_program_version_nano_s - - #define CONTROLLER_program_version_s_length CONTROLLER_program_version_major_s_length + F_string_ascii_period_s_length + CONTROLLER_program_version_minor_s_length + F_string_ascii_period_s_length + CONTROLLER_program_version_micro_s_length + CONTROLLER_program_version_nano_prefix_s_length + CONTROLLER_program_version_nano_s_length - - extern const f_string_static_t controller_program_version_s; -#endif // _di_controller_program_version_s_ - -/** - * The program name. - */ -#ifndef _di_controller_program_name_s_ - #define CONTROLLER_program_name_s "controller" - #define CONTROLLER_program_name_long_s "Controller" - - #define CONTROLLER_program_name_s_length 10 - #define CONTROLLER_program_name_long_s_length 10 - - extern const f_string_static_t controller_program_name_s; - extern const f_string_static_t controller_program_name_long_s; -#endif // _di_controller_program_name_s_ - -/** - * The main program parameters. - */ -#ifndef _di_controller_parameter_s_ - #define CONTROLLER_short_controller_s "e" - - #define CONTROLLER_long_controller_s "controller" - - #define CONTROLLER_short_controller_s_length 1 - - #define CONTROLLER_long_controller_s_length 7 - - extern const f_string_static_t controller_short_controller_s; - - extern const f_string_static_t controller_long_controller_s; -#endif // _di_controller_parameter_s_ - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // _controller_main_common_string_h diff --git a/build/includes/program/controller/main/common/type.h b/build/includes/program/controller/main/common/type.h deleted file mode 100644 index 4a9bd23..0000000 --- a/build/includes/program/controller/main/common/type.h +++ /dev/null @@ -1,138 +0,0 @@ -/** - * FLL - Level 3 - * - * Project: Controller - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Provides the common type structures. - * - * This is auto-included and should not need to be explicitly included. - */ -#ifndef _controller_main_common_type_h -#define _controller_main_common_type_h - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * The controller main program cache. - * - * buffer: A generic buffer. - */ -#ifndef _di_controller_cache_t_ - typedef struct { - f_string_dynamic_t buffer; - } controller_cache_t; - - #define controller_cache_t_initialize \ - { \ - f_string_dynamic_t_initialize, \ - } -#endif // _di_controller_cache_t_ - -/** - * The controller main program settings. - * - * This is passed to the program-specific main entry point to designate program settings. - * These program settings are often processed from the program arguments (often called the command line arguments). - * - * flag: Flags passed to the main function. - * - * status_signal: A status used eclusively by the threaded signal handler. - * state: The state data used when processing the FSS data. - */ -#ifndef _di_controller_setting_t_ - typedef struct { - uint16_t flag; - - f_status_t status_signal; - f_state_t state; - - const f_string_static_t *program_name; - const f_string_static_t *program_name_long; - } controller_setting_t; - - #define controller_setting_t_initialize \ - { \ - controller_main_flag_none_e, \ - F_okay, \ - f_state_t_initialize, \ - 0, \ - 0, \ - } -#endif // _di_controller_setting_t_ - -/** - * The main program data as a single structure. - * - * program: The main program data. - * setting: The settings data. - */ -#ifndef _di_controller_main_t_ - typedef struct { - fll_program_data_t program; - controller_setting_t setting; - controller_cache_t cache; - } controller_main_t; - - #define controller_main_t_initialize \ - { \ - fll_program_data_t_initialize, \ - controller_setting_t_initialize, \ - controller_cache_t_initialize, \ - } -#endif // _di_controller_main_t_ - -/** - * Deallocate main program data. - * - * @param cache - * The program cache. - * - * Must not be NULL. - * - * @see f_memory_array_resize() - */ -#ifndef _di_controller_cache_delete_ - extern void controller_cache_delete(controller_cache_t * const cache); -#endif // _di_controller_cache_delete_ - -/** - * Deallocate main program data. - * - * @param main - * The main program data. - * - * Must not be NULL. - * - * This does not alter main.setting.state.status. - * - * @see controller_cache_delete() - * @see controller_setting_delete() - * @see fll_program_data_delete() - */ -#ifndef _di_controller_main_delete_ - extern void controller_main_delete(controller_main_t * const main); -#endif // _di_controller_main_delete_ - -/** - * Delete the program main setting data. - * - * @param setting - * The program main setting data. - * - * Must not be NULL. - * - * This does not alter setting.state.status. - */ -#ifndef _di_controller_setting_delete_ - extern void controller_setting_delete(controller_setting_t * const setting); -#endif // _di_controller_setting_delete_ - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // _controller_main_common_type_h diff --git a/build/includes/program/controller/main/controller.h b/build/includes/program/controller/main/controller.h deleted file mode 100644 index 16e3257..0000000 --- a/build/includes/program/controller/main/controller.h +++ /dev/null @@ -1,73 +0,0 @@ -/** - * FLL - Level 3 - * - * Project: Controller - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * This program provides an controller base project. - * - * This program does nothing but can be used as a starting point for new program projects. - */ -#ifndef _controller_h -#define _controller_h - -// Libc includes. -#include -#include -#include -#include - -// FLL-0 includes. -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef _di_thread_support_ - #include -#endif // _di_thread_support_ - -// FLL-1 includes. -#include -#include - -// FLL-2 includes. -#include -#include -#include - -// Controller includes. -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // _controller_h diff --git a/build/includes/program/controller/main/print/data.h b/build/includes/program/controller/main/print/data.h deleted file mode 100644 index 17ef811..0000000 --- a/build/includes/program/controller/main/print/data.h +++ /dev/null @@ -1,23 +0,0 @@ -/** - * FLL - Level 3 - * - * Project: Controller - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Provides the print data functionality. - * - * This is auto-included and should not need to be explicitly included. - */ -#ifndef _controller_main_print_data_h -#define _controller_main_print_data_h - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // _controller_main_print_data_h diff --git a/build/includes/program/controller/main/print/debug.h b/build/includes/program/controller/main/print/debug.h deleted file mode 100644 index 1eb6491..0000000 --- a/build/includes/program/controller/main/print/debug.h +++ /dev/null @@ -1,23 +0,0 @@ -/** - * FLL - Level 3 - * - * Project: Controller - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Provides the print debug functionality. - * - * This is auto-included and should not need to be explicitly included. - */ -#ifndef _controller_main_print_debug_h -#define _controller_main_print_debug_h - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // _controller_main_print_debug_h diff --git a/build/includes/program/controller/main/print/error.h b/build/includes/program/controller/main/print/error.h deleted file mode 100644 index 3f67c87..0000000 --- a/build/includes/program/controller/main/print/error.h +++ /dev/null @@ -1,45 +0,0 @@ -/** - * FLL - Level 3 - * - * Project: Controller - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Provides the print error functionality. - * - * This is auto-included and should not need to be explicitly included. - */ -#ifndef _controller_main_print_error_h -#define _controller_main_print_error_h - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Print generic error message regarding a function failing in some way. - * - * @param print - * The output structure to print to. - * - * This does not alter print.custom.setting.state.status. - * @param function - * The name of the function associated with the error. - * - * @return - * F_okay on success. - * F_output_not on success, but no printing is performed. - * - * F_output_not (with error bit) if setting is NULL. - * - * @see fll_error_print() - */ -#ifndef _di_controller_main_print_error_ - extern f_status_t controller_main_print_error(fl_print_t * const print, const f_string_t function); -#endif // _di_controller_main_print_error_ - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // _controller_main_print_error_h diff --git a/build/includes/program/controller/main/print/message.h b/build/includes/program/controller/main/print/message.h deleted file mode 100644 index 3be5523..0000000 --- a/build/includes/program/controller/main/print/message.h +++ /dev/null @@ -1,51 +0,0 @@ -/** - * FLL - Level 3 - * - * Project: Controller - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Provides the print message functionality. - * - * This is auto-included and should not need to be explicitly included. - */ -#ifndef _controller_main_print_message_h -#define _controller_main_print_message_h - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Print help. - * - * @param print - * The output structure to print to. - * - * This requires print.custom to be controller_main_t. - * - * This does not alter print.custom.setting.state.status. - * - * @return - * F_okay on success. - * F_output_not on success, but no printing is performed. - * - * F_output_not (with error bit) if setting is NULL. - * - * @see f_file_stream_flush() - * @see f_file_stream_lock() - * @see f_file_stream_unlock() - * @see f_print_dynamic_raw() - * @see fll_program_print_help_header() - * @see fll_program_print_help_option() - * @see fll_program_print_help_usage() - */ -#ifndef _di_controller_main_print_message_help_ - extern f_status_t controller_main_print_message_help(fl_print_t * const print); -#endif // _di_controller_main_print_message_help_ - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // _controller_main_print_message_h diff --git a/build/includes/program/controller/main/print/verbose.h b/build/includes/program/controller/main/print/verbose.h deleted file mode 100644 index 0cab65e..0000000 --- a/build/includes/program/controller/main/print/verbose.h +++ /dev/null @@ -1,23 +0,0 @@ -/** - * FLL - Level 3 - * - * Project: Controller - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Provides the print verbose functionality. - * - * This is auto-included and should not need to be explicitly included. - */ -#ifndef _controller_main_print_verbose_h -#define _controller_main_print_verbose_h - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // _controller_main_print_verbose_h diff --git a/build/includes/program/controller/main/print/warning.h b/build/includes/program/controller/main/print/warning.h deleted file mode 100644 index 654e77f..0000000 --- a/build/includes/program/controller/main/print/warning.h +++ /dev/null @@ -1,23 +0,0 @@ -/** - * FLL - Level 3 - * - * Project: Controller - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Provides the print warning functionality. - * - * This is auto-included and should not need to be explicitly included. - */ -#ifndef _controller_main_print_warning_h -#define _controller_main_print_warning_h - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // _controller_main_print_warning_h diff --git a/build/includes/program/controller/main/signal.h b/build/includes/program/controller/main/signal.h deleted file mode 100644 index 404caca..0000000 --- a/build/includes/program/controller/main/signal.h +++ /dev/null @@ -1,86 +0,0 @@ -/** - * FLL - Level 3 - * - * Project: Controller - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Provides signal functionality. - * - * This is auto-included and should not need to be explicitly included. - */ -#ifndef _controller_main_signal_h -#define _controller_main_signal_h - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Check to see if a signal is received. - * - * If main.signal is non-zero, then this handles the following signals: - * - F_signal_abort - * - F_signal_broken_pipe - * - F_signal_hangup - * - F_signal_interrupt - * - F_signal_quit - * - F_signal_termination - * - * There is a threaded and a non-threaded version of this. - * The non-threaded version checks periodically using controller_main_signal_check_d and updates main->signal_check as needed. - * The threaded version checks the flag state which is set by a separate thread that is blocking until signal is received. - * - * @param main - * The main program and settings data. - * - * This does not alter main.setting.state.status. - * - * @return - * F_true on signal received. - * F_false otherwise. - * - * @see controller_main_signal_handler() - * - * @see fll_program_standard_signal_received() - */ -#ifndef _di_controller_main_signal_check_ - extern f_status_t controller_main_signal_check(controller_main_t * const main); -#endif // _di_controller_main_signal_check_ - -/** - * Signal handler for signals/interrupts. - * - * This blocks until an expected signal is recieved. - * When an expected signal is received it then sets the - * - * If main.signal is non-zero, then this handles the following signals: - * - F_signal_abort - * - F_signal_broken_pipe - * - F_signal_hangup - * - F_signal_interrupt - * - F_signal_quit - * - F_signal_termination - * - * @param main - * The main program and settings data. - * - * This alters main.program.signal_received, setting it to a received signal. - * - * This alters main.setting.state.status: - * Errors (with error bit) from: f_signal_open() - * Errors (with error bit) from: f_signal_wait() - * - * @see f_signal_close() - * @see f_signal_open() - * @see f_signal_wait() - */ -#if !defined(_di_controller_main_signal_handler_) && !defined(_di_thread_support_) - extern void controller_main_signal_handler(controller_main_t * const main); -#endif // !defined(_di_controller_main_signal_handler_) && !defined(_di_thread_support_) - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // _controller_main_signal_h diff --git a/build/includes/program/controller/main/thread.h b/build/includes/program/controller/main/thread.h deleted file mode 100644 index 088e795..0000000 --- a/build/includes/program/controller/main/thread.h +++ /dev/null @@ -1,46 +0,0 @@ -/** - * FLL - Level 3 - * - * Project: Controller - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Provides thread functionality. - * - * This is auto-included and should not need to be explicitly included. - */ -#ifndef _controller_main_thread_h -#define _controller_main_thread_h - -/** - * Thread handler for signals/interrupts. - * - * If main.signal is non-zero, then this handles the following signals: - * - F_signal_abort - * - F_signal_broken_pipe - * - F_signal_hangup - * - F_signal_interrupt - * - F_signal_quit - * - F_signal_termination - * - * @param main - * The program and settings data. - * - * Must be of type controller_main_t. - * - * @return - * 0, always. - * - * @see f_thread_cancel_state_set() - * - * @see controller_main_thread_signal() - */ -#if !defined(_di_controller_main_thread_signal_) && !defined(_di_thread_support_) - extern void * controller_main_thread_signal(void * const main); -#endif // !defined(_di_controller_main_thread_signal_) && !defined(_di_thread_support_) - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // _controller_main_thread_h diff --git a/build/stage/skeleton-settings.built b/build/stage/skeleton-settings.built deleted file mode 100644 index e69de29..0000000 diff --git a/build/stage/sources_documentation-settings.built b/build/stage/sources_documentation-settings.built deleted file mode 100644 index e69de29..0000000 diff --git a/build/stage/sources_headers-settings.built b/build/stage/sources_headers-settings.built deleted file mode 100644 index e69de29..0000000 diff --git a/build/stage/sources_settings-settings.built b/build/stage/sources_settings-settings.built deleted file mode 100644 index e69de29..0000000 -- 1.8.3.1