Implemented force install
[spkg.git] / src / message.c
blob693f9af229f11f83162e8bc43543abf879c4608c
1 /*----------------------------------------------------------------------*\
2 |* spkg - The Unofficial Slackware Linux Package Manager *|
3 |* designed by Ondøej Jirman, 2005 *|
4 |*----------------------------------------------------------------------*|
5 |* No copy/usage restrictions are imposed on anybody. *|
6 \*----------------------------------------------------------------------*/
7 #include <stdlib.h>
8 #include <stdio.h>
9 #include <string.h>
11 #include "message.h"
13 static gint _msg_verbosity = 1;
15 void msg_setup(gint verbosity)
17 _msg_verbosity = verbosity;
20 void msg(const gint type, const gchar* fmt, ...)
22 g_assert(fmt != 0);
23 if (_msg_verbosity < type)
24 return;
25 if (type == 2)
26 printf("WARNING: ");
27 if (type == 3)
28 printf(" --> ");
29 if (type == 4)
30 printf(" --> ");
31 va_list ap;
32 va_start(ap, fmt);
33 vprintf(fmt, ap);
34 va_end(ap);
35 printf("\n");