4 * Copyright (C) 1993-1999 by Jochen Wiedmann and Marcin Orlowski
5 * Copyright (C) 2002-2010 by the FlexCat Open Source Team
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or (at
10 * your option) any later version.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 #include "readprefs.h"
31 /* This shows an error message and quits. */
33 void ShowError(const char *msg
, ...)
39 snprintf(header
, sizeof(header
), MSG_ERR_ERROR
, ScanFile
, ScanLine
);
41 vsnprintf(message
, sizeof(message
), msg
, args
);
43 fprintf(stderr
, "%s %s\n", header
, message
);
55 /* Same as ShowError but in this case we omit any line number. */
57 void ShowErrorQuick(const char *msg
, ...)
63 snprintf(header
, sizeof(header
), MSG_ERR_ERROR_QUICK
, ScanFile
);
65 vsnprintf(message
, sizeof(message
), msg
, args
);
67 fprintf(stderr
, "%s %s\n", header
, message
);
79 /* This shows the 'Memory error' message. */
83 ShowError(MSG_ERR_NOMEMORY
);
89 /* This shows a warning. */
91 void ShowWarn(const char *msg
, ...)
99 snprintf(header
, sizeof(header
), MSG_ERR_WARNING
, ScanFile
, ScanLine
);
101 vsnprintf(message
, sizeof(message
), msg
, args
);
103 fprintf(stderr
, "%s %s\n", header
, message
);
107 GlobalReturnCode
= 5;
113 /* This shows a warning without line number. */
115 void ShowWarnQuick(const char *msg
, ...)
123 snprintf(header
, sizeof(header
), MSG_ERR_WARNING_QUICK
, ScanFile
);
125 vsnprintf(message
, sizeof(message
), msg
, args
);
127 fprintf(stderr
, "%s %s\n", header
, message
);
131 GlobalReturnCode
= 5;