-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #94 from MLanguage/improve-anomaly-handling
Improve anomaly handling
- Loading branch information
Showing
4 changed files
with
117 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,19 @@ | ||
/* Copyright (C) 2021 Inria, contributor: James Barnes <[email protected]> | ||
This program is free software: you can redistribute it and/or modify it under the terms of the | ||
GNU General Public License as published by the Free Software Foundation, either version 3 of the | ||
License, or (at your option) any later version. | ||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without | ||
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
General Public License for more details. | ||
You should have received a copy of the GNU General Public License along with this program. If | ||
not, see <https://www.gnu.org/licenses/>. */ | ||
|
||
#include "m_error.h" | ||
|
||
int get_occurred_errors_count(m_error *errors, int size) { | ||
int get_occurred_errors_count(m_error_occurrence* errors, int size) { | ||
int count = 0; | ||
|
||
for (int i = 0; i < size; i++) { | ||
|
@@ -12,8 +25,8 @@ int get_occurred_errors_count(m_error *errors, int size) { | |
return count; | ||
} | ||
|
||
m_error *get_occurred_errors_items(int full_list_count, m_error *full_list, | ||
m_error *filtered_errors) { | ||
m_error_occurrence* get_occurred_errors_items(int full_list_count, m_error_occurrence* full_list, | ||
m_error_occurrence* filtered_errors) { | ||
int count = 0; | ||
|
||
for (int i = 0; i < full_list_count; i++) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,16 @@ | ||
/* Copyright (C) 2021 Inria, contributor: James Barnes <[email protected]> | ||
This program is free software: you can redistribute it and/or modify it under the terms of the | ||
GNU General Public License as published by the Free Software Foundation, either version 3 of the | ||
License, or (at your option) any later version. | ||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without | ||
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
General Public License for more details. | ||
You should have received a copy of the GNU General Public License along with this program. If | ||
not, see <https://www.gnu.org/licenses/>. */ | ||
|
||
#ifndef M_ERROR_ | ||
#define M_ERROR_ | ||
|
||
|
@@ -9,17 +22,22 @@ | |
typedef enum error_kind { Anomaly, Discordance, Information } error_kind; | ||
|
||
typedef struct m_error { | ||
char kind[2]; | ||
char major_code[4]; | ||
char minor_code[7]; | ||
char description[81]; | ||
char isisf[2]; | ||
bool has_occurred; | ||
const char* kind; | ||
const char* major_code; | ||
const char* minor_code; | ||
const char* description; | ||
const char* isisf; | ||
const char* code_information; | ||
} m_error; | ||
|
||
int get_occurred_errors(m_error *errors, int size); | ||
typedef struct m_error_occurrence { | ||
const m_error *error; | ||
bool has_occurred; | ||
} m_error_occurrence; | ||
|
||
int get_occurred_errors(m_error_occurrence *errors, int size); | ||
|
||
m_error *get_occurred_errors_items(int full_list_count, m_error *full_list, | ||
m_error *filtered_errors); | ||
m_error_occurrence* get_occurred_errors_items(int full_list_count, m_error_occurrence *full_list, | ||
m_error_occurrence *filtered_errors); | ||
|
||
#endif /* M_ERROR_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters