mirror of
https://github.com/topjohnwu/ndk-busybox.git
synced 2024-12-09 20:43:51 +00:00
Header file cleanup. platform.h apparently needs to be included early on so it
can figure out what header files to include, and override stuff that comes later. But applets shouldn't include platform.h directly, they should include busybox.h or libbb.h. Since busybox.h already includes libbb.h, move libbb.h to the top of busybox.h and platform.h near the top of libbb.h (right after bbconfig.h, which is something platform.h also needs access to). While we're at it, move some stuff from busybox.h to libbb.h so we have one big file to audit/clean up/try to make sense of instead of many.
This commit is contained in:
parent
8abbee474c
commit
b623a542df
@ -9,15 +9,6 @@
|
|||||||
|
|
||||||
#include "bb_config.h"
|
#include "bb_config.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <stdarg.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
|
|
||||||
extern const char BB_BANNER[];
|
|
||||||
|
|
||||||
/* Pull in the utility routines from libbb */
|
|
||||||
#include "libbb.h"
|
#include "libbb.h"
|
||||||
|
|
||||||
enum Location {
|
enum Location {
|
||||||
@ -54,22 +45,4 @@ extern const struct BB_applet applets[];
|
|||||||
#include "applets.h"
|
#include "applets.h"
|
||||||
#undef PROTOTYPES
|
#undef PROTOTYPES
|
||||||
|
|
||||||
#ifndef RB_POWER_OFF
|
|
||||||
/* Stop system and switch power off if possible. */
|
|
||||||
#define RB_POWER_OFF 0x4321fedc
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Try to pull in PATH_MAX */
|
|
||||||
#include <limits.h>
|
|
||||||
|
|
||||||
/* for PATH_MAX on systems that don't have it in limits.h */
|
|
||||||
#include <sys/param.h>
|
|
||||||
#ifndef PATH_MAX
|
|
||||||
#define PATH_MAX 256
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef DMALLOC
|
|
||||||
#include <dmalloc.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* _BB_INTERNAL_H_ */
|
#endif /* _BB_INTERNAL_H_ */
|
||||||
|
@ -11,23 +11,22 @@
|
|||||||
#ifndef __LIBBUSYBOX_H__
|
#ifndef __LIBBUSYBOX_H__
|
||||||
#define __LIBBUSYBOX_H__ 1
|
#define __LIBBUSYBOX_H__ 1
|
||||||
|
|
||||||
|
#include "bb_config.h"
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
|
|
||||||
|
#include <dirent.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
#include <netdb.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <termios.h>
|
|
||||||
#include <dirent.h>
|
|
||||||
|
|
||||||
#include <netinet/in.h>
|
|
||||||
#include <netdb.h>
|
|
||||||
|
|
||||||
#include <inttypes.h>
|
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <termios.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "bb_config.h"
|
|
||||||
#ifdef CONFIG_SELINUX
|
#ifdef CONFIG_SELINUX
|
||||||
#include <selinux/selinux.h>
|
#include <selinux/selinux.h>
|
||||||
#endif
|
#endif
|
||||||
@ -526,9 +525,22 @@ void *md5_end(void *resbuf, md5_ctx_t *ctx);
|
|||||||
|
|
||||||
extern uint32_t *bb_crc32_filltable (int endian);
|
extern uint32_t *bb_crc32_filltable (int endian);
|
||||||
|
|
||||||
/* busybox.h will include dmalloc later for us, else include it here. */
|
#ifndef RB_POWER_OFF
|
||||||
#if !defined _BB_INTERNAL_H_ && defined DMALLOC
|
/* Stop system and switch power off if possible. */
|
||||||
|
#define RB_POWER_OFF 0x4321fedc
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Try to pull in PATH_MAX */
|
||||||
|
#include <limits.h>
|
||||||
|
#include <sys/param.h>
|
||||||
|
#ifndef PATH_MAX
|
||||||
|
#define PATH_MAX 256
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef DMALLOC
|
||||||
#include <dmalloc.h>
|
#include <dmalloc.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
extern const char BB_BANNER[];
|
||||||
|
|
||||||
#endif /* __LIBBUSYBOX_H__ */
|
#endif /* __LIBBUSYBOX_H__ */
|
||||||
|
Loading…
Reference in New Issue
Block a user