diff options
author | Ron Yorston <rmy@pobox.com> | 2020-11-12 08:27:51 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2020-11-12 08:27:51 +0000 |
commit | ead8b92e3d66ab45235e137f85fb3a529dcc64ef (patch) | |
tree | af268270382dad969218063d4a8120fc91a9e631 /include | |
parent | 567728c22dddea4ed33b8a69641ba2e0c3f1f600 (diff) | |
parent | 64981b4c8e88812c322bee3832f1d421ff670ed5 (diff) | |
download | busybox-w32-ead8b92e3d66ab45235e137f85fb3a529dcc64ef.tar.gz busybox-w32-ead8b92e3d66ab45235e137f85fb3a529dcc64ef.tar.bz2 busybox-w32-ead8b92e3d66ab45235e137f85fb3a529dcc64ef.zip |
Merge branch 'busybox' into merge
Diffstat (limited to 'include')
-rw-r--r-- | include/dump.h | 15 | ||||
-rw-r--r-- | include/libbb.h | 34 |
2 files changed, 23 insertions, 26 deletions
diff --git a/include/dump.h b/include/dump.h index 4c237ef05..9193a6925 100644 --- a/include/dump.h +++ b/include/dump.h | |||
@@ -2,20 +2,6 @@ | |||
2 | 2 | ||
3 | PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN | 3 | PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN |
4 | 4 | ||
5 | #define F_IGNORE 0x01 /* %_A */ | ||
6 | #define F_SETREP 0x02 /* rep count set, not default */ | ||
7 | #define F_ADDRESS 0x001 /* print offset */ | ||
8 | #define F_BPAD 0x002 /* blank pad */ | ||
9 | #define F_C 0x004 /* %_c */ | ||
10 | #define F_CHAR 0x008 /* %c */ | ||
11 | #define F_DBL 0x010 /* %[EefGf] */ | ||
12 | #define F_INT 0x020 /* %[di] */ | ||
13 | #define F_P 0x040 /* %_p */ | ||
14 | #define F_STR 0x080 /* %s */ | ||
15 | #define F_U 0x100 /* %_u */ | ||
16 | #define F_UINT 0x200 /* %[ouXx] */ | ||
17 | #define F_TEXT 0x400 /* no conversions */ | ||
18 | |||
19 | enum dump_vflag_t { ALL, DUP, FIRST, WAIT }; /* -v values */ | 5 | enum dump_vflag_t { ALL, DUP, FIRST, WAIT }; /* -v values */ |
20 | 6 | ||
21 | typedef struct PR { | 7 | typedef struct PR { |
@@ -46,6 +32,7 @@ typedef struct dumper_t { | |||
46 | off_t dump_skip; /* bytes to skip */ | 32 | off_t dump_skip; /* bytes to skip */ |
47 | int dump_length; /* max bytes to read */ | 33 | int dump_length; /* max bytes to read */ |
48 | smallint dump_vflag; /*enum dump_vflag_t*/ | 34 | smallint dump_vflag; /*enum dump_vflag_t*/ |
35 | const char *eofstring; | ||
49 | FS *fshead; | 36 | FS *fshead; |
50 | } dumper_t; | 37 | } dumper_t; |
51 | 38 | ||
diff --git a/include/libbb.h b/include/libbb.h index c09db66eb..eb8b63895 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -357,12 +357,13 @@ struct BUG_off_t_size_is_misdetected { | |||
357 | #endif | 357 | #endif |
358 | #endif | 358 | #endif |
359 | 359 | ||
360 | #if defined(__GLIBC__) | 360 | #if defined(errno) |
361 | /* glibc uses __errno_location() to get a ptr to errno */ | 361 | /* If errno is a define, assume it's "define errno (*__errno_location())" |
362 | /* We can just memorize it once - no multithreading in busybox :) */ | 362 | * and we will cache it's result in this variable */ |
363 | extern int *const bb_errno; | 363 | extern int *const bb_errno; |
364 | #undef errno | 364 | #undef errno |
365 | #define errno (*bb_errno) | 365 | #define errno (*bb_errno) |
366 | #define bb_cached_errno_ptr 1 | ||
366 | #endif | 367 | #endif |
367 | 368 | ||
368 | #if !(ULONG_MAX > 0xffffffff) | 369 | #if !(ULONG_MAX > 0xffffffff) |
@@ -454,15 +455,23 @@ enum { | |||
454 | ACTION_FOLLOWLINKS = (1 << 1), | 455 | ACTION_FOLLOWLINKS = (1 << 1), |
455 | ACTION_FOLLOWLINKS_L0 = (1 << 2), | 456 | ACTION_FOLLOWLINKS_L0 = (1 << 2), |
456 | ACTION_DEPTHFIRST = (1 << 3), | 457 | ACTION_DEPTHFIRST = (1 << 3), |
457 | /*ACTION_REVERSE = (1 << 4), - unused */ | 458 | ACTION_QUIET = (1 << 4), |
458 | ACTION_QUIET = (1 << 5), | 459 | ACTION_DANGLING_OK = (1 << 5), |
459 | ACTION_DANGLING_OK = (1 << 6), | ||
460 | }; | 460 | }; |
461 | typedef uint8_t recurse_flags_t; | 461 | typedef uint8_t recurse_flags_t; |
462 | extern int recursive_action(const char *fileName, unsigned flags, | 462 | typedef struct recursive_state { |
463 | int FAST_FUNC (*fileAction)(const char *fileName, struct stat* statbuf, void* userData, int depth), | 463 | unsigned flags; |
464 | int FAST_FUNC (*dirAction)(const char *fileName, struct stat* statbuf, void* userData, int depth), | 464 | unsigned depth; |
465 | void* userData, unsigned depth) FAST_FUNC; | 465 | void *userData; |
466 | int FAST_FUNC (*fileAction)(struct recursive_state *state, const char *fileName, struct stat* statbuf); | ||
467 | int FAST_FUNC (*dirAction)(struct recursive_state *state, const char *fileName, struct stat* statbuf); | ||
468 | } recursive_state_t; | ||
469 | int recursive_action(const char *fileName, unsigned flags, | ||
470 | int FAST_FUNC (*fileAction)(struct recursive_state *state, const char *fileName, struct stat* statbuf), | ||
471 | int FAST_FUNC (*dirAction)(struct recursive_state *state, const char *fileName, struct stat* statbuf), | ||
472 | void *userData | ||
473 | ) FAST_FUNC; | ||
474 | |||
466 | extern int device_open(const char *device, int mode) FAST_FUNC; | 475 | extern int device_open(const char *device, int mode) FAST_FUNC; |
467 | enum { GETPTY_BUFSIZE = 16 }; /* more than enough for "/dev/ttyXXX" */ | 476 | enum { GETPTY_BUFSIZE = 16 }; /* more than enough for "/dev/ttyXXX" */ |
468 | extern int xgetpty(char *line) FAST_FUNC; | 477 | extern int xgetpty(char *line) FAST_FUNC; |
@@ -856,7 +865,7 @@ ssize_t recv_from_to(int fd, void *buf, size_t len, int flags, | |||
856 | struct sockaddr *to, | 865 | struct sockaddr *to, |
857 | socklen_t sa_size) FAST_FUNC; | 866 | socklen_t sa_size) FAST_FUNC; |
858 | 867 | ||
859 | uint16_t inet_cksum(uint16_t *addr, int len) FAST_FUNC; | 868 | uint16_t inet_cksum(const void *addr, int len) FAST_FUNC; |
860 | int parse_pasv_epsv(char *buf) FAST_FUNC; | 869 | int parse_pasv_epsv(char *buf) FAST_FUNC; |
861 | 870 | ||
862 | /* 0 if argv[0] is NULL: */ | 871 | /* 0 if argv[0] is NULL: */ |
@@ -1558,7 +1567,8 @@ int del_loop(const char *device) FAST_FUNC; | |||
1558 | * malloc and return it in *devname. | 1567 | * malloc and return it in *devname. |
1559 | * return value is the opened fd to the loop device, or < on error | 1568 | * return value is the opened fd to the loop device, or < on error |
1560 | */ | 1569 | */ |
1561 | int set_loop(char **devname, const char *file, unsigned long long offset, unsigned flags) FAST_FUNC; | 1570 | int set_loop(char **devname, const char *file, unsigned long long offset, |
1571 | unsigned long long sizelimit, unsigned flags) FAST_FUNC; | ||
1562 | /* These constants match linux/loop.h (without BB_ prefix): */ | 1572 | /* These constants match linux/loop.h (without BB_ prefix): */ |
1563 | #define BB_LO_FLAGS_READ_ONLY 1 | 1573 | #define BB_LO_FLAGS_READ_ONLY 1 |
1564 | #define BB_LO_FLAGS_AUTOCLEAR 4 | 1574 | #define BB_LO_FLAGS_AUTOCLEAR 4 |