Version increased to 0.9.8cvs20050303-2.1maemo2.
[udhcp] / libbb_udhcp.h
1 /* libbb_udhcp.h - busybox compatability wrapper */
2
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 DEFAULT_SCRIPT
8 #define DEFAULT_SCRIPT  "/share/udhcpc/default.script"
9 #endif
10
11 #ifndef _LIBBB_UDHCP_H
12 #define _LIBBB_UDHCP_H
13
14 #ifdef IN_BUSYBOX
15 #include "busybox.h"
16
17 #ifdef CONFIG_FEATURE_UDHCP_SYSLOG
18 #define UDHCP_SYSLOG
19 #endif
20
21 #ifdef CONFIG_FEATURE_UDHCP_DEBUG
22 #define UDHCP_DEBUG
23 #endif
24
25 #define COMBINED_BINARY
26 #include "version.h"
27
28 #define xfopen bb_xfopen
29
30 #else /* ! BB_VER */
31
32 #include <stdlib.h>
33 #include <stdio.h>
34 #include <sys/sysinfo.h>
35
36 #define TRUE                    1
37 #define FALSE                   0
38
39 #define xmalloc malloc
40 #define xcalloc calloc
41
42 static inline FILE *xfopen(const char *file, const char *mode)
43 {
44         FILE *fp;
45         if (!(fp = fopen(file, mode))) {
46                 perror("could not open input file");
47                 exit(0);
48         }
49         return fp;
50 }
51
52 #endif /* BB_VER */
53
54 #endif /* _LIBBB_UDHCP_H */