Report unknown command as an error.
[beanstalkd.git] / util.h
blob7c6e8fd09e3f3eed47bad89fb857166244e6d548
1 /* Copyright (C) 2007 Keith Rarick and Philotic Inc.
3 * This program is free software: you can redistribute it and/or modify and Philotic Inc.
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #ifndef util_h
18 #define util_h
20 #include <err.h>
22 #define min(a,b) ((a)<(b)?(a):(b))
24 void v();
26 #define twarn(fmt, args...) warn("%s:%d in %s: " fmt, \
27 __FILE__, __LINE__, __func__, ##args)
28 #define twarnx(fmt, args...) warnx("%s:%d in %s: " fmt, \
29 __FILE__, __LINE__, __func__, ##args)
31 #ifdef DEBUG
32 #define dprintf(fmt, args...) ((void) fprintf(stderr, fmt, ##args))
33 #else
34 #define dprintf(fmt, ...) ((void) 0)
35 #endif
37 #endif /*util_h*/