-#define VALIDATE_FILE(test, what) do { \
- struct stat sb; \
- int n; \
- \
- for(n = 0; n < nvec; ++n) { \
- if(stat(vec[n], &sb) < 0) { \
- error(errno, "%s:%d: %s", cs->path, cs->line, vec[n]); \
- return -1; \
- } \
- if(!test(sb.st_mode)) { \
- error(0, "%s:%d: %s is not a %s", \
- cs->path, cs->line, vec[n], what); \
- return -1; \
- } \
- } \
+/** @brief Perform a test on a filename
+ * @param test Test function to call on mode bits
+ * @param what Type of file sought
+ *
+ * If @p test returns 0 then the file is not a @p what and an error
+ * is reported and -1 is returned.
+ */
+#define VALIDATE_FILE(test, what) do { \
+ struct stat sb; \
+ int n; \
+ \
+ for(n = 0; n < nvec; ++n) { \
+ if(stat(vec[n], &sb) < 0) { \
+ disorder_error(errno, "%s:%d: %s", \
+ cs->path, cs->line, vec[n]); \
+ return -1; \
+ } \
+ if(!test(sb.st_mode)) { \
+ disorder_error(0, "%s:%d: %s is not a %s", \
+ cs->path, cs->line, vec[n], what); \
+ return -1; \
+ } \
+ } \