[go: up one dir, main page]

Menu

[efba94]: / util / qprintf.c  Maximize  Restore  History

Download this file

49 lines (38 with data), 1.4 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*****************************************************************************
* "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 GifNoisyPrint controls the printing of this routine
******************************************************************************
* History:
* 12 May 91 - Version 1.0 by Gershon Elber.
*****************************************************************************/
#include <stdio.h>
#include <stdbool.h>
#include <stdarg.h>
#include "gif_lib.h"
bool GifNoisyPrint = false;
/*****************************************************************************
* Same as fprintf to stderr but with optional print.
*****************************************************************************/
void
GifQprintf(char *Format, ...) {
char Line[128];
va_list ArgPtr;
va_start(ArgPtr, Format);
if (GifNoisyPrint) {
(void)vsnprintf(Line, sizeof(Line), Format, ArgPtr);
(void)fputs(Line, stderr);
}
va_end(ArgPtr);
}
void
PrintGifError(void) {
char *Err = GifErrorString();
if (Err != NULL)
fprintf(stderr, "\nGIF-LIB error: %s.\n", Err);
else
fprintf(stderr, "\nGIF-LIB undefined error %d.\n", GifError());
}