1 /* 2 * ioerr.h: Part of GNU CSSC. 3 * 4 * 5 * Copyright (C) 1997, 1998, 2007, 2008, 2009, 2010, 2011, 2014, 2019 6 * Free Software Foundation, Inc. 7 * 8 * This program is free software: you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation, either version 3 of the License, or 11 * (at your option) any later version. 12 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with this program. If not, see <http://www.gnu.org/licenses/>. 20 * 21 * 22 * This file centralises knowledge of the return values 23 * of the various <stdio.h> functions. 24 * 25 */ 26 27 #ifndef CSSC__IOERR_H__ 28 #define CSSC__IOERR_H__ 29 30 31 #define fclose_failed(n) (EOF == n) 32 #define fputc_failed(n) (EOF == n) 33 #define putc_failed(n) (EOF == n) 34 #define fputs_failed(n) (EOF == n) 35 #define fflush_failed(n) (EOF == n) 36 37 #define printf_failed(n) (n < 0) 38 #define fprintf_failed(n) (n < 0) 39 40 #define fwrite_failed(n,desired) (n < desired) 41 #endif 42