File: fail.c

package info (click to toggle)
pngphoon 1.2-1
  • links: PTS
  • area: main
  • in suites: bullseye, buster, stretch
  • size: 552 kB
  • ctags: 106
  • sloc: ansic: 5,533; sh: 33; makefile: 16
file content (36 lines) | stat: -rw-r--r-- 483 bytes parent folder | download | duplicates (2)
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

#include "fail.h"

#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>

static int warning_disabled = 0;

void fail(const char * s, ...)
{
   va_list args;
   va_start( args, s );
   vfprintf( stderr, s, args );
   va_end( args );
   exit(1);
}


void warn( const char *s, ... )
{
   va_list args;
   if( warning_disabled )
   {
      return;
   }
   va_start( args, s );
   vfprintf( stderr, s, args );
   va_end( args );
}


void disablewarn()
{
   warning_disabled = 1;
}