File: libbb_udhcp.h

package info (click to toggle)
udhcp 0.9.8cvs20050124-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 464 kB
  • ctags: 356
  • sloc: ansic: 2,774; makefile: 243; sh: 195
file content (54 lines) | stat: -rw-r--r-- 938 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/* libbb_udhcp.h - busybox compatability wrapper */

/* bit of a hack, do this no matter what the order of the includes.
 * (for busybox) */

#ifdef CONFIG_INSTALL_NO_USR
#undef DEFAULT_SCRIPT
#define DEFAULT_SCRIPT  "/share/udhcpc/default.script"
#endif

#ifndef _LIBBB_UDHCP_H
#define _LIBBB_UDHCP_H

#ifdef IN_BUSYBOX
#include "busybox.h"

#ifdef CONFIG_FEATURE_UDHCP_SYSLOG
#define UDHCP_SYSLOG
#endif

#ifdef CONFIG_FEATURE_UDHCP_DEBUG
#define UDHCP_DEBUG
#endif

#define COMBINED_BINARY
#include "version.h"

#define xfopen bb_xfopen

#else /* ! BB_VER */

#include <stdlib.h>
#include <stdio.h>
#include <sys/sysinfo.h>

#define TRUE			1
#define FALSE			0

#define xmalloc malloc
#define xcalloc calloc

static inline FILE *xfopen(const char *file, const char *mode)
{
	FILE *fp;
	if (!(fp = fopen(file, mode))) {
		perror("could not open input file");
		exit(0);
	}
	return fp;
}

#endif /* BB_VER */

#endif /* _LIBBB_UDHCP_H */