2024-10-19 16:05:49 +02:00
.TH "include/fsm.h" 3 "Version 0.1.0" "Gem-graph" \" -*- nroff -*-
.ad l
.nh
.SH NAME
2024-10-22 14:41:38 +02:00
include/fsm.h \- fsm (Finite State Machine) header
2024-10-19 16:05:49 +02:00
.SH SYNOPSIS
.br
.PP
\fC #include <stdbool\& .h>\fP
.br
\fC #include <stddef\& .h>\fP
.br
\fC #include <string\& .h>\fP
.br
\fC #include <gtk\- 4\& .0/gtk/gtk\& .h>\fP
.br
.SS "Classes"
.in +1c
.ti -1c
.RI "struct \fBfsm_struct_journal_unit\fP"
.br
2024-10-20 01:05:12 +02:00
.RI "structure of a journal element "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "struct \fBfsm_struct_journal\fP"
.br
2024-10-20 01:05:12 +02:00
.RI "required to initialise a double-chained list "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "struct \fBfsm_struct_list_tool\fP"
.br
2024-10-20 01:05:12 +02:00
.RI "phantom documentation "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "struct \fBfsm_struct_list_data\fP"
.br
2024-10-20 01:05:12 +02:00
.RI "phantom documentation "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "struct \fBfsm_struct_list_disp\fP"
.br
2024-10-20 01:05:12 +02:00
.RI "phantom documentation "
2024-10-19 16:05:49 +02:00
.in -1c
.SS "Macros"
.in +1c
.ti -1c
.RI "#define \fBJOURNAL_LOG_MAX_LENGTH\fP 255"
.br
2024-10-20 01:05:12 +02:00
.RI "arbitrary "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "#define \fBn_rules\fP 128"
.br
2024-10-20 01:05:12 +02:00
.RI "arbitrary "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "#define \fBn_objects\fP 32"
.br
2024-10-20 01:05:12 +02:00
.RI "arbitrary too, "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "#define \fBn_situations\fP 128"
.br
2024-10-20 01:05:12 +02:00
.RI "and so on\&.\&.\&. "
2024-10-19 16:05:49 +02:00
.in -1c
.SS "Typedefs"
.in +1c
.ti -1c
.RI "typedef struct \fBfsm_struct_journal_unit\fP \fBfsm_struct_journal_unit\fP"
.br
2024-10-20 01:05:12 +02:00
.RI "structure of a journal element "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "typedef struct \fBfsm_struct_list_tool\fP \fBfsm_struct_list_tool\fP"
.br
2024-10-20 01:05:12 +02:00
.RI "phantom documentation "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "typedef struct \fBfsm_struct_list_data\fP \fBfsm_struct_list_data\fP"
.br
2024-10-20 01:05:12 +02:00
.RI "phantom documentation "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "typedef struct \fBfsm_struct_list_disp\fP \fBfsm_struct_list_disp\fP"
.br
2024-10-20 01:05:12 +02:00
.RI "phantom documentation "
2024-10-19 16:05:49 +02:00
.in -1c
.SS "Enumerations"
.in +1c
.ti -1c
2024-10-20 01:05:12 +02:00
.RI "enum \fBfsm_enum_journal_severity\fP { \fBFATAL\fP, \fBERROR\fP, \fBWARN\fP, \fBINFO\fP, \fBDEBUG\fP, \fBTRACE\fP }"
2024-10-19 16:05:49 +02:00
.br
2024-10-20 01:05:12 +02:00
.RI "Conforms to canonical log levels: FATAL, ERROR, WARN, INFO, DEBUG, TRACE\&. "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "enum \fBfsm_enum_journal_source\fP { \fBSOURCE\fP, \fBTARGET\fP, \fBJOURNAL\fP, \fBFSM\fP, \fBPREFER\fP, \fBMAIN\fP, \fBAPP\fP, \fBWIDGETS\fP, \fBSIGNAL\fP, \fBMAIN_WINDOW\fP, \fBDIALOG_WINDOW\fP, \fBMODAL_WINDOW\fP, \fBTEXT_WINDOW\fP, \fBAUTO_NOTIFICATION\fP, \fBTOPBAR\fP, \fBTOPBAR_LEFT\fP, \fBTOPBAR_RIGHT\fP, \fBTOPBAR_CENTER\fP, \fBSYNTH_PAGE\fP, \fBSTATE_PAGE\fP, \fBRULES_PAGE\fP, \fBMEASURES_PAGE\fP, \fBRESULTS_PAGE\fP, \fBSenumYNTH_GLAREA\fP, \fBSYNTH_ALL_RESULTS\fP, \fBSYNTH_TIME_DEP_RESULTS\fP, \fBSYNTH_TIME_INDEP_RESULTS\fP, \fBSTATE_TOP\fP, \fBSTATE_BOTTOM\fP, \fBSTATE_GLAREA\fP, \fBSTATE_CAMERA\fP, \fBRULE_GEOMETRY\fP, \fBRULE_GLAREA\fP, \fBRULE_CAMERA\fP, \fBRULE_ALGEBRA\fP, \fBRULE_CONDITION\fP, \fBRULE_ASSIGN\fP, \fBRULE_ID\fP, \fBRULES_TREE\fP, \fBRULES_COMPARE\fP, \fBRULES_USE\fP, \fBMEASURES_TOOLS\fP, \fBMEASURES__ACTIVITY\fP, \fBMEASURES__DISPLAY\fP, \fBRESULTS\fP, \fBTIME_DEP_RESULTS\fP, \fBTIME_INDEP_RESULTS\fP, \fBWIDGET\fP, \fBBUTTON\fP, \fBSCROLL\fP, \fBGLAREA\fP, \fBTEXT\fP, \fBLABEL\fP, \fBTREE\fP, \fBSLIDER\fP, \fBEXPANDER\fP, \fBENTRY\fP, \fBSWITCH_STATE_RULES_DATA\fP, \fBSLIDER_X\fP, \fBSLIDER_Y\fP, \fBSLIDER_Z\fP, \fBSLIDER_A\fP, \fBSLIDER_B\fP, \fBSLIDER_C\fP }"
.br
2024-10-20 01:05:12 +02:00
.RI "arbitrary values that can help the logging filter work more efficiently "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "enum \fBfsm_enum_exec_edit\fP { \fBEXEC\fP, \fBEDIT\fP }"
.br
2024-10-20 01:05:12 +02:00
.RI "phantom documentation "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "enum \fBfsm_enum_state_rules_data\fP { \fBSYNTH\fP, \fBSTATE\fP, \fBRULES\fP, \fBDATA\fP }"
.br
2024-10-20 01:05:12 +02:00
.RI "phantom documentation "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "enum \fBfsm_enum_store_restore_reset\fP { \fBSTORE\fP, \fBRESTORE\fP, \fBRESET\fP }"
.br
2024-10-20 01:05:12 +02:00
.RI "phantom documentation "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "enum \fBfsm_enum_measure_type\fP { \fBDATE_RULE_EXEC\fP, \fBRULE_EXEC_NB\fP, \fBOBJECT_NB\fP, \fBELAPSED_TIME\fP }"
.br
2024-10-20 01:05:12 +02:00
.RI "phantom documentation "
2024-10-19 16:05:49 +02:00
.in -1c
.SS "Functions"
.in +1c
.ti -1c
.RI "void \fBfsm_journal_publish\fP (\fBfsm_struct_journal\fP jj)"
.br
2024-10-20 01:05:12 +02:00
.RI "publish all the logs today just print in the console TODO > in a file "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "void \fBfsm_journal_init\fP (\fBfsm_struct_journal\fP *jj)"
.br
2024-10-20 01:05:12 +02:00
.RI "init the journal "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "void \fBfsm_journal_push_front\fP (\fBfsm_struct_journal\fP *jj, const char *file_source, const char *function_source, const char *string_value)"
.br
2024-10-20 01:05:12 +02:00
.RI "add an event "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "void \fBfsm_journal_clear\fP (\fBfsm_struct_journal\fP *jj, const char *file_source, const char *function_source, const char *string_value)"
.br
2024-10-20 01:05:12 +02:00
.RI "usefulness ? (systematic ^c) "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "long \fBfsm_journal_pop_back\fP (\fBfsm_struct_journal\fP *jj, const char *file_source, const char *function_source, const char *string_value)"
.br
2024-10-20 01:05:12 +02:00
.RI "remove an event "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "int \fBfsm_journal_length\fP (\fBfsm_struct_journal\fP jj)"
.br
2024-10-20 01:05:12 +02:00
.RI "get journal_length "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "void \fBfsm_journal_seek\fP (\fBfsm_struct_journal\fP jj, long usec, const char *file_source, const char *function_source, const char *string_value)"
.br
2024-10-20 01:05:12 +02:00
.RI "seek for an event "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "void \fBfsm_journal_publication_request\fP ()"
.br
.RI "The \fBfsm_journal_publication_request()\fP is called only once, by \fBmain()\fP, just after closing the app and before ending the program\&. "
.ti -1c
.RI "void \fBfsm_journal_event\fP (int severity, int source, const char *file_source, const char *function_source, const char *string_value)"
.br
.RI "It is mandatory for any event to call this function to be published in the journal\&. "
.ti -1c
.RI "void \fBfsm_init\fP (char *message)"
.br
.RI "fsm init is the first function called by \fBmain\&.c\fP It initiates the journal and the four lists: 'measures', 'results', 'displayables results' and 'preferences'\&. "
.ti -1c
.RI "void \fBfsm_list_init_preferences\fP ()"
.br
.ti -1c
.RI "void \fBfsm_list_init_measures\fP ()"
.br
.ti -1c
.RI "void \fBfsm_list_init_results\fP ()"
.br
2024-10-20 01:05:12 +02:00
.RI "phantom documentation "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "void \fBfsm_list_init_displayables\fP ()"
.br
.ti -1c
.RI "int \fBfsm_get_exec_edit\fP ()"
.br
.RI "some client pages (in particular 'state' and 'rules') will be displayed and behave differently depending on whether the fsm is in edit or run state\&. "
.ti -1c
.RI "int \fBfsm_get_state_rules_data\fP ()"
.br
.RI "The value of the static int choice_STATE_RULES_DATA can be one of the enum include/fsm enum fsm_enum_state_rules_data\&. "
.ti -1c
.RI "void \fBfsm_set_exec_edit\fP (int value)"
.br
.RI "setter for the static value: 'choice_STATE_RULES_DATA' (in this file) "
.ti -1c
.RI "void \fBfsm_set_state_rules_data\fP (int value)"
.br
.RI "setter for the static value: 'choice_STATE_RULES_DATA' (in this file) "
.ti -1c
.RI "void \fBfsm_set_store_restore_reset\fP (int choice, int value)"
.br
.ti -1c
.RI "bool \fBfsm_get_preferences_state\fP ()"
.br
.RI "getter for the static boolean: 'preferences_have_been_modified' "
.ti -1c
.RI "void \fBfsm_set_preferences_modified\fP (bool value)"
.br
.RI "setter for the static boolean: 'preferences_have_been_modified' "
.ti -1c
.RI "void \fBfsm_add_measure\fP (char *measure_name)"
.br
.ti -1c
.RI "void \fBfsm_add_result\fP (char *result_name)"
.br
2024-10-20 01:05:12 +02:00
.RI "phantom documentation "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "void \fBfsm_add_displayable\fP (char *displayable_name)"
.br
.ti -1c
.RI "void \fBfsm_reset_all_situations_values\fP (int value)"
.br
.ti -1c
2024-10-20 01:05:12 +02:00
.RI "void \fBfsm_tools_list_insert\fP (\fBfsm_struct_list_tool\fP **tl, int value)"
2024-10-19 16:05:49 +02:00
.br
2024-10-20 01:05:12 +02:00
.RI "phantom documentation "
2024-10-19 16:05:49 +02:00
.ti -1c
2024-10-20 01:05:12 +02:00
.RI "int \fBfsm_tools_list_pop\fP (\fBfsm_struct_list_tool\fP **tl)"
2024-10-19 16:05:49 +02:00
.br
2024-10-20 01:05:12 +02:00
.RI "phantom documentation "
2024-10-19 16:05:49 +02:00
.ti -1c
2024-10-20 01:05:12 +02:00
.RI "int \fBfsm_tools_list_length\fP (\fBfsm_struct_list_tool\fP *tl)"
2024-10-19 16:05:49 +02:00
.br
2024-10-20 01:05:12 +02:00
.RI "phantom documentation "
2024-10-19 16:05:49 +02:00
.ti -1c
2024-10-20 01:05:12 +02:00
.RI "void \fBfsm_tools_list_clear\fP (\fBfsm_struct_list_tool\fP **tl)"
2024-10-19 16:05:49 +02:00
.br
2024-10-20 01:05:12 +02:00
.RI "phantom documentation "
2024-10-19 16:05:49 +02:00
.ti -1c
2024-10-20 01:05:12 +02:00
.RI "void \fBfsm_tools_list_view\fP (\fBfsm_struct_list_tool\fP *tl)"
2024-10-19 16:05:49 +02:00
.br
2024-10-20 01:05:12 +02:00
.RI "phantom documentation "
2024-10-19 16:05:49 +02:00
.ti -1c
2024-10-20 01:05:12 +02:00
.RI "void \fBfsm_tools_list_test\fP ()"
2024-10-19 16:05:49 +02:00
.br
2024-10-20 01:05:12 +02:00
.RI "phantom documentation "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "void \fBfsm_rule_trig_measure\fP (int rule_id, int object_id, int measure_id)"
.br
.ti -1c
.RI "void \fBfsm_add_data\fP (\fBfsm_struct_list_data\fP d, int *p_data, int *p_target)"
.br
2024-10-20 01:05:12 +02:00
.RI "phantom documentation "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "int \fBfsm_get_data\fP (\fBfsm_struct_list_data\fP d, int from, int to)"
.br
2024-10-20 01:05:12 +02:00
.RI "phantom documentation "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "void \fBfsm_remove_data\fP (\fBfsm_struct_list_data\fP d, int *p_data)"
.br
2024-10-20 01:05:12 +02:00
.RI "phantom documentation "
2024-10-19 16:05:49 +02:00
.in -1c
.SH "Detailed Description"
.PP
2024-10-22 14:41:38 +02:00
fsm (Finite State Machine) header
2024-10-19 16:05:49 +02:00
This file is part of Gem-graph\& .
2024-10-20 01:05:12 +02:00
.SH "Typedef Documentation"
.PP
.SS "typedef struct \fBfsm_struct_journal_unit\fP \fBfsm_struct_journal_unit\fP"
.PP
structure of a journal element
.PP
\fB See also\fP
.RS 4
use in src/fsm/dispatch/fsm_journal_event()
.PP
use in src/journal/fsm_journal_push_front()
.RE
.PP
2024-10-19 16:05:49 +02:00
.SH "Enumeration Type Documentation"
.PP
.SS "enum \fBfsm_enum_journal_severity\fP"
2024-10-20 01:05:12 +02:00
.PP
Conforms to canonical log levels: FATAL, ERROR, WARN, INFO, DEBUG, TRACE\& .
2024-10-19 16:05:49 +02:00
.IP "\(bu" 2
* * * - J O U R N A L M E T A R U L E S - * * * *
.PP
ref: sudo cat /var/log/messages
.PP
structure d'un log:
.IP "\(bu" 2
date
.IP "\(bu" 2
rang (n° d'ordre)
.IP "\(bu" 2
fichier
.IP "\(bu" 2
fonction
.IP "\(bu" 2
valeur, paramètre, descriptif, contexte,\& .\& .\& . (tout ce qui peut contribuer à améliorer la compréhension du journal) any value that can qualify the event and provides useful information when reading the log\& .
.PP
.PP
.PP
.PP
Un seul \fB fsm_journal_event()\fP par fonction ? sauf si cette fonction génère plusieurs autres fonctions d'intérêt ?
.PP
S'il y a deux \fB fsm_journal_event()\fP (begin / end) dans une fonction, ils doivent avoir la même étiquette (les mêmes valeurs) : SEVERITY & SOURCE
.PP
.IP "\(bu" 2
* * * - J O U R N A L M E T A R U L E S - * * *
.br
2024-10-20 01:05:12 +02:00
.PP
.PP
https://betterstack.com/community/guides/logging/logging-best-practices/ https://en.wikipedia.org/wiki/Syslog
.PP
\fB Enumerator\fP
.in +1c
.TP
\fB \fI FATAL \fP \fP
(or CRITICAL) an unrecoverable failure that prevents the whole application from doing any further useful work
.TP
\fB \fI ERROR \fP \fP
a conditions that hinder the execution of a specific operation within an application and is unrecoverable
.TP
\fB \fI WARN \fP \fP
something unexpected has occurred, but the application can continue to function normally for the time being
.TP
\fB \fI INFO \fP \fP
(or MESSAGE) a significant event occurs while the system is operating normally
.TP
\fB \fI DEBUG \fP \fP
a description of system states in sufficient detail to give developers clues as to the cause of an error
.TP
\fB \fI TRACE \fP \fP
provides a systematic overview of code execution but comes at a cost in terms of performance
.SS "enum \fBfsm_enum_journal_source\fP"
.PP
arbitrary values that can help the logging filter work more efficiently
.PP
\fB See also\fP
.RS 4
src/fsm/dispatch/fsm_journal_event())
.RE
2024-10-19 16:05:49 +02:00
.PP
.SH "Function Documentation"
.PP
2024-10-20 01:05:12 +02:00
.SS "void fsm_add_data (\fBfsm_struct_list_data\fP d, int * p_data, int * p_target)"
.PP
phantom documentation
.PP
\fB Parameters\fP
.RS 4
\fI d\fP
.br
\fI *p_data\fP
.br
\fI *p_target\fP
.RE
.PP
2024-10-19 16:05:49 +02:00
.SS "void fsm_add_displayable (char * displayable_name)"
.PP
\fB Date\fP
.RS 4
.RE
.PP
\fB Author\fP
.RS 4
.RE
.PP
\fB See also\fP
.RS 4
.PP
.RE
.PP
\fB Parameters\fP
.RS 4
\fI displayable_name\fP
.RE
.PP
.SS "void fsm_add_measure (char * measure_name)"
.PP
\fB Since\fP
.RS 4
2024-09
.RE
.PP
\fB See also\fP
.RS 4
src/widget/measure/dispatch/widget_measure_event_occurences_nb()
.PP
src/widget/measure/dispatch/widget_measure_event_occurences_dates()
.PP
src/widget/measure/dispatch/widget_measure_event_occurences_situations()
.PP
src/widget/measure/dispatch/widget_measure_time_elapsed_between_two_events()
.PP
src/widget/measure/dispatch/widget_measure_third_event_occurences_in_between()
.PP
src/fsm/dispatch/fsm_journal_event()
.RE
.PP
\fB Parameters\fP
.RS 4
\fI *measure_name\fP
.RE
.PP
2024-10-20 01:05:12 +02:00
.SS "int fsm_get_data (\fBfsm_struct_list_data\fP d, int from, int to)"
.PP
phantom documentation
.PP
\fB Parameters\fP
.RS 4
\fI d\fP
.br
\fI from\fP
.br
\fI to\fP
.RE
.PP
2024-10-19 16:05:49 +02:00
.SS "int fsm_get_exec_edit ()"
.PP
some client pages (in particular 'state' and 'rules') will be displayed and behave differently depending on whether the fsm is in edit or run state\& . Any function which modifies the appearance or behavior of these pages must use this getter to access the choice_EXEC_EDIT value\& .
.PP
see include/fsm enum fsm_enum_exec_edit { EXEC, EDIT } The current int may be replaced by a boolean \& . TODO
.PP
\fB Since\fP
.RS 4
2024-06
.RE
.PP
\fB See also\fP
.RS 4
src/widget/one_rule/dispatch
.PP
src/widget/state/dispatch * 2
.PP
src/signal
.PP
choice_EXEC_EDIT and
.PP
2024-10-20 01:05:12 +02:00
include/fsm/enum \fB fsm_enum_exec_edit\fP {}
2024-10-19 16:05:49 +02:00
.RE
.PP
\fB Returns\fP
.RS 4
choice_EXEC_EDIT
.RE
.PP
.SS "bool fsm_get_preferences_state ()"
.PP
getter for the static boolean: 'preferences_have_been_modified'
.PP
\fB Since\fP
.RS 4
2024-08
.RE
.PP
\fB See also\fP
.RS 4
TODO A function must obtain this boolean when it stores the current state of the fsm (including \fB preferences\fP ) before closing the current session\& .
.RE
.PP
\fB Returns\fP
.RS 4
preferences_have_been_modified
.RE
.PP
.SS "int fsm_get_state_rules_data ()"
.PP
The value of the static int choice_STATE_RULES_DATA can be one of the enum include/fsm enum fsm_enum_state_rules_data\& . To each value is associated a different page and different possible behaviors\& . Any function that modifies the client window must get this value\& .
.PP
see include/fsm enum fsm_enum_state_rules_data { SYNTH, STATE, RULES, DATA }
.PP
\fB Since\fP
.RS 4
2024-06
.RE
.PP
\fB See also\fP
.RS 4
src/widget/topbar/left
.PP
src/signal
.RE
.PP
\fB Returns\fP
.RS 4
choice_STATE_RULES_DATA
.RE
.PP
2024-10-20 23:03:17 +02:00
.SS "void fsm_init (char * initial_INFO_from_main)"
2024-10-19 16:05:49 +02:00
.PP
fsm init is the first function called by \fB main\& .c\fP It initiates the journal and the four lists: 'measures', 'results', 'displayables results' and 'preferences'\& . The items selected in these lists define the current state of the fsm\& .
.PP
\fB Since\fP
.RS 4
2024-08
.RE
.PP
\fB See also\fP
.RS 4
src/main/main()
.PP
src/journal/fsm_journal_init()
.PP
src/fsm/dispatch/fsm_journal_event()
.PP
src/fsm/measures/manager/fsm_list_init_measures()
.PP
src/fsm/results/manager/fsm_list_init_results()
.PP
src/fsm/preferences/manager/fsm_list_init_displayables()
.PP
src/fsm/preferences/manager/fsm_list_init_preferences()
.RE
.PP
\fB Parameters\fP
.RS 4
2024-10-20 23:03:17 +02:00
\fI *initial_INFO_from_main\fP
2024-10-19 16:05:49 +02:00
.RE
.PP
.SS "void fsm_journal_clear (\fBfsm_struct_journal\fP * jj, const char * file_source, const char * function_source, const char * string_value)"
.PP
2024-10-20 01:05:12 +02:00
usefulness ? (systematic ^c)
2024-10-19 16:05:49 +02:00
.PP
2024-10-20 01:05:12 +02:00
\fB Since\fP
2024-10-19 16:05:49 +02:00
.RS 4
2024-10-20 01:05:12 +02:00
2024-09
2024-10-19 16:05:49 +02:00
.RE
.PP
\fB Parameters\fP
.RS 4
2024-10-20 01:05:12 +02:00
\fI *jj\fP
.br
\fI *file_source\fP
.br
\fI *function_source\fP
.br
\fI *string_value\fP
.RE
2024-10-19 16:05:49 +02:00
.PP
2024-10-20 01:05:12 +02:00
2024-10-19 16:05:49 +02:00
.SS "void fsm_journal_event (int severity, int source, const char * file_source, const char * function_source, const char * string_value)"
.PP
2024-10-20 23:03:17 +02:00
It is mandatory for any event to call this function to be published in the journal\& . Before publication, a filter can be applied here (and only here) to select only some events of interest (during debugging, for example)
2024-10-19 16:05:49 +02:00
.PP
If there are too many events, a filter can be applied here to select a few interesting events for publication in the log\& .
.PP
This filter can operate on any the following five parameters: severity, source, *file_source, *function_source, *string_value\& .
.PP
\fB See also\fP
.RS 4
below (params)
.RE
.PP
Simple filters (on a single parameter) can be combined using the logical operators 'and' and 'or' and parentheses\& .
.PP
Use: $ grep -r 'fsm_journal_event' to confirm the callergraph calls\& .
.PP
\fB Since\fP
.RS 4
2024-08
.RE
.PP
\fB See also\fP
.RS 4
\fB src/journal\& .c\fP /fsm_journal_push_front()
.PP
src/main/main()
.PP
src/widget/topbar/modal\& .c
.PP
src/widget/topbar/right\& .c
.PP
src/widget/topbar/dialog\& .c
.PP
src/widget/topbar/left\& .c
.PP
2024-10-20 01:05:12 +02:00
src/widget/topbar/dispatch\& .c * 3
2024-10-19 16:05:49 +02:00
.PP
src/widget/one_rule/dispatch\& .c
.PP
2024-10-20 01:05:12 +02:00
src/widget/one_rule/algebra/conditions\& .c * 2
2024-10-19 16:05:49 +02:00
.PP
src/widget/measure/dispatch\& .c
.PP
2024-10-20 01:05:12 +02:00
src/widget/dispatch\& .c * 3
2024-10-19 16:05:49 +02:00
.PP
src/widget/all_rules/dispatch\& .c
.PP
\fB src/fsm/preferences/manager\& .c\fP * 8
.PP
\fB src/fsm/measures/manager\& .c\fP * 2
.PP
2024-10-20 01:05:12 +02:00
\fB src/fsm/measures/tools_list\& .c\fP * 4
2024-10-19 16:05:49 +02:00
.PP
\fB src/fsm/dispatch\& .c\fP * 10
.PP
\fB src/fsm/results/manager\& .c\fP
.PP
2024-10-20 23:03:17 +02:00
\fB src/util/tree\& .c\fP
2024-10-19 16:05:49 +02:00
.PP
\fB src/signal\& .c\fP * 38
.RE
.PP
\fB Parameters\fP
.RS 4
\fI severity\fP <>
.RE
.PP
\fB See also\fP
.RS 4
2024-10-20 23:03:17 +02:00
enum \fB fsm_enum_journal_severity\fP in \fB include/fsm\& .h\fP 'severity' is a pre-defined value that must be associated to each event\& . It ranges from zero to six : CRITICAL \fB ERROR\fP WARNING \fB INFO\fP \fB INFO\fP \fB DEBUG\fP \fB TRACE\fP 0 1 2 3 4 5 6
2024-10-19 16:05:49 +02:00
.RE
.PP
\fB Parameters\fP
.RS 4
\fI source\fP <>
.RE
.PP
\fB See also\fP
.RS 4
2024-10-20 01:05:12 +02:00
enum \fB fsm_enum_journal_source\fP in \fB include/fsm\& .h\fP 'source' is a pre-defined value that can be associated to each event\& . It is not mandatory\& . It can be set to 'NULL'\& .
2024-10-19 16:05:49 +02:00
.RE
.PP
\fB Parameters\fP
.RS 4
\fI *file_source\fP <> the name of the file that emits the event\& .
.br
\fI *function_source\fP <> the function that emits the event\& .
.br
\fI *string_value\fP <> any value that can qualify the event and provides useful information when reading the log\& .
.RE
.PP
.SS "void fsm_journal_init (\fBfsm_struct_journal\fP * jj)"
.PP
2024-10-20 01:05:12 +02:00
init the journal
2024-10-19 16:05:49 +02:00
.PP
2024-10-20 01:05:12 +02:00
\fB Since\fP
2024-10-19 16:05:49 +02:00
.RS 4
2024-10-20 01:05:12 +02:00
2024-09
2024-10-19 16:05:49 +02:00
.RE
.PP
\fB Parameters\fP
.RS 4
2024-10-20 01:05:12 +02:00
\fI *jj\fP
.RE
2024-10-19 16:05:49 +02:00
.PP
2024-10-20 01:05:12 +02:00
2024-10-19 16:05:49 +02:00
.SS "int fsm_journal_length (\fBfsm_struct_journal\fP jj)"
.PP
2024-10-20 01:05:12 +02:00
get journal_length
2024-10-19 16:05:49 +02:00
.PP
2024-10-20 01:05:12 +02:00
\fB Since\fP
2024-10-19 16:05:49 +02:00
.RS 4
2024-10-20 01:05:12 +02:00
2024-09
2024-10-19 16:05:49 +02:00
.RE
.PP
2024-10-20 01:05:12 +02:00
\fB Parameters\fP
2024-10-19 16:05:49 +02:00
.RS 4
2024-10-20 01:05:12 +02:00
\fI *jj\fP
2024-10-19 16:05:49 +02:00
.RE
.PP
2024-10-20 01:05:12 +02:00
\fB Returns\fP
2024-10-19 16:05:49 +02:00
.RS 4
2024-10-20 01:05:12 +02:00
journal length
.RE
2024-10-19 16:05:49 +02:00
.PP
2024-10-20 01:05:12 +02:00
2024-10-19 16:05:49 +02:00
.SS "long fsm_journal_pop_back (\fBfsm_struct_journal\fP * jj, const char * file_source, const char * function_source, const char * string_value)"
.PP
2024-10-20 01:05:12 +02:00
remove an event
2024-10-19 16:05:49 +02:00
.PP
2024-10-20 01:05:12 +02:00
\fB Since\fP
2024-10-19 16:05:49 +02:00
.RS 4
2024-10-20 01:05:12 +02:00
2024-09
2024-10-19 16:05:49 +02:00
.RE
.PP
\fB Parameters\fP
.RS 4
2024-10-20 01:05:12 +02:00
\fI *jj\fP
.br
\fI *file_source\fP
.br
\fI *function_source\fP
.br
\fI *string_value\fP
.RE
2024-10-19 16:05:49 +02:00
.PP
2024-10-20 01:05:12 +02:00
2024-10-19 16:05:49 +02:00
.SS "void fsm_journal_publication_request ()"
.PP
The \fB fsm_journal_publication_request()\fP is called only once, by \fB main()\fP , just after closing the app and before ending the program\& . This is to guarantee the chronological order of the events in the journal\& .
.PP
The log is modified for each event but events can be send asynchronously\& . This is why the journal is only published once, before the end of 'main()', Its chronological order is therefore guaranteed\& .
.PP
\fB src/journal\& .c\fP /fsm_journal_publish() (called here) is the last function of the program to be executed\& .
.PP
The \fB fsm_struct_journal\fP (gg_logs) is a static instance in this file\& . Therefore, all the functions that read or write it are in this file\& . This is to avoid uncontrolled operations on it\& .
.PP
\fB Since\fP
.RS 4
2024-08
.RE
.PP
\fB See also\fP
.RS 4
src/main/main()
.PP
src/journal/fsm_journal_publish()
.RE
.PP
.SS "void fsm_journal_publish (\fBfsm_struct_journal\fP jj)"
.PP
2024-10-20 01:05:12 +02:00
publish all the logs today just print in the console TODO > in a file
2024-10-19 16:05:49 +02:00
.PP
2024-10-20 01:05:12 +02:00
\fB Since\fP
2024-10-19 16:05:49 +02:00
.RS 4
2024-10-20 01:05:12 +02:00
2024-09
2024-10-19 16:05:49 +02:00
.RE
.PP
\fB Parameters\fP
.RS 4
2024-10-20 01:05:12 +02:00
\fI *jj\fP
.RE
2024-10-19 16:05:49 +02:00
.PP
2024-10-20 01:05:12 +02:00
.SS "void fsm_journal_push_front (\fBfsm_struct_journal\fP * jj, const char * file_source, const char * function_source, const char * string_value)"
2024-10-19 16:05:49 +02:00
.PP
2024-10-20 01:05:12 +02:00
add an event
2024-10-19 16:05:49 +02:00
.PP
2024-10-20 01:05:12 +02:00
\fB Since\fP
2024-10-19 16:05:49 +02:00
.RS 4
2024-10-20 01:05:12 +02:00
2024-09
2024-10-19 16:05:49 +02:00
.RE
.PP
\fB Parameters\fP
.RS 4
2024-10-20 01:05:12 +02:00
\fI *jj\fP
.br
\fI *file_source\fP
.br
\fI *function_source\fP
.br
\fI *string_value\fP
.RE
2024-10-19 16:05:49 +02:00
.PP
2024-10-20 01:05:12 +02:00
2024-10-19 16:05:49 +02:00
.SS "void fsm_journal_seek (\fBfsm_struct_journal\fP jj, long usec, const char * file_source, const char * function_source, const char * string_value)"
.PP
2024-10-20 01:05:12 +02:00
seek for an event
2024-10-19 16:05:49 +02:00
.PP
2024-10-20 01:05:12 +02:00
\fB Since\fP
2024-10-19 16:05:49 +02:00
.RS 4
2024-10-20 01:05:12 +02:00
2024-09
2024-10-19 16:05:49 +02:00
.RE
.PP
\fB Parameters\fP
.RS 4
2024-10-20 01:05:12 +02:00
\fI *jj\fP
.br
\fI usec\fP
.br
\fI *file_source\fP
.br
\fI *function_source\fP
.br
\fI *string_value\fP
.RE
2024-10-19 16:05:49 +02:00
.PP
2024-10-20 01:05:12 +02:00
2024-10-19 16:05:49 +02:00
.SS "void fsm_list_init_displayables ()"
.PP
\fB Date\fP
.RS 4
.RE
.PP
\fB Author\fP
.RS 4
.RE
.PP
\fB See also\fP
.RS 4
.RE
.PP
.SS "void fsm_list_init_measures ()"
.PP
\fB Since\fP
.RS 4
2024-09
.RE
.PP
\fB See also\fP
.RS 4
src/fsm/dispatch/fsm_init()
.RE
.PP
.SS "void fsm_list_init_preferences ()"
.PP
\fB Date\fP
.RS 4
.RE
.PP
\fB Author\fP
.RS 4
.RE
.PP
\fB See also\fP
.RS 4
.PP
.RE
.PP
2024-10-20 01:05:12 +02:00
.SS "void fsm_remove_data (\fBfsm_struct_list_data\fP d, int * p_data)"
.PP
phantom documentation
.PP
\fB Parameters\fP
.RS 4
\fI d\fP
.br
\fI *p_data\fP
.RE
.PP
2024-10-19 16:05:49 +02:00
.SS "void fsm_reset_all_situations_values (int value)"
.PP
\fB Date\fP
.RS 4
.RE
.PP
\fB Author\fP
.RS 4
.RE
.PP
\fB See also\fP
.RS 4
.PP
.RE
.PP
\fB Parameters\fP
.RS 4
\fI value\fP
.RE
.PP
.SS "void fsm_rule_trig_measure (int rule_id, int object_id, int measure_id)"
.PP
\fB Since\fP
.RS 4
2024-09
.RE
.PP
\fB Parameters\fP
.RS 4
\fI rule_id\fP
.br
\fI object_id\fP
.br
\fI measure_id\fP
.RE
.PP
.SS "void fsm_set_exec_edit (int choice)"
.PP
setter for the static value: 'choice_STATE_RULES_DATA' (in this file) see include/fsm enum fsm_enum_exec_edit { EXEC, EDIT }
.PP
\fB Since\fP
.RS 4
2024-08
.RE
.PP
\fB See also\fP
.RS 4
src/signal * 2
.RE
.PP
\fB Parameters\fP
.RS 4
\fI choice\fP < a boolean value which can be 'EXEC' or 'EDIT'
.RE
.PP
.SS "void fsm_set_preferences_modified (bool value)"
.PP
setter for the static boolean: 'preferences_have_been_modified'
.PP
\fB Since\fP
.RS 4
2024-08
.RE
.PP
\fB See also\fP
.RS 4
TODO To be used by any function that modifies the current user \fB preferences\fP
.PP
\fB fsm_journal_event()\fP
.RE
.PP
\fB Parameters\fP
.RS 4
\fI value\fP = TRUE if preferences_have_been_modified\& .
.RE
.PP
.SS "void fsm_set_state_rules_data (int choice)"
.PP
setter for the static value: 'choice_STATE_RULES_DATA' (in this file) see include/fsm enum fsm_enum_state_rules_data { SYNTH, STATE, RULES, DATA } Today (2024-10) the initial page is set to 'SYNTH'\& .
.PP
\fB See also\fP
.RS 4
line 292 choice_STATE_RULES_DATA = SYNTH; NB This choice can be temporarily modified for debugging purpose:
.PP
2024-10-20 23:03:17 +02:00
end of the function: \fB fsm/dispatch\& .c\fP \fB window_design_topbar_left()\fP
2024-10-19 16:05:49 +02:00
.RE
.PP
\fB Since\fP
.RS 4
2024-08
.RE
.PP
\fB See also\fP
.RS 4
src/signal * 4
.RE
.PP
\fB Parameters\fP
.RS 4
\fI choice\fP
.RE
.PP
.SS "void fsm_set_store_restore_reset (int choice, int value)"
.PP
\fB Date\fP
.RS 4
.RE
.PP
\fB Author\fP
.RS 4
.RE
.PP
\fB See also\fP
.RS 4
.PP
.RE
.PP
\fB Parameters\fP
.RS 4
\fI choice\fP
.br
\fI value\fP
.RE
.PP
.SH "Author"
.PP
Generated automatically by Doxygen for Gem-graph from the source code\& .