Changes by: uvman
Update of /cvsroot/linux-ntfs/ntfsprogs/libntfs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8728/libntfs
Modified Files:
debug.c logging.c
Log Message:
Remove {Dputs, Dprintf, Dperror} and convert callers to ntfs_log_*. Make ntfsinfo use ntfs_logging_parse_option().
Index: debug.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/debug.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -p -r1.13 -r1.14
--- debug.c 24 Oct 2005 20:50:05 -0000 1.13
+++ debug.c 25 Oct 2005 01:28:11 -0000 1.14
@@ -32,119 +32,6 @@
#include "debug.h"
#include "logging.h"
-/**
- * Sprintf - silencable output to stderr
- * @silent: if 0 string is output to stderr
- * @fmt: printf style format string
- * @...: optional arguments for the printf style format string
- *
- * If @silent is 0, output the string @fmt to stderr.
- *
- * This is basically a replacement for:
- *
- * if (!silent)
- * fprintf(stderr, fmt, ...);
- *
- * It is more convenient to use Sprintf instead of the above code and perhaps
- * more importantly, Sprintf makes it much easier to turn it into a "do
- * nothing" function, by defining it to "do {} while (0)" in debug.h instead of
- * to * __Sprintf, thus removing the whole output completely.
- */
-void __Sprintf(const int silent, const char *fmt, ...)
-{
- int eo;
- va_list ap;
-
- if (silent)
- return;
- eo = errno;
- va_start(ap, fmt);
- vfprintf(stderr, fmt, ap);
- va_end(ap);
- errno = eo;
-}
-
-#ifdef DEBUG
-
-/* Debug output to stderr. To get it run ./configure --enable-debug. */
-
-/**
- * __ntfs_error
- */
-void __ntfs_error(const char *function, const char *fmt, ...)
-{
- int eo = errno;
- int flen = 0;
- va_list args;
- char err_buf[1024];
-
- if (function)
- flen = strlen(function);
- va_start(args, fmt);
- vsnprintf(err_buf, sizeof(err_buf), fmt, args);
- va_end(args);
- fprintf(stderr, "NTFS error: %s(): %s\n", flen ? function : "",
- err_buf);
- errno = eo;
-}
-
-/**
- * __ntfs_debug
- */
-void __ntfs_debug(const char *file, int line, const char *function,
- const char *fmt, ...)
-{
- int eo = errno;
- int flen = 0;
- va_list args;
- char err_buf[1024];
-
- if (function)
- flen = strlen(function);
- va_start(args, fmt);
- vsnprintf(err_buf, sizeof(err_buf), fmt, args);
- va_end(args);
- fprintf(stderr, "NTFS DEBUG (%s, %d): %s(): %s\n", file, line,
- flen ? function : "", err_buf);
- errno = eo;
-}
-
-/**
- * __Dprintf
- */
-void __Dprintf(const char *fmt, ...)
-{
- int eo = errno;
- va_list ap;
-
- va_start(ap, fmt);
- vfprintf(stderr, fmt, ap);
- va_end(ap);
- errno = eo;
-}
-
-/**
- * __Dputs
- */
-void __Dputs(const char *s)
-{
- int eo = errno;
- fprintf(stderr, "%s\n", s);
- errno = eo;
-}
-
-/**
- * __Dperror
- */
-void __Dperror(const char *s)
-{
- int eo = errno;
- perror(s);
- errno = eo;
-}
-
-#endif
-
#ifndef NTFS_DISABLE_DEBUG_LOGGING
/**
* ntfs_debug_runlist_dump - Dump a runlist.
Index: logging.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/logging.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- logging.c 21 Oct 2005 18:05:13 -0000 1.2
+++ logging.c 25 Oct 2005 01:28:11 -0000 1.3
@@ -485,7 +485,7 @@ BOOL ntfs_logging_parse_option(const cha
return TRUE;
}
- ntfs_log_warning("Unknown logging option '%s'\n", option);
+ ntfs_log_debug("Unknown logging option '%s'\n", option);
return FALSE;
}
|