-/* Number of errors, warnings reported. */
-extern int err_error_count;
-extern int err_warning_count;
+static inline enum msg_category
+msg_class_to_category (enum msg_class class)
+{
+ return class / 3;
+}
+
+static inline enum msg_severity
+msg_class_to_severity (enum msg_class class)
+{
+ return class % 3;
+}
+
+static inline enum msg_class
+msg_class_from_category_and_severity (enum msg_category category,
+ enum msg_severity severity)
+{
+ return category * 3 + severity;
+}
+
+/* A message. */
+struct msg
+ {
+ enum msg_category category; /* Message category. */
+ enum msg_severity severity; /* Message severity. */
+ char *file_name; /* Name of file containing error, or NULL. */
+ int first_line; /* 1-based line number, or 0 if none. */
+ int last_line; /* 1-based exclusive last line (0=none). */
+ int first_column; /* 1-based first column, or 0 if none. */
+ int last_column; /* 1-based exclusive last column (0=none). */
+ char *text; /* Error text. */
+ };