+ struct s_unit; /* this structure represents a tesh unit */
+
+ struct s_runner;
+ struct s_units;
+ struct s_unit;
+ struct s_excludes;
+ struct s_fstreams;
+ struct s_fstream;
+ struct s_directories;
+ struct s_directory;
+ struct s_writer;
+ struct s_reader;
+ struct s_timer;
+ struct s_context;
+ struct s_command;
+ struct s_variable;
+ struct s_error;
+
+
+/*
+ * declaration of the tesh unit type which represents a tesh file
+ * to run.
+ */
+ typedef struct s_unit {
+ char *description; /* an optional description of the unit */
+ struct s_fstream *fstream; /* the file stream used to parse the tesh file */
+ struct s_runner *runner; /* the runner of the unit */
+ xbt_dynar_t commands; /* a vector containing all the commands parsed from the tesh file */
+ int cmd_nb; /* number of created commands of the unit */
+ int started_cmd_nb; /* number of started commands of the unit */
+ int interrupted_cmd_nb; /* number of interrupted commands of the unit */
+ int failed_cmd_nb; /* number of failed commands of the unit */
+ int successeded_cmd_nb; /* number of successeded commands of the unit */
+ int terminated_cmd_nb; /* number of ended commands */
+ int waiting_cmd_nb; /* REMOVE THIS FIELD LATER */
+ xbt_os_thread_t thread; /* all the units run in its own thread */
+ xbt_os_sem_t sem; /* used by the last command of the unit to signal the end of the unit */
+ xbt_os_mutex_t mutex; /* used to synchronously access to the properties of the runner */
+ unsigned interrupted:1; /* if 1, the unit is interrupted by the runner */
+ unsigned failed:1; /* if 1, the unit is failed */
+ unsigned successeded:1; /* if 1, the unit is successeded */
+ unsigned parsed:1; /* if 1, the tesh file of the unit is parsed */
+ unsigned released:1; /* if 1, the unit is released */
+ unsigned is_running_suite:1; /* if 1, the unit is running a suite */
+ struct s_unit *owner; /* the unit owned the unit is included */
+ struct s_unit *root; /* the root unit */
+ xbt_dynar_t suites; /* the suites contained by the unit */
+ int exit_code; /* the exit code of the unit */
+ int err_kind;
+ char *err_line;
+ xbt_dynar_t includes;
+ char *filepos;
+ } s_unit_t, *unit_t;
+
+/*
+ * declaration of the tesh file stream type used to manage the tesh file.
+ */
+ typedef struct s_fstream {
+ char *name; /* the name of the file stream (same as the name of the tesh file) */
+ char *directory; /* the directory containing the tesh file */
+ FILE *stream; /* the system file stream */
+ struct s_unit *unit; /* a reference to the unit using the file stream object */
+ unsigned parsed:1;
+ } s_fstream_t, *fstream_t;