File: qprintf.c

package info (click to toggle)
giflib 3.0-5
  • links: PTS
  • area: non-free
  • in suites: hamm
  • size: 1,044 kB
  • ctags: 961
  • sloc: ansic: 11,569; sh: 220; makefile: 153; perl: 54
file content (55 lines) | stat: -rw-r--r-- 1,554 bytes parent folder | download | duplicates (9)
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
49
50
51
52
53
54
55
/*****************************************************************************
*   "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.				     *
*****************************************************************************/

#include <stdio.h>

#ifdef USE_VARARGS
#include <varargs.h>
#else
#include <stdarg.h>
#endif /* USE_VARARGS */

#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 USE_VARARGS
void GifQprintf(int va_alist)
{
    char *Format, Line[128];
    va_list ArgPtr;

    va_start(ArgPtr);
    Format = va_arg(ArgPtr, char *);
#else
void GifQprintf(char *Format, ...)
{
    char Line[128];
    va_list ArgPtr;

    va_start(ArgPtr, Format);
#endif /* USE_VARARGS */

    if (GifQuietPrint) return;

    vsprintf(Line, Format, ArgPtr);
    va_end(ArgPtr);

    fputs(Line, stderr);
}