--- rc_error.c 2003/07/02 12:40:15 1.5
+++ rc_error.c 2003/07/02 15:07:48 1.6
@@ -27,8 +27,9 @@
** rc_error.c: Run-command processor ISO C source file
*/
-#include <stdlib.h> /* Just for calling 'exit(3)' once */
-#include "rc.h" /* Public interfaces */
+#include <stdlib.h> /* Just for calling 'exit(3)' once */
+#include "rc.h" /* Public interfaces */
+#include "rc_config.h" /* Interface to the configuration */
/************************************************
@@ -41,68 +42,70 @@
if ((rc_return_t)Localerr.ex_value == RC_ERR_TRM)
exit(0);
else if ((rc_return_t)Localerr.ex_value == RC_ERR_USE) {
- fprintf(stderr, " API usage is wrong\n.");
- if (configGetvar(RC_DBG_VAL))
+ fprintf(stderr, " API usage is wrong.\n");
+ if (configGetval(RC_DBG_VAL))
fprintf(stderr, " Error condition in %s:%s():%d.\n", \
Localerr.ex_file, Localerr.ex_func, Localerr.ex_line);
}
else if ((rc_return_t)Localerr.ex_value == RC_ERR_MEM) {
- fprintf(stderr, " Memory allocation failure\n.");
- if (configGetvar(RC_DBG_VAL))
+ fprintf(stderr, " Memory allocation failure.\n");
+ if (configGetval(RC_DBG_VAL))
fprintf(stderr, " Error condition in %s:%s():%d.\n", \
Localerr.ex_file, Localerr.ex_func, Localerr.ex_line);
}
else if ((rc_return_t)Localerr.ex_value == RC_ERR_SYS) {
- fprintf(stderr, " Underlying system failure\n.");
- if (configGetvar(RC_DBG_VAL))
+ fprintf(stderr, " Underlying system failure.\n");
+ if (configGetval(RC_DBG_VAL))
fprintf(stderr, " Error condition in %s:%s():%d.\n", \
Localerr.ex_file, Localerr.ex_func, Localerr.ex_line);
}
else if ((rc_return_t)Localerr.ex_value == RC_ERR_IO) {
- fprintf(stderr, " Input output failure\n.");
- if (configGetvar(RC_DBG_VAL))
+ fprintf(stderr, " Input output failure.\n");
+ if (configGetval(RC_DBG_VAL))
fprintf(stderr, " Error condition in %s:%s():%d.\n", \
Localerr.ex_file, Localerr.ex_func, Localerr.ex_line);
}
else if ((rc_return_t)Localerr.ex_value == RC_ERR_INT) {
- fprintf(stderr, " Internal failure\n.");
- if (configGetvar(RC_DBG_VAL))
+ fprintf(stderr, " Internal failure.\n");
+ if (configGetval(RC_DBG_VAL))
fprintf(stderr, " Error condition in %s:%s():%d.\n", \
Localerr.ex_file, Localerr.ex_func, Localerr.ex_line);
}
else if ((rc_return_t)Localerr.ex_value == RC_ERR_FNC) {
- fprintf(stderr, " Function file could not be opened\n.");
- if (configGetvar(RC_DBG_VAL))
+ fprintf(stderr, " Function file %s could not be opened.\n", \
+ configGetval(RC_FNC_VAL));
+ if (configGetval(RC_DBG_VAL))
fprintf(stderr, " Error condition in %s:%s():%d.\n", \
Localerr.ex_file, Localerr.ex_func, Localerr.ex_line);
}
else if ((rc_return_t)Localerr.ex_value == RC_ERR_DIR) {
- fprintf(stderr, " Location dir could not be opened\n.");
- if (configGetvar(RC_DBG_VAL))
+ fprintf(stderr, " Location dir %s could not be opened.\n", \
+ configGetval(RC_LOC_VAL));
+ if (configGetval(RC_DBG_VAL))
fprintf(stderr, " Error condition in %s:%s():%d.\n", \
Localerr.ex_file, Localerr.ex_func, Localerr.ex_line);
}
else if ((rc_return_t)Localerr.ex_value == RC_ERR_RCF) {
- fprintf(stderr, " Rc file could not be opened\n.");
- if (configGetvar(RC_DBG_VAL))
+ fprintf(stderr, " One or more rc files could not be opened.\n");
+ if (configGetval(RC_DBG_VAL))
fprintf(stderr, " Error condition in %s:%s():%d.\n", \
Localerr.ex_file, Localerr.ex_func, Localerr.ex_line);
}
else if ((rc_return_t)Localerr.ex_value == RC_ERR_CFG) {
- fprintf(stderr, " Configuration and options failure\n.");
- if (configGetvar(RC_DBG_VAL))
+ fprintf(stderr, " Configuration failure.\n");
+ if (configGetval(RC_DBG_VAL))
fprintf(stderr, " Error condition in %s:%s():%d.\n", \
Localerr.ex_file, Localerr.ex_func, Localerr.ex_line);
}
else if ((rc_return_t)Localerr.ex_value == RC_ERR_ROOT) {
- fprintf(stderr, " You must be root to run these commands\n.");
- if (configGetvar(RC_DBG_VAL))
+ fprintf(stderr, " You must be root to run these commands.\n");
+ if (configGetval(RC_DBG_VAL))
fprintf(stderr, " Error condition in %s:%s():%d.\n", \
Localerr.ex_file, Localerr.ex_func, Localerr.ex_line);
}
else {
- fprintf(stderr, " \n Generic failure condition of class '%s',\n.");
- if (configGetvar(RC_DBG_VAL))
+ fprintf(stderr, " \n Generic failure condition of class '%s',.\n");
+ if (configGetval(RC_DBG_VAL))
fprintf(stderr, " Error condition in %s:%s():%d.\n", \
Localerr.ex_file, Localerr.ex_func, Localerr.ex_line);
}
|