1 2 #include <setjmp.h> 3 #include <stdarg.h> 4 #include <stdio.h> 5 6 #include "dhcpd.h" 7 8 extern jmp_buf env; 9 int warnings_occurred; 10 11 void 12 error(const char *fmt, ...) 13 { 14 va_list ap; 15 16 va_start(ap, fmt); 17 (void)vfprintf(stderr, fmt, ap); 18 va_end(ap); 19 fprintf(stderr, "\n"); 20 21 longjmp(env, 1); 22 } 23 24 int 25 warning(const char *fmt, ...) 26 { 27 va_list ap; 28 29 va_start(ap, fmt); 30 (void)vfprintf(stderr, fmt, ap); 31 va_end(ap); 32 fprintf(stderr, "\n"); 33 34 /* 35 * The original warning() would return "ret" here. We do this to 36 * check warnings explicitly. 37 */ 38 longjmp(env, 1); 39 } 40 41 int 42 note(const char *fmt, ...) 43 { 44 int ret; 45 va_list ap; 46 47 va_start(ap, fmt); 48 ret = vfprintf(stderr, fmt, ap); 49 va_end(ap); 50 fprintf(stderr, "\n"); 51 52 return ret; 53 } 54 55 int 56 parse_warn(const char *fmt, ...) 57 { 58 int ret; 59 va_list ap; 60 61 va_start(ap, fmt); 62 ret = vfprintf(stderr, fmt, ap); 63 va_end(ap); 64 fprintf(stderr, "\n"); 65 66 return ret; 67 } 68 69 void 70 bootp(struct packet *packet) 71 { 72 } 73 74 void 75 dhcp(struct packet *packet) 76 { 77 } 78