blob: 9b5d5a84680354cbbb3b586273dd29206eeb7560 [file] [log] [blame]
Russ Dill61fb4892002-10-14 21:41:28 +00001/* libbb_udhcp.h - busybox compatability wrapper */
2
Russ Dill4e864a32003-12-18 22:25:38 +00003/* 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 Dill61fb4892002-10-14 21:41:28 +000011#ifndef _LIBBB_UDHCP_H
12#define _LIBBB_UDHCP_H
13
Russ Dill54fde9e2002-12-11 22:43:37 +000014#ifdef IN_BUSYBOX
Russ Dill4b77aca2003-12-16 02:28:20 +000015#include "busybox.h"
Russ Dill61fb4892002-10-14 21:41:28 +000016
17#ifdef CONFIG_FEATURE_UDHCP_SYSLOG
Russ Dill4e864a32003-12-18 22:25:38 +000018#define UDHCP_SYSLOG
Russ Dill61fb4892002-10-14 21:41:28 +000019#endif
20
21#ifdef CONFIG_FEATURE_UDHCP_DEBUG
Russ Dill4e864a32003-12-18 22:25:38 +000022#define UDHCP_DEBUG
Russ Dill61fb4892002-10-14 21:41:28 +000023#endif
24
25#define COMBINED_BINARY
Russ Dillda970852002-11-05 20:10:21 +000026#include "version.h"
Russ Dill61fb4892002-10-14 21:41:28 +000027
Russ Dill4b77aca2003-12-16 02:28:20 +000028#define xfopen bb_xfopen
29
Russ Dill61fb4892002-10-14 21:41:28 +000030#else /* ! BB_VER */
31
Russ Dill4b77aca2003-12-16 02:28:20 +000032#include <stdlib.h>
33#include <stdio.h>
34
Russ Dill61fb4892002-10-14 21:41:28 +000035#define TRUE 1
36#define FALSE 0
37
38#define xmalloc malloc
Russ Dill4b77aca2003-12-16 02:28:20 +000039#define xcalloc calloc
40
Russ Dill4b77aca2003-12-16 02:28:20 +000041static 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 Dill61fb4892002-10-14 21:41:28 +000050
51#endif /* BB_VER */
52
53#endif /* _LIBBB_UDHCP_H */