LCOV - code coverage report
Current view: top level - src - exit_status.c (source / functions) Coverage Total Hit
Test: coverage.info Lines: 78.6 % 14 11
Test Date: 2026-01-12 05:34:38 Functions: 100.0 % 1 1

            Line data    Source code
       1              : #include "precizer.h"
       2              : 
       3              : /**
       4              :  *
       5              :  * Print out an exit status
       6              :  *
       7              :  */
       8          203 : int exit_status(
       9              :         Return       status,
      10              :         char * const *argv)
      11              : {
      12              :         /*
      13              :          *
      14              :          * Exit
      15              :          *
      16              :          */
      17              : 
      18          203 :         const char *application_file_name = basename(argv[0]);
      19              : 
      20          203 :         if(global_interrupt_flag == true)
      21              :         {
      22            0 :                 slog(EVERY,"The %s has been interrupted smoothly. All data remain in integrity condition\n",application_file_name);
      23            0 :                 slog(EVERY,"Exit status » %s\n",show_status(status));
      24            0 :                 return((int)status);
      25              :         } else {
      26          203 :                 if(TRIUMPH & status)
      27              :                 {
      28          178 :                         slog(EVERY,"The %s completed its execution without any issues\n",application_file_name);
      29          178 :                         slog(EVERY,"Exit status » %s\n",show_status(status));
      30          178 :                         slog(REGULAR,"Enjoy your life!\n");
      31          178 :                         return((int)COMPLETED);
      32              :                 } else {
      33           25 :                         slog(ERROR,"The %s process terminated unexpectedly due to an error\n",application_file_name);
      34           25 :                         slog(ERROR,"Exit status » %s\n",show_status(status));
      35           25 :                         return((int)status);
      36              :                 }
      37              :         }
      38              : }
        

Generated by: LCOV version 2.0-1