OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
analyse.h File Reference

Go to the source code of this file.

Functions

int analyse_get_datas (int name_id, int *nb_int, int **tab_int, int *nb_float, float **tab_float)
void analyse_quit (void)
void analyse_write_f (char *message)
void analyse_stack_float (float r)
void analyse_stack_int (int i)
void analyse_call_error (int type, int id, int mode)
void analyse_call_check (int id)

Function Documentation

◆ analyse_call_check()

void analyse_call_check ( int id)

Definition at line 802 of file analyse.c.

803{
804 if (id == -1)
805 {
807 }
808 else
809 {
810 analyse_tree_enter(AN_CHECK);
812 analyse_tree_close(AN_CHECK);
813 }
814}
static analyse_check_t * analyse_check_list
Definition analyse.c:78
static analyse_check_group_t * analyse_check_group_list
Definition analyse.c:77
static void analyse_tree_close(int name_id)
Definition analyse.c:472
static void analyse_tree_enter(int name_id)
Definition analyse.c:395
static int LANGUAGE
Definition analyse.c:57
void analyse_check_file_write(analyse_check_t *check_list, analyse_check_group_t *check_group_list, int language)
void analyse_check_store(analyse_check_t *check_list, int language, int check_id)

◆ analyse_call_error()

void analyse_call_error ( int type,
int id,
int mode )

Definition at line 580 of file analyse.c.

