This repository was archived by the owner on Jan 2, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherr_handler.h
More file actions
33 lines (28 loc) · 1.36 KB
/
err_handler.h
File metadata and controls
33 lines (28 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/**************************************************************************
* C S 429 MM-lab
*
* err_handler.h - This file contains the enums used for error handling, as
* well as a couple of function definitions.
*
* Copyright (c) 2021. S. Chatterjee, X. Shen, T. Byrd, M. Hinton. All rights reserved.
* May not be used, modified, or copied without permission.
**************************************************************************/
/* This enum represents the various levels used by the logging system. */
typedef enum {
LOG_INFO, // print a message to the console
LOG_WARNING, // print a warning message and ignore the current input
LOG_ERROR, // print an error message and ignore the current input
LOG_FATAL, // print an error message and terminate the program
LOG_OTHER = -1 // should not be used
} log_lev_t;
/* This enum represents the various types of errors.
* The error type only affects what is printed to the console. */
typedef enum {
ERR_APPL, // application error
ERR_OS, // operating system error
ERR_MALLOC, // user malloc error
} err_type_t;
/* This function will log information to the console given a log_lev_t enum
* and a log string. Use it for system level errors or debugging info. Output
* created by this function will not affect grading. */
int logging(log_lev_t, char*);