Release 0.9
[gedcom-parse.git] / message.c
1 /*  This program is free software; you can redistribute it and/or modify  *
2  *  it under the terms of the GNU General Public License as published by  *
3  *  the Free Software Foundation; either version 2 of the License, or     *
4  *  (at your option) any later version.                                   *
5
6  (C) 2001 by The Genes Development Team
7  Original author: Peter Verthez (Peter.Verthez@advalvas.be)
8 */
9
10 /* $Id$ */
11 /* $Name$ */
12
13 #include "gedcom.h"
14
15 int gedcom_message(char* s, ...)
16 {
17   int res;
18   va_list ap;
19
20   va_start(ap, s);
21   res = vfprintf(stderr, s, ap);
22   fprintf(stderr, "\n");
23   va_end(ap);
24   
25   return res;
26 }
27
28 int gedcom_warning(char* s, ...)
29 {
30   int res;
31   va_list ap;
32
33   va_start(ap, s);
34   fprintf(stderr, "Warning on line %d: ", line_no);
35   res = vfprintf(stderr, s, ap);
36   fprintf(stderr, "\n");
37   va_end(ap);
38   
39   return res;
40 }
41
42 int gedcom_error(char* s, ...)
43 {
44   int res;
45   va_list ap;
46
47   va_start(ap, s);
48   fprintf(stderr, "Error on line %d: ", line_no);
49   res = vfprintf(stderr, s, ap);
50   fprintf(stderr, "\n");
51   va_end(ap);
52   
53   return res;
54 }