581{
582 int nb_int;
583 int *tab_int=NULL;
584
585 int nb_int_line;
586 int *tab_int_line=NULL;
587
588 char *title;
589 char *description;
590
591 int nb_err, nb_warn;
592
593 char stop_message[]="\n\n %s STOPPED due to INPUT ERROR";
594 char gene_message[]="\n******************************\n%s stopped with :\n %d Error(s)\n %d Warning(s)\n******************************\n";
595
596 char error_id_message[]="ERROR id : %d";
597 char warning_id_message[]="WARNING id : %d";
598 char info_id_message[]="INFO id : %d";
599 char unknown_id_message[]="??? id : %d";
600
601 char id_message_real[20];
602 char *message;
603
604 /* Get tab for a new line */
605 analyse_convert_string_to_int("\n", &nb_int_line, &tab_int_line);
606
607
608 /* ADD ERROR in IERR */
609 if (type == AN_ERROR)
610 {
611 anaderr();
612 analyse_tree_enter(AN_ERROR);
613 analyse_error_return_message(analyse_error_list, AN_ERROR, LANGUAGE, id, &title, &description, NULL);
614 }
615 else if (type == AN_WARNING)
616 {
617 anadwar();
618 analyse_tree_enter(AN_WARNING);
619 analyse_error_return_message(analyse_error_list, AN_WARNING, LANGUAGE, id, &title, &description, NULL);
620 }
621 else
622 {
623 analyse_tree_enter(AN_INFO);
624 analyse_error_return_message(analyse_error_list, AN_INFO, LANGUAGE, id, &title, &description, NULL);
625 }
626
627 /* Count Error */
629
630 /* Print Error Id + Title */
631 if (type == AN_ERROR)
632 sprintf(id_message_real, error_id_message, id);
633 else if (type == AN_WARNING)
634 sprintf(id_message_real, warning_id_message, id);
635 else if (type == AN_INFO)
636 sprintf(id_message_real, info_id_message, id);
637 else
638 sprintf(id_message_real, unknown_id_message, id);
639
640 analyse_GUI_add_error_message(id_message_real);
642
643 switch(mode)
644 {
645 case ANSTOP:
646 case ANINFO: /* title+description on screen, title+description in file */
647 case ANINFO_BLIND_1: /* only title on screen, title + description in file */
648 /* Id */
649 analyse_convert_string_to_int(id_message_real, &nb_int, &tab_int);
650
651 wiout(&nb_int_line, tab_int_line);
652 /* wistdo(&nb_int_line, tab_int_line); */
653
654 wiout(&nb_int, tab_int);
655 if (mode == ANINFO )
656 wistdo(&nb_int, tab_int);
657
658 analyse_free(tab_int);
659
660 /* Title */
661 analyse_convert_string_to_int(title, &nb_int, &tab_int);
662 wistdo(&nb_int, tab_int);
663 wiout(&nb_int, tab_int);
664
665 analyse_free(tab_int);
666 break;
667
668 case ANINFO_BLIND_2: /* nothing on screen, title + description in file */
669 case ANINFO_BLIND_3: /* nothing on screen, title in file */
670
671 /* Id */
672 analyse_convert_string_to_int(id_message_real, &nb_int, &tab_int);
673
674 wiout(&nb_int_line, tab_int_line);
675 wiout(&nb_int, tab_int);
676
677 analyse_free(tab_int);
678
679 /* Title */
680 analyse_convert_string_to_int(title, &nb_int, &tab_int);
681 wiout(&nb_int, tab_int);
682
683 analyse_free(tab_int);
684 break;
685
686
687 case ANINFO_BLIND_4: /* nothing on screen, nothing in file */
688 default :
689 break;
690 }
691 analyse_free(title);
692
693
694 /* Print Error Description */
695 analyse_GUI_add_error_message(description);
696
697 switch(mode)
698 {
699 case ANSTOP:
700 case ANINFO: /* title+description on screen, title+description in file */
701 analyse_convert_string_to_int(description, &nb_int, &tab_int);
702
703 wiout(&nb_int, tab_int);
704 wistdo(&nb_int, tab_int);
705
706 wiout(&nb_int_line, tab_int_line);
707 /* wistdo(&nb_int_line, tab_int_line); */
708
709 analyse_free(tab_int);
710 break;
711
712 case ANINFO_BLIND_1: /* only title on screen, title + description in file */
713 analyse_convert_string_to_int(description, &nb_int, &tab_int);
714
715 wiout(&nb_int, tab_int);
716
717 wiout(&nb_int_line, tab_int_line);
718 /* wistdo(&nb_int_line, tab_int_line); */
719
720 analyse_free(tab_int);
721 break;
722
723 case ANINFO_BLIND_2: /* nothing on screen, title + description in file */
724 analyse_convert_string_to_int(description, &nb_int, &tab_int);
725
726 wiout(&nb_int, tab_int);
727
728 wiout(&nb_int_line, tab_int_line);
729
730 analyse_free(tab_int);
731 break;
732
733 case ANINFO_BLIND_3: /* nothing on screen, title in file */
734 wiout(&nb_int_line, tab_int_line);
735 break;
736
737 case ANINFO_BLIND_4: /* nothing on screen, nothing in file */
738 default :
739 break;
740 }
741 analyse_free(description);
742
743
744 /* Error Management */
745 switch(mode)
746 {
747 case ANSTOP:
748 /* Stopped due to Input Errors */
749 message = (char *)analyse_malloc((strlen(analyse_tree->info.calling_name)+strlen(stop_message)+1)*sizeof(char));
750 sprintf(message,stop_message,analyse_tree->info.calling_name);
751
752 /* Print Stop Message On SCREEN, IN L00 FILE and in GUI*/
753 analyse_convert_string_to_int(message, &nb_int, &tab_int);
754
755 wistdo(&nb_int, tab_int);
756 wiout(&nb_int, tab_int);
757
758 analyse_free(tab_int);
759
761 analyse_free(message);
762
763 /* Prepare GUI Message and start GUI*/
764 angetnb(&nb_err, &nb_warn);
765 message = (char *)analyse_malloc((strlen(analyse_tree->info.calling_name)+strlen(gene_message)+ 10+10+1)*sizeof(char));
766 sprintf(message,gene_message,analyse_tree->info.calling_name, nb_err, nb_warn);
767
769 analyse_free(message);
770
772
773 /* quit Program */
774 analyse_quit();
775 break;
776
777 case ANINFO:
778 case ANINFO_BLIND_1:
779 case ANINFO_BLIND_2:
780 case ANINFO_BLIND_3:
781 case ANINFO_BLIND_4:
782 if (type == AN_ERROR)
783 analyse_tree_close(AN_ERROR);
784 else if (type == AN_WARNING)
785 analyse_tree_close(AN_WARNING);
786 else
787 analyse_tree_close(AN_INFO);
788 break;
789
790 default :
791 break;
792 }
793
794 analyse_free(tab_int_line);
795}
void analyse_quit(void)
Definition analyse.c:969
static analyse_error_info_t * analyse_error_list
Definition analyse.c:75
analyse_node_t * analyse_tree
Definition analyse.c:69
void analyse_GUI_add_error_message(char *error_message)
Definition analyse_GUI.c:68
void analyse_GUI_start_loop(void)
Definition analyse_GUI.c:52
void analyse_error_return_message(analyse_error_info_t *error_list, int error_warning_type, int language, int id, char **title, char **description, char **comment)
void analyse_error_cnt(analyse_error_info_t *error_list, int id)
void * analyse_malloc(size_t size)
void analyse_free(void *block)
#define angetnb
#define anaderr
#define wiout
#define anadwar
#define wistdo
void analyse_convert_string_to_int(char *message, int *nb_int, int **tab_int)

