diff --git a/src/reader.c b/src/reader.c new file mode 100644 index 0000000..eb756cc --- /dev/null +++ b/src/reader.c @@ -0,0 +1,43 @@ +/* reader.c: Stream reader implementation + * Created: 2026-02-04 + * Author: Aryadev Chavali + * License: See end of file + * Commentary: + */ + +#include +#include + +#include +#include + +const char *read_err_to_cstr(read_err_t err) +{ + switch (err) + { + case READ_ERR_OK: + return "OK"; + break; + case READ_ERR_EOF: + return "EOF"; + break; + case READ_ERR_UNKNOWN_CHAR: + return "UNKNOWN_CHAR"; + break; + default: + FAIL("Unreachable"); + } +} + +/* Copyright (C) 2026 Aryadev Chavali + + * 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 Version 2 for + * details. + + * You may distribute and modify this code under the terms of the GNU General + * Public License Version 2, which you should have received a copy of along with + * this program. If not, please go to . + + */