1 /* opkg_message.h - the opkg package management system
3 Copyright (C) 2009 Ubiq Technologies <graham.gower@gmail.com>
4 Copyright (C) 2003 Daniele Nicolodi <daniele@grinta.net>
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License as
8 published by the Free Software Foundation; either version 2, or (at
9 your option) any later version.
11 This program is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
17 #ifndef _OPKG_MESSAGE_H_
18 #define _OPKG_MESSAGE_H_
24 ERROR
, /* error conditions */
25 NOTICE
, /* normal but significant condition */
26 INFO
, /* informational message */
27 DEBUG
, /* debug level message */
28 DEBUG2
, /* more debug level message */
31 void free_error_list(void);
32 void print_error_list(void);
33 void opkg_message(message_level_t level
, const char *fmt
, ...)
34 __attribute__ ((format(printf
, 2, 3)));
36 #define opkg_msg(l, fmt, args...) \
39 opkg_message(l, fmt, ##args); \
41 opkg_message(l, "%s: "fmt, __FUNCTION__, ##args); \
44 #define opkg_perror(l, fmt, args...) \
45 opkg_msg(l, fmt": %s.\n", ##args, strerror(errno))
47 #endif /* _OPKG_MESSAGE_H_ */