◆ analyse_get_datas()

int analyse_get_datas ( int name_id,
int * nb_int,
int ** tab_int,
int * nb_float,
float ** tab_float )

Definition at line 364 of file analyse.c.

365{
366
367 analyse_node_t *node_scan;
368
369 node_scan=search_for_node_with_id(name_id);
370
371 if (node_scan == NULL)
372 {
373 if (nb_int!= NULL) *nb_int=0;
374 if (tab_int !=NULL) *tab_int=NULL;
375
376 if (nb_float != NULL) *nb_float=0;
377 if (tab_float != NULL) *tab_float=NULL;
378
379 return -1;
380 }
381
382 if (nb_int != NULL) *nb_int=node_scan->info.nb_int_data;
383 if (tab_int != NULL) *tab_int = int_stack + node_scan->info.int_data_offset_start;
384
385 if (nb_float != NULL) *nb_float=node_scan->info.nb_float_data;
386 if (tab_float != NULL) *tab_float = float_stack + node_scan->info.float_data_offset_start;
387
388 return 0;
389}
static float * float_stack
Definition analyse.c:64
static int * int_stack
Definition analyse.c:59
static analyse_node_t * search_for_node_with_id(int name_id)
Definition analyse.c:114
struct analyse_node_s analyse_node_t
analyse_info_t info

◆ analyse_quit()

void analyse_quit ( void )

Definition at line 969 of file analyse.c.

970{
971 anend();
972}
#define anend

◆ analyse_stack_float()

void analyse_stack_float ( float r)

Definition at line 294 of file analyse.c.

295{
297 {
298 float_stack = (float *)analyse_realloc( (void *)float_stack, (float_stack_size + SIZE_STEP)*sizeof(float));
299
301 }
302
305
306
307}
#define SIZE_STEP
Definition analyse.c:55
static int float_stack_scan
Definition analyse.c:67
static int float_stack_size
Definition analyse.c:65
void * analyse_realloc(void *block, size_t size)

◆ analyse_stack_int()

void analyse_stack_int ( int i)

Definition at line 334 of file analyse.c.

335{
337 {
338 int_stack = (int *)analyse_realloc( (void *)int_stack, (int_stack_size + SIZE_STEP)*sizeof(int));
339
341 }
342
345
346}
static int int_stack_size
Definition analyse.c:60
static int int_stack_scan
Definition analyse.c:62

◆ analyse_write_f()

void analyse_write_f ( char * message)

Definition at line 1022 of file analyse.c.

1023{
1024 int nb_int;
1025 int *tab_int=NULL;
1026
1027 analyse_convert_string_to_int(message, &nb_int, &tab_int);
1028
1029// wif(&nb_int, tab_int);
1030
1031 analyse_free(tab_int);
1032}