~gz/ubuntu/wily/steam/new_rel_udev_rules

« back to all changes in this revision

Viewing changes to sources/wiki/error.c

  • Committer: Package Import Robot
  • Author(s): Felix Geyer
  • Date: 2013-10-29 19:51:18 UTC
  • mfrom: (1.1.4) (0.1.4 trusty-proposed)
  • Revision ID: package-import@ubuntu.com-20131029195118-b9bxciz5hwx5z459
Tags: 1:1.0.0.39-2ubuntu1
Add an epoch to the version number as there was an unrelated steam package
in the archive with a higher version number.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * error.c
3
 
 *
4
 
 * Error printing functions.
5
 
 */
6
 
 
7
 
 
8
 
 
9
 
/*
10
 
 * Included headers:
11
 
 *
12
 
 * error: interface to the rest of the world
13
 
 * globals: Program_Name
14
 
 * stdio: fprintf(), fputc(), stderr
15
 
 * stdlib: EXIT_FAILURE
16
 
 * stdarg: va_list, va_start(), va_end(), vfprintf()
17
 
 */
18
 
#include "error.h"
19
 
#include "globals.h"
20
 
#include <stdio.h>
21
 
#include <stdlib.h>
22
 
#include <stdarg.h>
23
 
 
24
 
 
25
 
 
26
 
 
27
 
/*
28
 
 * error()
29
 
 *
30
 
 * Print a warning message to stderr, but don't quit
31
 
 */
32
 
void error(char *fmt, ...)
33
 
{
34
 
    va_list args;
35
 
    va_start(args, fmt);
36
 
 
37
 
    fprintf (stderr, "%s: ", Global.program_name);
38
 
    vfprintf(stderr, fmt, args);
39
 
    fputc('\n', stderr);
40
 
    
41
 
    va_end(args);
42
 
}
43
 
 
44
 
 
45
 
 
46
 
 
47
 
/*
48
 
 * fatal_error()
49
 
 *
50
 
 * Print a message to stderr and exit(EXIT_FAILURE)
51
 
 */
52
 
void fatal_error(char *fmt, ...)
53
 
{
54
 
    va_list args;
55
 
    va_start(args, fmt);
56
 
 
57
 
    fprintf (stderr, "%s: FATAL ERROR: ", Global.program_name);
58
 
    vfprintf(stderr, fmt, args);
59
 
    fputc('\n', stderr);
60
 
 
61
 
    va_end(args);
62
 
 
63
 
    exit(EXIT_FAILURE);
64
 
}