Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 1 | /* libbb_udhcp.h - busybox compatability wrapper */ |
2 | |||||
Russ Dill | 4e864a3 | 2003-12-18 22:25:38 +0000 | [diff] [blame] | 3 | /* bit of a hack, do this no matter what the order of the includes. |
4 | * (for busybox) */ | ||||
5 | |||||
6 | #ifdef CONFIG_INSTALL_NO_USR | ||||
7 | #undef DEFUALT_SCRIPT | ||||
8 | #define DEFAULT_SCRIPT "/share/udhcpc/default.script" | ||||
9 | #endif | ||||
10 | |||||
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 11 | #ifndef _LIBBB_UDHCP_H |
12 | #define _LIBBB_UDHCP_H | ||||
13 | |||||
Russ Dill | 54fde9e | 2002-12-11 22:43:37 +0000 | [diff] [blame] | 14 | #ifdef IN_BUSYBOX |
Russ Dill | 4b77aca | 2003-12-16 02:28:20 +0000 | [diff] [blame] | 15 | #include "busybox.h" |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 16 | |
17 | #ifdef CONFIG_FEATURE_UDHCP_SYSLOG | ||||
Russ Dill | 4e864a3 | 2003-12-18 22:25:38 +0000 | [diff] [blame] | 18 | #define UDHCP_SYSLOG |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 19 | #endif |
20 | |||||
21 | #ifdef CONFIG_FEATURE_UDHCP_DEBUG | ||||
Russ Dill | 4e864a3 | 2003-12-18 22:25:38 +0000 | [diff] [blame] | 22 | #define UDHCP_DEBUG |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 23 | #endif |
24 | |||||
25 | #define COMBINED_BINARY | ||||
Russ Dill | da97085 | 2002-11-05 20:10:21 +0000 | [diff] [blame] | 26 | #include "version.h" |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 27 | |
Russ Dill | 4b77aca | 2003-12-16 02:28:20 +0000 | [diff] [blame] | 28 | #define xfopen bb_xfopen |
29 | |||||
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 30 | #else /* ! BB_VER */ |
31 | |||||
Russ Dill | 4b77aca | 2003-12-16 02:28:20 +0000 | [diff] [blame] | 32 | #include <stdlib.h> |
33 | #include <stdio.h> | ||||
34 | |||||
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 35 | #define TRUE 1 |
36 | #define FALSE 0 | ||||
37 | |||||
38 | #define xmalloc malloc | ||||
Russ Dill | 4b77aca | 2003-12-16 02:28:20 +0000 | [diff] [blame] | 39 | #define xcalloc calloc |
40 | |||||
Russ Dill | 4b77aca | 2003-12-16 02:28:20 +0000 | [diff] [blame] | 41 | static inline FILE *xfopen(const char *file, const char *mode) |
42 | { | ||||
43 | FILE *fp; | ||||
44 | if (!(fp = fopen(file, mode))) { | ||||
45 | perror("could not open input file"); | ||||
46 | exit(0); | ||||
47 | } | ||||
48 | return fp; | ||||
49 | } | ||||
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 50 | |
51 | #endif /* BB_VER */ | ||||
52 | |||||
53 | #endif /* _LIBBB_UDHCP_H */ |