Debian Codegraph @

packages/seacas/applications/nem_slice/elb_err.h

raw
1 /*
2 * Copyright(C) 1999-2020, 2022 National Technology & Engineering Solutions
3 * of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
4 * NTESS, the U.S. Government retains certain rights in this software.
5 *
6 * See packages/seacas/LICENSE for details
7 */
8 #pragma once
9
10 #include <algorithm> // for move
11 #include <string> // for string
12
13 /* Structure to store an error message */
14 struct error_message
15 {
16 int level;
17 std::string err_mesg{};
18 int line_no;
19 std::string filename{};
20
21 error_message(int l, std::string msg, int ln, std::string file)
22 : level(l), err_mesg(std::move(msg)), line_no(ln), filename(std::move(file))
23 {
24 }
25 };
26
27 extern int error_lev;
28
29 /* Macro used in the code to add an error message */
30 #define Gen_Error(a, b) (error_add(a, b, __FILE__, __LINE__))
31
32 /* Function prototype for error functions */
33 extern void error_add(int level,
34 const std::string &message, /* The message to add to the error list */
35 const std::string &filename, /* The filename in which the error occurred */
36 int line_no /* The line number in filename where the error
37 * was reported */
38 );
39
40 extern void error_report();