summaryrefslogtreecommitdiffstats
path: root/qprintf.c
diff options
context:
space:
mode:
authorUpstream <upstream-import@none>1970-01-12 13:46:40 +0000
committerUpstream <upstream-import@none>1970-01-12 13:46:40 +0000
commit1bc4596b116b3c829824c8b929ce48f864ca4a3c (patch)
tree332339626bc83390de46cf38346f76effc46009b /qprintf.c
downloadandroid_external_giflib-1bc4596b116b3c829824c8b929ce48f864ca4a3c.tar.gz
android_external_giflib-1bc4596b116b3c829824c8b929ce48f864ca4a3c.tar.bz2
android_external_giflib-1bc4596b116b3c829824c8b929ce48f864ca4a3c.zip
external/giflib 4.1.6
Diffstat (limited to 'qprintf.c')
-rw-r--r--qprintf.c63
1 files changed, 63 insertions, 0 deletions
diff --git a/qprintf.c b/qprintf.c
new file mode 100644
index 0000000..9d3dd58
--- /dev/null
+++ b/qprintf.c
@@ -0,0 +1,63 @@
+/*****************************************************************************
+ * "Gif-Lib" - Yet another gif library.
+ *
+ * Written by: Gershon Elber IBM PC Ver 0.1, Jun. 1989
+ ******************************************************************************
+ * Module to emulate a printf with a possible quiet (disable mode.)
+ * A global variable GifQuietPrint controls the printing of this routine
+ ******************************************************************************
+ * History:
+ * 12 May 91 - Version 1.0 by Gershon Elber.
+ *****************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef HAVE_STDARG_H
+#include <stdarg.h>
+#elif defined (HAVE_VARARGS_H)
+#include <varargs.h>
+#endif /* HAVE_STDARG_H */
+
+#include "gif_lib.h"
+
+#ifdef __MSDOS__
+int GifQuietPrint = FALSE;
+#else
+int GifQuietPrint = TRUE;
+#endif /* __MSDOS__ */
+
+/*****************************************************************************
+ * Same as fprintf to stderr but with optional print.
+ *****************************************************************************/
+#ifdef HAVE_STDARG_H
+void
+GifQprintf(char *Format, ...) {
+ char Line[128];
+ va_list ArgPtr;
+
+ va_start(ArgPtr, Format);
+#else
+# ifdef HAVE_VARARGS_H
+void
+GifQprintf(va_alist)
+ va_dcl
+{
+ char *Format, Line[128];
+ va_list ArgPtr;
+
+ va_start(ArgPtr);
+ Format = va_arg(ArgPtr, char *);
+# endif /* HAVE_VARARGS_H */
+#endif /* HAVE_STDARG_H */
+ if (GifQuietPrint)
+ return;
+
+ vsprintf(Line, Format, ArgPtr);
+ va_end(ArgPtr);
+
+ fputs(Line, stderr);
+}