40static int compar_error(
const void *error_1_p,
const void *error_2_p)
45 if ( (error_1->
id < 0) &&(error_2->
id < 0))
return (error_2->
id - error_1->
id);
46 if (error_1->
id < 0)
return 1;
47 if (error_2->
id < 0)
return -1;
49 return (error_1->
id - error_2->
id);
59 for ( i=0; i<size; i++)
61 (error_info+i)->
id = -i-1;
62 (error_info+i)->global_cnt=0;
63 (error_info+i)->tmp_cnt=0;
64 (error_info+i)->title = NULL;
65 (error_info+i)->description = NULL;
66 (error_info+i)->comment = NULL;
82 if (work_error != NULL)
98 if (work_error != NULL)
113 if (work_error != NULL)
115 if ( global_cnt != NULL)
120 if ( tmp_cnt != NULL)
122 *tmp_cnt = work_error->
tmp_cnt;
129 int language,
int id,
char **title,
char **description,
char **comment)
141 if (work_error == NULL)
143 sprintf(line,
"Unknown Id for Error %d\nNo Message Available\n",
id );
146 if ( title != NULL ) *title = NULL;
147 if ( description != NULL ) *description = NULL;
148 if ( comment != NULL ) *comment = NULL;
157 if (work_error->
title== NULL)
165 *title = _strdup(scan_comment->
text);
167 *title = strdup(scan_comment->
text);
173 if ( description != NULL )
187 if ( comment != NULL )
189 if (work_error->
comment== NULL)
197 *comment = _strdup(scan_comment->
text);
199 *comment = strdup(scan_comment->
text);
224 int already_print = 0;
235 if (infilename != NULL)
237 infile = fopen(infilename,
"r");
275 while ( (
analyse_getline(line, infile, infilename, &linecount) != -1) &&
276 ( strncmp(line,
"/END", 4) != 0 ))
280 if (strstr(line,
"/ANALYSE/MESSAGE/") != NULL)
284 sscanf(key,
"%d", &
id );
289 if (work_error == NULL)
293 if ( already_print == 0)
301 work_error = *error_p + new_count;
315 if ( (strncmp(key,
"TITLE", 5) == 0) ||
316 (strncmp(key,
"DESCRIPTION", 11) == 0) )
322 if (strncmp(key,
"TITLE", 5)== 0)
326 else if (strncmp(key,
"DESCRIPTION", 11)== 0)
#define ANALYSE_ERROR_DESCRIPTION
#define ANALYSE_ERROR_TITLE
#define ANALYSE_SIZE_OF_LINE
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)
static analyse_error_info_t * error_create(int size)
void analyse_error_cnt(analyse_error_info_t *error_list, int id)
static int ANALYSE_NB_ERROR
void analyse_error_get_cnt(analyse_error_info_t *error_list, int id, int *global_cnt, int *tmp_cnt)
static int compar_error(const void *error_1_p, const void *error_2_p)
void analyse_error_file_read(analyse_error_info_t **error_p, char *infilename)
void analyse_error_set_tmp_cnt(analyse_error_info_t *error_list, int id, int value)
struct analyse_error_info_s analyse_error_info_t
int analyse_getkey(int pos, char *line, char *name)
int analyse_getline(char line[], FILE *infile, char *infilename, int *linecount)
void * analyse_malloc(size_t size)
void analyse_free(void *block)
void Analyse_Print_Error_Level(char *text, int level)
void Analyse_Print_Debug(char *text)
recursive subroutine qsort(a, idx, first, last)
analyse_comment_t * description
analyse_comment_t * title
analyse_comment_t * comment